Skip to content
Merged
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
3 changes: 3 additions & 0 deletions packages/node-experimental/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createContextKey } from '@opentelemetry/api';

export const OTEL_CONTEXT_HUB_KEY = createContextKey('sentry_hub');
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { Context } from '@opentelemetry/api';
import * as api from '@opentelemetry/api';
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
import type { Carrier, Hub } from '@sentry/core';

import { ensureHubOnCarrier, getCurrentHub, getHubFromCarrier } from './hub';

export const OTEL_CONTEXT_HUB_KEY = api.createContextKey('sentry_hub');
import { OTEL_CONTEXT_HUB_KEY } from '../constants';
import { ensureHubOnCarrier, getCurrentHub, getHubFromCarrier } from './../sdk/hub';

function createNewHub(parent: Hub | undefined): Hub {
const carrier: Carrier = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/node-experimental/src/sdk/initOtel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SentryPropagator, SentrySpanProcessor } from '@sentry/opentelemetry-nod
import { logger } from '@sentry/utils';

import type { NodeExperimentalClient } from '../types';
import { SentryContextManager } from './otelContextManager';
import { SentryContextManager } from './../opentelemetry/contextManager';

/**
* Initialize OpenTelemetry for Node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as api from '@opentelemetry/api';
import type { Hub, RunWithAsyncContextOptions } from '@sentry/core';
import { setAsyncContextStrategy } from '@sentry/core';

import { OTEL_CONTEXT_HUB_KEY } from './otelContextManager';
import { OTEL_CONTEXT_HUB_KEY } from '../constants';

/**
* Sets the async context strategy to use follow the OTEL context under the hood.
Expand Down