Tracing Zitadel with OpenTelemetry: when a slow login needs more than logs
Traces show where a slow login spends its time, across the reverse proxy, Zitadel and PostgreSQL. If logins are intermittently slow or failing and your team cannot tell whether the delay sits in the proxy, in Zitadel or in the database, distributed tracing is the tool that answers it. Metrics show that login latency rose, and logs show that individual requests failed, but neither shows the path one request took through each hop. OpenTelemetry is the framework that produces that path. It is a set of APIs, SDKs and tools for generating, exporting and collecting telemetry such as traces, metrics and logs, and it is not a storage or visualization backend. Your trace data still needs a separate backend such as Jaeger or Grafana Tempo, and the OpenTelemetry Collector sits between Zitadel and that backend to receive, process and forward the data.
Teams usually need traces when a problem crosses process boundaries and the existing signals point in different directions. A metric can show that the token endpoint's p95 latency doubled, and a log line can show a timeout on a database call, but correlating those to one user's login requires a shared trace identifier passed through the proxy, Zitadel and the database client. Before you commit to tracing, confirm in the Zitadel documentation for your version which trace settings it exposes and whether the span names and attributes cover the login and token paths you care about. Also confirm that your proxy can propagate trace context headers, because a missing hop breaks the trace into fragments that are hard to read.
Where spans are created and exported on a login request
A login starts in the user's browser and passes through the reverse proxy to Zitadel, which creates spans for each request and for its calls to PostgreSQL. Those spans leave Zitadel and go to the OpenTelemetry Collector, which receives, processes and exports them to the trace backend. The trust boundary around the Collector and backend marks where telemetry leaves the application path. Check that the proxy passes trace context headers through, and that the Collector and backend sit inside infrastructure you control.
Spans from the proxy and Zitadel flow to the Collector and trace backend.
Choosing a tracing backend and Collector deployment
Jaeger is a tracing backend that receives spans and gives engineers a trace search and waterfall view. It fits teams that mainly need to find and inspect individual slow requests, such as a login that took several seconds, and want a dedicated tracing interface rather than a broader observability stack. Confirm the storage it will use and how long traces must be kept before choosing it, because those settings drive most of its operational load.
- Query model: Engineers search by service, operation and duration, then open a single trace to see where time was spent.
- Storage choice: Plan the storage backend and its sizing up front, since trace volume grows with request rate and sampling settings.
- Retention: Set how long traces are kept, and confirm whether investigations need traces older than your standard log retention.
- Ownership: Someone must run, upgrade and back up the Jaeger components and their storage.
- Integration: Confirm that the Collector exporter you plan to use is supported for your chosen Jaeger release.
Before committing, confirm the supported storage options, retention limits and upgrade path with your platform team and the Jaeger documentation.
Grafana Tempo is a tracing backend designed to store traces in object storage, and it is commonly used alongside Grafana for viewing traces next to metrics and logs. It fits organizations that already run Grafana and Loki, or that want traces, metrics and logs to be explored from one interface. Confirm the query patterns your team needs, because trace lookup by identifier and search by attribute may behave differently from a dedicated tracing UI.
- Storage model: Traces are typically kept in object storage, so object storage capacity, access and lifecycle rules become part of the design.
- Visualization: Teams can correlate traces with dashboards and logs in Grafana, which helps when following a login across services.
- Operations: Plan for running and upgrading the Tempo components and for monitoring their health.
- Retention: Set retention in the storage layer and confirm that it matches your security investigation window.
- Query needs: Test the attribute searches your engineers will rely on during an incident before relying on them.
Confirm the deployment mode, storage backend, retention settings and query capabilities against the current Grafana Tempo documentation for your version.
In agent placement, a Collector runs next to each workload, such as on the same host or as a sidecar or daemon in the same cluster node. Each agent receives spans from local services and forwards them onward. This keeps the hop short and isolates each node's exporting, but it multiplies the configuration you must maintain. The OpenTelemetry Collector can run as an agent next to services, which is the model this placement follows.
- Local buffering: Agents close to the workload keep exporting close to the source, so a backend outage affects each node's queue separately.
- Configuration count: Every agent needs its own configuration, so changes must be rolled out consistently across nodes.
- Credentials: Each agent may need access to the backend or to an authentication extension, which increases the number of places secrets live.
- Resource use: Agents consume CPU and memory on every node where they run, so confirm capacity on your busiest hosts.
- Upgrades: Plan a rollout process for updating agents across the fleet.
Confirm the agent resource footprint and configuration management approach with your platform team before deploying.
In gateway placement, one or more central Collectors receive telemetry from many sources and export it to the backend. The Collector can run as a gateway that accepts data from many sources. This gives a single point to apply processing, sampling, authentication and export settings, which suits teams that want consistent policy. The trade-off is that the gateway becomes a shared dependency that must be sized, made highly available and watched.
- Central policy: Sampling, redaction and export rules live in one place, which simplifies review during a security assessment.
- Scaling: Confirm how many gateway instances you need for peak span volume, and how traffic is balanced across them.
- Failure impact: A gateway outage can stop telemetry from many services at once, so plan redundancy and alerting.
- Authentication: Collector authenticator extensions can check incoming connections, which is easier to standardize at a gateway.
- Network path: Confirm that workloads can reach the gateway, and that the gateway can reach the backend.
Confirm expected span volume, gateway redundancy and network routes with your platform team before choosing this placement.
A hybrid placement runs lightweight agents on nodes and forwards to a gateway tier that handles processing and export. It combines local collection with central policy, and it is a common pattern when a team wants nodes to stay simple while the gateway enforces rules. It also adds a second hop and a second set of components to operate, so the benefit should outweigh that overhead for your environment.
- Two layers: Agents handle local receipt, and gateways handle processing and export, so each layer needs its own configuration.
- Clear ownership: Platform engineers can own the gateway, while application teams can own their node agents.
- Failure isolation: Agent buffering can absorb short gateway interruptions, but confirm the buffer limits for your traffic.
- Change control: Two layers mean two rollouts for each configuration change.
- Testing: Verify the full path end to end with a sample login trace before relying on it.
Confirm buffer behavior, rollout procedures and ownership boundaries with your team before adopting this model.
Setting up the Zitadel trace pipeline step by step
This sequence takes a self-hosted Zitadel from no tracing to a verified trace that follows one login across the proxy, Zitadel and PostgreSQL, using an OpenTelemetry Collector between them and your chosen backend.
Confirm the deployed Zitadel version and its tracing settings
Your platform team records the exact Zitadel version in your environment and reads the tracing section of the self-hosting configuration reference for that version. Key names, the endpoint format and the sampling options can change between releases, so the values in your configuration must come from the docs for the version you run, not from memory or an older blog post. Check that the deployment method (Kubernetes with the Helm chart, Docker Compose or binaries) can pass environment variables or config files to the Zitadel container. The step is done when you have a written list of the tracing keys you will set and the version they were confirmed against.
Deploy Zitadel and confirm a baseline login
Deploy or confirm the Zitadel backend with PostgreSQL in a supported version range, and run a test login through the normal public URL before any tracing is enabled. This gives you a known-good baseline and confirms that the proxy, Zitadel and database respond. Your team owns this step if you run the platform, or the implementation partner owns it under a written scope. The step is done when a test user can sign in through the console or a test OIDC client and the health endpoints report ready, so any later tracing problem can be separated from a broken deployment.
Deploy a Collector with an OTLP receiver and exporter
Install the OpenTelemetry Collector from a release that fits your platform, using the contrib distribution if you need components beyond the core set. Configure an OTLP receiver that listens on the gRPC or HTTP port Zitadel will send to, a batch processor, and an exporter that forwards traces to your backend, such as Jaeger, Grafana Tempo or another OTLP-compatible store. Check the stability level of each component in its README before relying on it in production. The step is done when the Collector starts without configuration errors, its logs show the receiver and exporter are active, and a test span sent with a simple tool reaches the backend.
Point Zitadel's tracing endpoint at the Collector
Set the tracing exporter and endpoint in Zitadel's configuration to the address of the Collector's OTLP receiver, using the key names confirmed in step one. Use a service address that is reachable from the Zitadel pods or containers and keep the Collector on the internal network, not on a public address. Restart or roll Zitadel so the new configuration loads, then confirm it started cleanly. The step is done when Zitadel logs show the tracing exporter initialized without connection errors and the Collector logs show incoming span batches from Zitadel.
Set sampling for a controlled trace volume
Choose a sampling rate that matches your traffic and retention budget before you turn the rate up for investigations. Start with a low ratio during validation, then adjust it in the configuration confirmed for your version. Keep in mind that sampling decisions made at the head drop whole traces, so a slow login is missed if it is not sampled. Ask your backend team how long traces are retained and what storage they cost. The step is done when a documented sampling value is set, the Collector receives spans at the expected rate for a few test logins, and the team agrees who can change the value and how.
Enable tracing at the proxy and database layers
Trace continuity depends on the reverse proxy or ingress passing trace context headers to Zitadel and on the database client propagating the active span. Enable tracing or OpenTelemetry support in your proxy and confirm the trace context header format matches what Zitadel reads. Database spans are generated by Zitadel's own instrumentation, so confirm in the docs for your version what it emits for PostgreSQL calls. The step is done when a request sent through the proxy shows a trace ID in the proxy access log and the same trace ID appears in Zitadel's logs or spans.
Verify one test login produces a connected trace
Run a single test login through the public URL, then search for it in your tracing backend by service name or trace ID. A complete trace should show the request entering the proxy, the Zitadel spans for the login and token steps, and the database spans beneath them, all sharing one trace ID. If the database spans are missing or the trace splits into separate fragments, check header propagation at the proxy and the instrumentation settings for your version before changing sampling. The step is done when you can open one trace and identify each hop with its duration, and you record which spans were absent so the gap is tracked.
Document the pipeline and assign ownership
Write down the Collector configuration, the Zitadel tracing keys with their confirmed version, the sampling value, the proxy settings and the backend retention period in your operations runbook. Name the owner for each component and the process for changing sampling during an incident. Store the configuration in version control with the Zitadel deployment so changes are reviewed. The step is done when a colleague who did not build the pipeline can locate every setting, reproduce the verification login and explain what a healthy trace looks like.
Setting sampling without losing the slow logins
The core decision is where sampling happens. Head sampling decides whether to keep a trace when its first span starts, so it is cheap and needs no buffering, but it cannot know yet whether the request will turn out slow or failed. Tail sampling waits until a trace is complete and then applies rules such as keeping every trace with an error or a long duration. That makes tail sampling far better at keeping the rare slow login, at the price of holding spans in memory on the Collector until each trace finishes. Whichever you choose, a low fixed head-sampling ratio will quietly discard most of the slow logins you are trying to investigate, because they are a small fraction of total traffic.
Storing every span is the simplest option and the most expensive. Login flows fan out across the reverse proxy, Zitadel and PostgreSQL, and each request can produce many spans, so volume grows with traffic and with how much instrumentation is enabled. Cost falls on your storage backend, on Collector CPU and memory, and on the engineering time spent maintaining it. Ask your team to measure span volume per login at expected peak before choosing a policy, and to set a retention period that matches how long slow-login investigations actually take place.
Sampling settings and their effect on Zitadel should be confirmed in the Zitadel and Collector documentation for the chosen versions, since defaults and the components that handle sampling can change between releases. Check which trace settings the Zitadel version you run exposes, and whether the tail sampling processor in your Collector distribution is stable enough for production. Test the policy with a deliberately slow login in a staging environment and confirm the trace appears in your backend before you rely on it.
Protecting trace data and the Collector endpoint
Traces carry more than timing. They can hold user identifiers, tenant names, request paths and query fragments, and the Collector sits in the path where that data is received and forwarded. The cards below cover what to review in span data, who can read the backend, how exporters and receivers prove who they are, and how to verify the Collector build you deploy.
Review span attributes for personal data
Zitadel spans and the proxy spans around them can carry user IDs, login names, email-like identifiers, organization IDs and URL query parameters. Before enabling export, list the attributes your proxy and the Collector add or keep, and decide which to drop or hash. Use a Collector processor to remove keys such as query strings in a test environment first, then confirm with a sample of exported spans that nothing personal leaves your network unintended.
Restrict who can query the backend
Traces often reveal login patterns and internal topology, so the Jaeger or Tempo query interface deserves the same access control as your logs. Limit read access by team, and confirm whether your chosen backend and its UI support per-tenant or role-based access. Keep administrative access to the storage layer separate from read access to the query front end.
Authenticate exporters and receivers
A Collector that accepts spans from the network should not accept them from anyone. Collector authenticator extensions can check incoming connections on a receiver, for example with OIDC, and can attach credentials to outgoing exporter requests through the oauth2client extension. Confirm that the extension and the receiver you choose are supported together, and test that an unauthenticated sender is rejected.
Follow Collector configuration best practices
The OpenTelemetry security guidance for Collector configuration covers settings such as binding receivers to specific interfaces, enabling TLS on receivers and exporters, and avoiding debug exporters in production. Review your configuration against that page before each change, and keep the configuration in version control so the reviewed version is the one running.
Collector best practicesVerify signed Collector artifacts
Collector releases ship contrib builds with signed artifacts, SHA256 checksums and SBOM files. Before deploying a version, verify the signature and checksum of the binary or image you pull, and keep the SBOM with your change record so you can check it against known vulnerabilities. Ask your platform team who approves new Collector versions and how quickly security fixes reach your environment.
Collector releasesQuestions teams ask before tracing Zitadel
How much does it cost to add OpenTelemetry tracing to a self-hosted Zitadel?
Cost depends on scope, and no price is given here. Tracing work usually has two parts: a one-time build of the Collector pipeline, the Zitadel tracing settings and the trace backend, and a recurring share for storage, retention and upkeep. The main drivers are the number of environments, whether you run Jaeger, Grafana Tempo or another backend, and whether your existing observability stack already runs a Collector. Ask any partner for a written scope that lists each environment, the backend, the Collector deployment model (agent or gateway), the proxy and database instrumentation covered, and who operates the result after handover. Ask separately what is one-time and what is a retainer.
How long does it take to get the first working Zitadel trace?
The first trace depends on how quickly access and decisions are made, not on a fixed duration. A single environment with a cluster you already operate and a backend you already run is the shortest path. Delays usually come from waiting for cluster access, agreeing where the Collector runs, confirming network paths from Zitadel and the proxy to the Collector, and deciding how long traces are kept. Ask for the timeline in the written scope, with named client dependencies, so the first trace is a milestone you can check rather than an estimate.
What does our team need to provide before tracing starts?
Plan to provide several inputs before any configuration changes:
- Access to the Kubernetes or host environment where Zitadel, the reverse proxy and the database run, with rights to change Collector and Zitadel settings
- Network paths from Zitadel and the proxy to the OpenTelemetry Collector and from the Collector to the trace backend
- Retention and sampling decisions, including how long traces are stored and who may query them
- A personal data review, because span attributes can carry identifiers such as user, organization or request details
- Named owners for the trace backend and the Collector after go-live
Can our internal platform team set up Zitadel tracing without outside help?
Yes, a capable platform team can do it, provided it has someone who knows Zitadel's self-hosting configuration, the Collector's receivers, processors and exporters, and the chosen backend. The harder parts are usually sampling choices, securing the tracing endpoint, and wiring traces across the proxy, Zitadel and the database so that one slow login is visible end to end. Compare the internal effort with a written scope, and decide who will own the pipeline after the first trace appears. A partner can build and hand over, or stay on as a retainer for upgrades and changes.
Does tracing replace Zitadel metrics and logs?
No. Traces show the path of a single request, such as one slow login moving through the proxy, Zitadel and the database, and where time was spent. Metrics show trends and drive alerts across many requests, and logs record events and error details. OpenTelemetry is not an observability backend, so you still choose storage and visualization tools for each signal. Plan all three together, and link them through shared request identifiers where your setup allows.
Which sampling rate should we use for Zitadel traces?
There is no universal rate. Sampling decides how many traces are kept, which affects storage cost and how often you catch rare slow logins. Head sampling is simpler but may drop the rare failures you need, while tail-based approaches keep more of them at the cost of extra Collector resources. Test the chosen setting in a non-production environment with realistic login traffic, then confirm it with your security and retention owners before production. Note that trace data can include request details, so sampling and attribute filtering should be reviewed together.
Should we expose the Collector endpoint to the internet or keep it internal?
Keep it internal. Collector receivers should accept traces only from your cluster or network segment. The OpenTelemetry configuration guidance covers securing the Collector, and authenticator extensions can check incoming connections, for example with OIDC. Confirm the exact settings for your Collector version and Zitadel release against the official documentation, and include an authentication and network review in the written scope.
How DeployOpen scopes and delivers Zitadel tracing
DeployOpen approaches Zitadel tracing as a scoped piece of work inside your own infrastructure, starting from the backend you already run and the login paths your teams need to diagnose. We agree the collector topology, sampling policy and verification steps in writing before any configuration changes are made. Ongoing support is available as a retainer once the pipeline is live.
How we scope
- Confirm which Zitadel deployment method and version you run, and where the Collector will sit in your environment
- Agree the tracing backend, such as Jaeger or Grafana Tempo, and who will operate it
- Define the slow-login scenarios to trace across proxy, Zitadel and PostgreSQL, and the sampling policy for each
- Record the scope, deliverables and timeline in a written, fixed-scope agreement before work starts
How we build
- Configure the Zitadel tracing endpoint and an OpenTelemetry Collector pipeline inside your cloud accounts or data centers
- Set sampling so that error and slow requests are kept without overloading storage or the backend
- Propagate trace context through your reverse proxy and confirm spans link across proxy, Zitadel and database calls
- Test the pipeline with real login flows in a staging environment before any production change
How we hand over
- Document the Collector configuration, sampling decisions, and the steps to reproduce a traced login
- Deliver a runbook covering collector upgrades, configuration changes and what to check when traces stop arriving
- Walk your platform and security teams through the traces so they can investigate slow logins without us
- Provide a retest of the pipeline after handover to confirm the agreed scope works as documented
How we support
- Offer ongoing support and upgrades for the Collector and tracing pipeline as a retainer
- Review sampling and retention settings when your login volume or Zitadel version changes
- Check Collector authentication and exporter credentials against your current security policy during each review
- Agree response expectations and scope for support changes in writing before the retainer starts

