You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/docs/reference/tracing.mdx
+63-66
Original file line number
Diff line number
Diff line change
@@ -16,109 +16,106 @@ import TabItem from '@theme/TabItem';
16
16
17
17
## Summary
18
18
19
-
Tracing tracks the progression of a single user request as it is handled by Pomerium.
19
+
Pomerium has comprehensive support for OpenTelemetry tracing, allowing detailed introspection into requests and authorization flows.
20
+
You can use tracing to debug errors and latency issues in your applications.
20
21
21
-
Each unit of work is called a Span in a trace. Spans include metadata about the work, including the time spent in the step (latency), status, time events, attributes, links. You can use tracing to debug errors and latency issues in your applications, including in downstream connections.
22
-
23
-
## How to configure
22
+
## Configuration
24
23
25
24
<Tabs>
26
25
<TabItemvalue="Core"label="Core">
27
26
28
-
#### Shared Tracing Settings
27
+
### Environment Variables
28
+
29
+
The recommended way to configure tracing is by using the standard OpenTelemetry environment variables:
The main variables used to configure tracing in Pomerium are the following:
29
34
30
-
| Config Key | Description | Required |
31
-
| :-- | :-- | --- |
32
-
| tracing_provider | The name of the tracing provider. (e.g. Jaeger, Zipkin) | ✅ |
33
-
| tracing_sample_rate | Percentage of requests to sample in decimal notation. Default is `0.0001`, or .01% | ❌ |
35
+
| Name | Description | Default |
36
+
| :--- | :---------- | :------ |
37
+
|[`OTEL_TRACES_EXPORTER`](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exporter-selection)| Trace exporter to be used. <br/> Valid values are `"otlp"` or `"none"`|`"none"`|
38
+
|[`OTEL_EXPORTER_OTLP_ENDPOINT`](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_endpoint) or <br/> [`OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_traces_endpoint)| See [Endpoint Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#endpoint-configuration). |
39
+
|[`OTEL_EXPORTER_OTLP_PROTOCOL`](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_protocol) or <br/> [`OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_traces_protocol)| See [Protocol Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#protocol-configuration). <br/> Valid values are `"grpc"` or `"http/protobuf"`. <br/>If unset, Pomerium will attempt to determine the protocol based on the endpoint port number (the standard ports are 4317 for GRPC, 4318 for HTTP), otherwise it will default to `"http/protobuf"`. | (auto) |
40
+
|[`OTEL_TRACES_SAMPLER_ARG`](https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_traces_sampler_arg)| Sampling probability, a number in the \[0..1\] range, e.g. `1.0` (sample all traces) or `0.25` (sample 25% of traces) |`1.0`|
34
41
35
-
Set `tracing_sample_rate = 1` if you want to see all requests in the tracings.
42
+
### Config file
36
43
37
-
#### Datadog
44
+
Tracing can also be configured using the Pomerium config file if desired:
38
45
39
-
Datadog is a real-time monitoring system that supports distributed tracing and monitoring.
| tracing_datadog_address |`host:port` address of the Datadog Trace Agent. Defaults to `localhost:8126`| ❌ |
53
+
</TabItem>
54
+
<TabItemvalue="Enterprise"label="Enterprise">
44
55
45
-
#### Jaeger (partial)
56
+
1. In the Enterprise Console, navigate to Settings > Tracing
46
57
47
-
**Warning** At this time, the Jaeger protocol does not capture spans inside the Proxy Service. Please use the Zipkin protocol with Jaeger for full support.
58
+
2. In the "Tracing Provider" dropdown, select "OTLP"
48
59
49
-
[Jaeger](https://www.jaegertracing.io/) is a distributed tracing system released as open source by Uber Technologies. It is used for monitoring and troubleshooting microservices-based distributed systems, including:
60
+
3. Enter your desired sample rate and OTLP endpoint
61
+
62
+
4. Optionally, enter a protocol ("grpc" or "http/protobuf"). If the endpoint uses port 4317 or 4318, the protocol will be selected automatically. Port 4317 is the standard for OTLP GRPC, and 4318 for OTLP HTTP.
| tracing_jaeger_collector_endpoint | Url to the Jaeger HTTP Thrift collector. | ✅ |
60
-
| tracing_jaeger_agent_endpoint | Send spans to jaeger-agent at this address. | ✅ |
70
+
### Using Jaeger to visualize trace data
61
71
62
-
For quick local testing, use Jaeger all-in-one, which is an executable designed to launch the Jaeger UI, jaeger-collector, jaeger-query, and jaeger-agent, with an in-memory storage component.
72
+
[Jaeger](https://www.jaegertracing.io/) is a popular open-source tracing platform. It can be used to collect trace data and visualize it in the browser.
Open Jaeger UI at `http://localhost:16686` in the browser to view Pomerium traces.
89
+
3. Navigate to a Pomerium route defined in the config file
91
90
92
-
#### Zipkin
91
+
4. Open your browser to http://localhost:16686 to view traces in the Jaeger UI.
93
92
94
-
Zipkin is an open-source distributed tracing system and protocol.
93
+
### Tracing errors
95
94
96
-
Many tracing backends support Zipkin either directly or through intermediary agents, including Jaeger. For full tracing support, we recommend using the Zipkin tracing protocol.
95
+
A typo in the OAuth2 issuer URL configuration is a common mistake that can lead to unexpected errors.
96
+
A user attempting to navigate to a Pomerium route that requires authentication might see an error page instead of being redirected to the Identity Provider.
97
+
In the Jaeger UI, traces that contain errors are highlighted and easy to find:
Clicking on this trace will show us the original unauthenticated request (`GET https://verify.localhost.pomerium.io/`) and that it was redirected to sign in.
102
+
When attempting to initiate the auth flow, an error was encountered, which was recorded in the trace:

110
+
Pomerium can trace a request's entire journey through the authentication process, across multiple individual redirects between Pomerium services and the Identity Provider.
112
111
113
-
2. Configure tracing **Endpoints**
112
+
For example, this trace shows an unauthenticated request (`GET https://verify.localhost.pomerium.io/`) that triggered a sequence of redirects to perform the auth flow:
0 commit comments