<@U04UQ68083H> How do I integrate with a Open Tele...
# ory-copilot
l
@chilly-king-10285 How do I integrate with a Open Telemetry exporter ?
b
A message from kapa.ai
To integrate Ory services with an OpenTelemetry exporter, you need to configure the tracing provider to use OpenTelemetry (OTel). Here’s how you can do it based on the available knowledge sources: ### Ory Hydra, Oathkeeper, Keto (General Ory Services) Ory supports OpenTelemetry as a tracing backend. You can configure tracing either in the configuration file or via environment variables. Here’s an example using environment variables for Ory Hydra:
Copy code
bash export TRACING_SERVICE_NAME="hydra" export TRACING_PROVIDER="otel" export TRACING_PROVIDERS_OTLP_INSECURE=true export TRACING_PROVIDERS_OTLP_SAMPLING_SAMPLING_RATIO=0.4 export TRACING_PROVIDERS_OTLP_SERVER_URL="<http://my.otel.collector:4318>" export OTEL_RESOURCE_ATTRIBUTES="service.name=hydra,deployment.environment=pre,service.version=2.1.2"
You will also need to run an OpenTelemetry Collector and configure it to receive traces from Ory and export them to your desired backend (e.g., Datadog, Jaeger, etc.). The collector configuration typically includes receivers, processors, and exporters. For example:
Copy code
yaml receivers:   otlp:     protocols:       http:       grpc:  processors:   batch:  exporters:   datadog:     api:       site: <http://datadoghq.eu|datadoghq.eu>       key: MY_DATADOG_KEY  service:   pipelines:     traces:       receivers: [otlp]       processors: [batch]       exporters: [datadog]
This setup allows Ory to send traces to the OpenTelemetry Collector, which then forwards them to your chosen observability backend. The specific environment variables and configuration options may vary by Ory service, so refer to the service’s documentation for details. Ory will create spans for HTTP requests, database interactions, and other key operations, which you can then visualize in your observability platform of choice [Tracing options](https://www.ory.sh/docs/self-hosted/operations/tracing#tracing-options). ### Ory Kratos As of now, Ory Kratos officially supports Jaeger as a tracing backend. Support for other OpenTelemetry exporters is planned, but not yet available natively. However, you can technically send spans to the OpenTelemetry Collector agent and configure the collector to push spans to your backend of choice. This means you can use Jaeger tracing in Kratos and have the OpenTelemetry Collector forward those traces elsewhere [Kratos tracing guide](https://www.ory.sh/docs/kratos/guides/tracing). --- Summary: - For Ory Hydra, Oathkeeper, and Keto: Set
TRACING_PROVIDER=otel
and configure the OTLP server URL and other options. - For Ory Kratos: Native OpenTelemetry support is not yet available, but you can use Jaeger and forward traces via the OpenTelemetry Collector. If you need more detailed, service-specific configuration, please specify which Ory service you are using.