Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(node-otel): Avoid exporting internals & refactor attribute adding #8920

Merged
merged 1 commit into from Sep 1, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Aug 31, 2023

I noticed that we kind of extended the public API by exporting some things from opentelemetry-node that we need in node-experimental. I am deprecating these internals as I'm refactoring some things to be a bit cleaner IMHO.

The one export we actually need outside I am exporting as _INTERNAL_getSentrySpan to make it clear this is not meant to be used otherwise. The main reason I am not just exporting this is that this may have to change if we change how we internally store/handle spans - e.g. if we move away from the map this is just not possible to have anymore, and I do not want to lock us into having to support this in the future.

@mydea mydea requested a review from AbhiPrasad August 31, 2023 07:22
@mydea mydea self-assigned this Aug 31, 2023
addOtelSpanData(span.spanContext().spanId, {
origin: 'auto.graphql.otel-graphql',
});
addOriginToOtelSpan(span, 'auto.graphql.otel.graphql');
Copy link
Member Author

Choose a reason for hiding this comment

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

also noticed some of these have still been incorrectly using - notation, which does not work.

SentrySpan['spanId'],
SentrySpan
>();
export const SENTRY_SPAN_PROCESSOR_MAP: Map<string, SentrySpan> = new Map<string, SentrySpan>();
Copy link
Member Author

Choose a reason for hiding this comment

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

Actually the type SentrySpan['spanId'] is not really correct/helpful here, as we are mapping an otel span ID to a sentry Span 🤔

@mydea mydea merged commit 9666506 into develop Sep 1, 2023
40 checks passed
@mydea mydea deleted the fn/node-otel-exports branch September 1, 2023 07:49
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.

None yet

3 participants