Skip to content

Commit 580dafd

Browse files
committed
chore: move internal types to extra file
Signed-off-by: Lukas Reining <[email protected]>11 Signed-off-by: Lukas Reining <[email protected]>
1 parent 24dd078 commit 580dafd

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

libs/hooks/open-telemetry/src/lib/traces/tracing-hook.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NodeTracerProvider, SimpleSpanProcessor, InMemorySpanExporter } from '@
44
import { logs } from '@opentelemetry/api-logs';
55
import { LoggerProvider, SimpleLogRecordProcessor, InMemoryLogRecordExporter } from '@opentelemetry/sdk-logs';
66
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
7-
import type { SpanAttributesTracingHookData } from './tracing-hooks';
7+
import type { SpanAttributesTracingHookData } from './tracing-hooks-internal';
88
import { EventHook } from './tracing-hooks';
99
import { SpanEventHook, SpanHook } from './tracing-hooks';
1010
import type { BaseHook, EvaluationDetails, FlagValue, HookContext } from '@openfeature/core';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import type { Span } from '@opentelemetry/api';
2+
3+
export const HookContextSpanKey = Symbol('evaluation_span');
4+
export type SpanAttributesTracingHookData = { [HookContextSpanKey]: Span };

libs/hooks/open-telemetry/src/lib/traces/tracing-hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
} from '@opentelemetry/semantic-conventions';
1111
import type { OpenTelemetryHookOptions } from '../otel-hook';
1212
import { OpenTelemetryHook } from '../otel-hook';
13+
import type { SpanAttributesTracingHookData } from './tracing-hooks-internal';
14+
import { HookContextSpanKey } from './tracing-hooks-internal';
1315

1416
const LIBRARY_NAME = '@openfeature/open-telemetry-hooks';
1517
const LIBRARY_VERSION = '0.4.0'; //x-release-please-version
@@ -103,8 +105,6 @@ export class SpanEventHook extends OpenTelemetryHook implements BaseHook {
103105
}
104106

105107
const tracer = trace.getTracer(LIBRARY_NAME, LIBRARY_VERSION);
106-
const HookContextSpanKey = Symbol('evaluation_span');
107-
export type SpanAttributesTracingHookData = { [HookContextSpanKey]: Span };
108108

109109
/**
110110
* A hook that creates a new span for each flag evaluation and sets the evaluation

0 commit comments

Comments
 (0)