Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions develop-docs/sdk/telemetry/traces/otlp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ Concurrently to the above SDK work, we also shipped first-class support for inge
The new integration MUST be called `OTLPIntegration` with the following signature:

```python
OTLPIntegration(setup_otlp_traces_exporter=True, setup_propagator=True, capture_exceptions=False)
OTLPIntegration(setup_otlp_traces_exporter=True, collector_url=None, setup_propagator=True, capture_exceptions=False)
```


The arguments `setup_otlp_traces_exporter`, `setup_propagator` and `capture_exceptions` MUST be booleans that default to `True`, `True` and `False` respectively and can be turned off if needed by the user.

`collector_url` MUST be an optional string that defaults to `None`.

It MUST consist of and setup the following components:

* A `SpanExporter` that automatically configures the OTLP ingestion endpoint from the DSN
* A `SpanExporter` that automatically configures the OTLP ingestion endpoint from the DSN or from the `collector_url`
* A `Propagator` that ensures Distributed Tracing works with other upstream and downstream services using Sentry SDKs
* Note that we use the `sentry-trace` (NOT `traceparent`) and `baggage` headers here
* An `external_propagation_context` that extracts the active `trace_id` and `span_id` from the OpenTelemetry SDK
Expand All @@ -41,10 +44,12 @@ It MUST consist of and setup the following components:
IF `setup_otlp_traces_exporter` is `True`, the integration MUST do the following:

* Take the existing `TracerProvider` from OpenTelemetry if it exists, otherwise create a new one
* Construct the OTLP Traces `endpoint` from the DSN
* The `endpoint` has the format - `https://o0.ingest.sentry.io/api/{project_id}/integration/otlp/v1/traces/`
* It is RECOMMENDED to centralize API endpoint generation from the DSN if your SDK doesn't already have that
* Add the `X-Sentry-Auth` header to a `headers` dictionary
* Determine the OTLP Traces `endpoint` and `headers`:
* IF `collector_url` is provided, the integration MUST use that URL as the OTLP endpoint instead of constructing one from the DSN. The `X-Sentry-Auth` header MUST NOT be added in this case since authentication is handled by the collector.
* IF `collector_url` is `None`, the integration MUST construct the endpoint from the DSN:
* The `endpoint` has the format - `https://o0.ingest.sentry.io/api/{project_id}/integration/otlp/v1/traces/`
* It is RECOMMENDED to centralize API endpoint generation from the DSN if your SDK doesn't already have that
* Add the `X-Sentry-Auth` header to a `headers` dictionary
* Instantiate a `OTLPSpanExporter` from OpenTelemetry with the `endpoint` and `headers`
* Instantiate a `BatchSpanProcessor` with the above `OTLPSpanExporter`
* Add the `BatchSpanProcessor` to the `TracerProvider`
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/python/integrations/otlp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ You can pass the following keyword arguments to `OTLPIntegration()`:

- `setup_otlp_traces_exporter`:

Automatically configure an Exporter to send OTLP traces to the right project from the DSN, defaults to `True`.
Automatically configure an Exporter to send OTLP traces to the right project from the DSN or `collector_url`, defaults to `True`.

Set to `False` if using a custom collector or to setup the TracerProvider manually.
Set to `False` to setup the TracerProvider manually.

- `collector_url`:

URL of your own OpenTelemetry collector. When set, the exporter will send traces to this URL instead of the Sentry OTLP endpoint derived from the DSN.

- `setup_propagator`:

Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/ruby/common/integrations/otlp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ You can configure the following options on `config.otlp`:

- `setup_otlp_traces_exporter`:

Automatically configure an Exporter to send OTLP traces to the right project from the DSN, defaults to `true`.
Automatically configure an Exporter to send OTLP traces to the right project from the DSN or `collector_url`, defaults to `true`.

Set to `false` if using a custom collector or to set up the TracerProvider manually.
Set to `false` to set up the TracerProvider manually.

- `collector_url`:

URL of your own OpenTelemetry collector. When set, the exporter will send traces to this URL instead of the Sentry OTLP endpoint derived from the DSN.

- `setup_propagator`:

Expand Down
Loading