Skip to content

fix: restore OTEL trace propagation in remote and remote_json authorizers#1259

Closed
rdark wants to merge 2 commits intoory:masterfrom
rdark:fix/restore-trace-propagation-in-remote-authorizers
Closed

fix: restore OTEL trace propagation in remote and remote_json authorizers#1259
rdark wants to merge 2 commits intoory:masterfrom
rdark:fix/restore-trace-propagation-in-remote-authorizers

Conversation

@rdark
Copy link

@rdark rdark commented Feb 26, 2026

The httpx.ResilientClientWithTracer option was removed from ory/x during the monorepo migration, but the remote and remote_json authorizers were not updated to compensate. Their HTTP clients now use a plain transport with no trace context propagation, breaking distributed tracing to downstream services.

Restore propagation by wrapping the client transport with otelhttp.NewTransport after construction. This uses the global OTEL TracerProvider (already registered by otelx.SetupOTLP via otel.SetTracerProvider), consistent with how authenticator_cookie_session.go handles the same requirement.

The fix applies to both the initial client in the constructor and the retry client rebuilt in Config() when timeout/max-wait settings are present.

NOTE: Two stale entries in go.mod pruned by go mod tidy

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.com) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

…zers

The httpx.ResilientClientWithTracer option was removed from ory/x during the
monorepo migration, but the remote and remote_json authorizers were not updated
to compensate. Their HTTP clients now use a plain transport with no trace context
propagation, breaking distributed tracing to downstream services.

Restore propagation by wrapping the client transport with otelhttp.NewTransport
after construction. This uses the global OTEL TracerProvider (already registered
by otelx.SetupOTLP via otel.SetTracerProvider), consistent with how
authenticator_cookie_session.go handles the same requirement.

The fix applies to both the initial client in the constructor and the retry
client rebuilt in Config() when timeout/max-wait settings are present.

NOTE: Two stale entries in go.mod pruned by go mod tidy
@rdark rdark requested review from a team and aeneasr as code owners February 26, 2026 12:59
The docs-cli job was missing the ory/ci/checkout@master step before
actions/setup-go, causing "go version file at: go.mod does not exist"
failures because the repository was never checked out into the workspace.
Copy link

@fifitrixabelle fifitrixabelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gross

@rdark
Copy link
Author

rdark commented Feb 28, 2026

@aeneasr thanks for approval - this PR is blocked by a CI issue that should be fixed in ory/meta#245, which is itself blocked by another CI issue (looks like missing secrets config)

@aeneasr
Copy link
Member

aeneasr commented Mar 2, 2026

Thank you! We still have some work to do to get the monorepo set up working 100% for the OSS pipeline, sorry about that. Also @hperl not sure how that commit was dropped, did we forget to import some git hash?

@aeneasr aeneasr closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants