ref(node-core)!: Remove span exporter setup from otlpIntegration#20297
Draft
andreiborza wants to merge 2 commits intodevelopfrom
Draft
ref(node-core)!: Remove span exporter setup from otlpIntegration#20297andreiborza wants to merge 2 commits intodevelopfrom
andreiborza wants to merge 2 commits intodevelopfrom
Conversation
This PR refactors the `otlpIntegration` and removes the underlying span exporter
that was set up previously.
Users of the otlpIntegration have to configure their own OpenTelemetry span
exporter, pointing it to Sentry's OTLP endpoint:
```
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { BatchSpanProcessor, NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import * as Sentry from '@sentry/node-core/light';
import { otlpIntegration } from '@sentry/node-core/light/otlp';
const provider = new NodeTracerProvider({
spanProcessors: [
new BatchSpanProcessor(
new OTLPTraceExporter({
url: '__SENTRY_TRACES_ENDPOINT__',
headers: { 'X-Sentry-Auth': 'Sentry sentry_key=__YOUR_KEY__' },
}),
),
],
});
provider.register();
Sentry.init({
dsn: '__DSN__',
integrations: [otlpIntegration()],
});
Member
|
Could we provide a helper to get the correct endpoint via dsn somehow? |
Member
Author
Yes, I quite like that idea, will amend. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the
otlpIntegrationand removes the underlying span exporter that was set up previously.Users of the otlpIntegration have to configure their own OpenTelemetry span exporter, pointing it to Sentry's OTLP endpoint.