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

Commit 124a8ee

Browse files
committed
chore: fix lint
1 parent a7f1619 commit 124a8ee

File tree

5 files changed

+35
-32
lines changed

5 files changed

+35
-32
lines changed

src/api/trace.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import { ProxyTracerProvider } from '../trace/ProxyTracerProvider';
1818
import { Tracer } from '../trace/tracer';
1919
import { TracerProvider } from '../trace/tracer_provider';
2020
import { isSpanContextValid } from '../trace/spancontext-utils';
21-
import { getSpan, getSpanContext, setSpan, setSpanContext } from '../trace/context-utils'
21+
import {
22+
getSpan,
23+
getSpanContext,
24+
setSpan,
25+
setSpanContext,
26+
} from '../trace/context-utils';
2227
import {
2328
getGlobal,
2429
registerGlobal,

src/baggage/index.ts

+17-18
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ import { BaggageEntry, BaggageEntryMetadata } from './Entry';
1919
import { BaggageImpl } from './internal/baggage';
2020
import { baggageEntryMetadataSymbol } from './internal/symbol';
2121
import { Context } from '../context/types';
22-
import { createContextKey } from '../context/context'
23-
22+
import { createContextKey } from '../context/context';
2423

2524
export * from './Baggage';
2625
export * from './Entry';
2726

2827
/**
2928
* Baggage key
3029
*/
31-
const BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
30+
const BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
3231

3332
/**
3433
* Create a new Baggage with optional entries
@@ -41,21 +40,21 @@ export function createBaggage(
4140
return new BaggageImpl(new Map(Object.entries(entries)));
4241
}
4342

44-
/**
45-
* @param {Context} Context that manage all context values
46-
* @returns {Baggage} Extracted baggage from the context
47-
*/
48-
export function getBaggage(context: Context): Baggage | undefined {
49-
return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;
50-
}
51-
52-
/**
53-
* @param {Context} Context that manage all context values
54-
* @param {Baggage} baggage that will be set in the actual context
55-
*/
56-
export function setBaggage(context: Context, baggage: Baggage): Context {
57-
return context.setValue(BAGGAGE_KEY, baggage);
58-
}
43+
/**
44+
* @param {Context} Context that manage all context values
45+
* @returns {Baggage} Extracted baggage from the context
46+
*/
47+
export function getBaggage(context: Context): Baggage | undefined {
48+
return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;
49+
}
50+
51+
/**
52+
* @param {Context} Context that manage all context values
53+
* @param {Baggage} baggage that will be set in the actual context
54+
*/
55+
export function setBaggage(context: Context, baggage: Baggage): Context {
56+
return context.setValue(BAGGAGE_KEY, baggage);
57+
}
5958

6059
/**
6160
* Create a serializable BaggageEntryMetadata object from a string.

src/context/context.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import { Context } from './types';
1818

19-
2019
/** Get a key to uniquely identify a context value */
2120
export function createContextKey(description: string) {
2221
return Symbol.for(description);

src/trace/context-utils.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { createContextKey } from '../context/context'
18-
import { Context } from '../context/types'
19-
import { Span } from './span'
20-
import { SpanContext } from './span_context'
21-
import { NoopSpan } from './NoopSpan'
17+
import { createContextKey } from '../context/context';
18+
import { Context } from '../context/types';
19+
import { Span } from './span';
20+
import { SpanContext } from './span_context';
21+
import { NoopSpan } from './NoopSpan';
2222

2323
/**
2424
* span key
2525
*/
26-
const SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');
26+
const SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');
2727

28-
/**
28+
/**
2929
* Shared key for indicating if instrumentation should be suppressed beyond
3030
* this current scope.
3131
*/
@@ -38,7 +38,7 @@ const SUPPRESS_INSTRUMENTATION_KEY = createContextKey(
3838
*
3939
* @param context context to get span from
4040
*/
41-
export function getSpan(context: Context): Span | undefined {
41+
export function getSpan(context: Context): Span | undefined {
4242
return (context.getValue(SPAN_KEY) as Span) || undefined;
4343
}
4444

@@ -59,7 +59,7 @@ export function setSpan(context: Context, span: Span): Context {
5959
* @param context context to set active span on
6060
* @param spanContext span context to be wrapped
6161
*/
62-
export function setSpanContext(
62+
export function setSpanContext(
6363
context: Context,
6464
spanContext: SpanContext
6565
): Context {
@@ -81,7 +81,7 @@ export function getSpanContext(context: Context): SpanContext | undefined {
8181
*
8282
* @param context context to set the suppress instrumentation value on.
8383
*/
84-
export function suppressInstrumentation(context: Context): Context {
84+
export function suppressInstrumentation(context: Context): Context {
8585
return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true);
8686
}
8787

@@ -103,4 +103,4 @@ export function unsuppressInstrumentation(context: Context): Context {
103103
*/
104104
export function isInstrumentationSuppressed(context: Context): boolean {
105105
return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY));
106-
}
106+
}

test/trace/context-utils.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
suppressInstrumentation,
2121
unsuppressInstrumentation,
2222
} from '../../src/trace/context-utils';
23-
import { createContextKey, ROOT_CONTEXT} from '../../src/context/context'
23+
import { createContextKey, ROOT_CONTEXT } from '../../src/context/context';
2424

2525
const SUPPRESS_INSTRUMENTATION_KEY = createContextKey(
2626
'OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION'

0 commit comments

Comments
 (0)