<@U037QFX3D8Q> please include a version ID for Hyd...
# talk-hydra
s
@refined-room-36507 please include a version ID for Hydra in the future. Assuming you are on the latest release (see github.com/ory/hydra) you should follow https://www.ory.sh/docs/hydra/self-hosted/tracing
r
Oh sorry, currently on 1.11
s
thats the link to the go client
r
We have tracing working just fine. What we need to do is inject the trace ID in our delegate service into the requests to Hydra, so that we can trace requests all the way through
s
what are you using for tracing ? • Tracing backend(s): Jaeger, Elastic APM, Datadog, Zipkin and Instana - Note: adding support for other opentracing compliant backends is planned. To aid in priority, please create an issue with your feature request.
r
The version of Hydra isn't really relevant here, though; we need to put the trace ID into requests sent to Hydra.
Datadog
s
we changed some tracing infrastructure in the 2.0 release
r
Presumably adding headers to the requests is the same, but I see no way to add headers via the Go client aside from a static header for all requests.
s
can you post a copy of the http request?
I am looking into to it
r
What HTTP request? Here's how we call accept login:
Copy code
acceptLoginRequest := *hydraclient.NewAcceptLoginRequest(subject)
s
since its not part of the loginrequest , I was thinking about something like this, where you can add perhaps something from the session. We would have to look into the modifications https://www.ory.sh/docs/hydra/reference/api#tag/oAuth2/operation/getOAuth2LoginRequest
r
Not just login request, any API call. We want to include the trace ID so that we can trace requests across all services
Normally that means putting headers in the request. The Hydra Go client does not make the request accessible AFAICS
s
thats why I am thinking about a way to take the session id and add your information into a new item. Putting headers for tracing into any request is something we can also look into. Would you please create an issue for that change?
r
Sure, GitHub?
s
I still think you should consider alternatives as I mentioned above
r
Passing IDs in headers is fundamentally how HTTP tracing works AFAIK. That's why the open tracing library provides an Inject() method that does it for you.
s
We can look into your issue tomorrow. I assume you already saw this too: The CLI will provide you with the list of Hydra tracing configurations and their supported values. Simply run:
Copy code
docker exec -it hydra_hydra_1 hydra serve --help
And read the section on
DEBUG CONTROLS
.
r
Copy code
docker run --rm -it oryd/hydra:v1 serve --help  
Ory Hydra exposes two ports, a public and an administrative port. The public port is responsible
for handling requests from the public internet, such as the OAuth 2.0 Authorize and Token URLs. The administrative
port handles administrative requests like creating OAuth 2.0 Clients, managing JSON Web Keys, and managing User Login
and Consent sessions.

It is recommended to run "hydra serve all". If you need granular control over CORS settings or similar, you may
want to run "hydra serve admin" and "hydra serve public" separately.

To learn more about each individual command, run:

- hydra help serve all
- hydra help serve admin
- hydra help serve public

All sub-commands share command line flags and configuration options.

## Configuration

Ory Hydra can be configured using environment variables as well as a configuration file. For more information
on configuration options, open the configuration documentation:

>> <https://www.ory.sh/hydra/docs/reference/configuration> <<

Usage:
  hydra serve [command]

Available Commands:
  admin       Serves Administrative HTTP/2 APIs
  all         Serves both public and administrative HTTP/2 APIs
  public      Serves Public HTTP/2 APIs

Flags:
  -c, --config strings                                   Path to one or more .json, .yaml, .yml, .toml config files. Values are loaded in the order provided, meaning that the last config file overwrites values from the previous config file.
      --dangerous-allow-insecure-redirect-urls strings   DO NOT USE THIS IN PRODUCTION - Disable HTTPS enforcement for the provided redirect URLs
      --dangerous-force-http                             DO NOT USE THIS IN PRODUCTION - Disables HTTP/2 over TLS (HTTPS) and serves HTTP instead
  -h, --help                                             help for serve
      --sqa-opt-out                                      Disable anonymized telemetry reports - for more information please visit <https://www.ory.sh/docs/ecosystem/sqa>

Use "hydra serve [command] --help" for more information about a command.
I don't see anything about tracing or debug controls there :-(
But FWIW we have tracing configured and working fine, consumed by Datadog.
s
@refined-room-36507 Thats good its working. Regarding the header, We will look on the github issue tomorrow. I’m sorry we cant do much more today here in Slack.
Thank you for using Ory. It sounds like you are enjoying what works for you.
r
oh, no problem, just wanted to be sure I was understood. Will find TUITs to open an issue