Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
chore: remove suppress instrumentation (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan authored May 14, 2021
1 parent 26ae4c4 commit 0a3bee4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 118 deletions.
38 changes: 0 additions & 38 deletions src/trace/context-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ import { NonRecordingSpan } from './NonRecordingSpan';
*/
const SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');

/**
* Shared key for indicating if instrumentation should be suppressed beyond
* this current scope.
*/
const SUPPRESS_INSTRUMENTATION_KEY = createContextKey(
'OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION'
);

/**
* Return the span if one exists
*
Expand Down Expand Up @@ -74,33 +66,3 @@ export function setSpanContext(
export function getSpanContext(context: Context): SpanContext | undefined {
return getSpan(context)?.spanContext();
}

/**
* Sets value on context to indicate that instrumentation should
* be suppressed beyond this current scope.
*
* @param context context to set the suppress instrumentation value on.
*/
export function suppressInstrumentation(context: Context): Context {
return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true);
}

/**
* Sets value on context to indicate that instrumentation should
* no-longer be suppressed beyond this current scope.
*
* @param context context to set the suppress instrumentation value on.
*/
export function unsuppressInstrumentation(context: Context): Context {
return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, false);
}

/**
* Return current suppress instrumentation value for the given context,
* if it exists.
*
* @param context context check for the suppress instrumentation value.
*/
export function isInstrumentationSuppressed(context: Context): boolean {
return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY));
}
80 changes: 0 additions & 80 deletions test/trace/context-utils.test.ts

This file was deleted.

0 comments on commit 0a3bee4

Please sign in to comment.