8000 ref(node-experimental): Reorder files into `opentelemetry` folder by mydea · Pull Request #9084 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

ref(node-experimental): Reorder files into opentelemetry folder #9084

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

Merged
merged 1 commit into from
Sep 22, 2023
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, getCurrent 10417 Hub, 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
0