diff --git a/packages/opentelemetry-api/src/metrics/NoopMeter.ts b/packages/opentelemetry-api/src/metrics/NoopMeter.ts index 765a0fd8ae3..f3c8feeddd1 100644 --- a/packages/opentelemetry-api/src/metrics/NoopMeter.ts +++ b/packages/opentelemetry-api/src/metrics/NoopMeter.ts @@ -131,24 +131,21 @@ export class NoopMetric implements UnboundMetric { } } -export class NoopCounterMetric - extends NoopMetric +export class NoopCounterMetric extends NoopMetric implements Counter { add(value: number, labels: Labels) { this.bind(labels).add(value); } } -export class NoopValueRecorderMetric - extends NoopMetric +export class NoopValueRecorderMetric extends NoopMetric implements ValueRecorder { record(value: number, labels: Labels) { this.bind(labels).record(value); } } -export class NoopBaseObserverMetric - extends NoopMetric +export class NoopBaseObserverMetric extends NoopMetric implements BaseObserver { observation() { return { @@ -158,8 +155,7 @@ export class NoopBaseObserverMetric } } -export class NoopBatchObserverMetric - extends NoopMetric +export class NoopBatchObserverMetric extends NoopMetric implements BatchObserver {} export class NoopBoundCounter implements BoundCounter { diff --git a/packages/opentelemetry-core/src/platform/browser/BasePlugin.ts b/packages/opentelemetry-core/src/platform/browser/BasePlugin.ts index bf6e227d8a0..4ace89ab48e 100644 --- a/packages/opentelemetry-core/src/platform/browser/BasePlugin.ts +++ b/packages/opentelemetry-core/src/platform/browser/BasePlugin.ts @@ -23,8 +23,7 @@ import { import { BaseAbstractPlugin } from '../BaseAbstractPlugin'; /** This class represent the base to patch plugin. */ -export abstract class BasePlugin - extends BaseAbstractPlugin +export abstract class BasePlugin extends BaseAbstractPlugin implements Plugin { enable( moduleExports: T, diff --git a/packages/opentelemetry-core/src/platform/node/BasePlugin.ts b/packages/opentelemetry-core/src/platform/node/BasePlugin.ts index 3581cee96ac..d1ebc622cf4 100644 --- a/packages/opentelemetry-core/src/platform/node/BasePlugin.ts +++ b/packages/opentelemetry-core/src/platform/node/BasePlugin.ts @@ -27,8 +27,7 @@ import * as path from 'path'; import { BaseAbstractPlugin } from '../BaseAbstractPlugin'; /** This class represent the base to patch plugin. */ -export abstract class BasePlugin - extends BaseAbstractPlugin +export abstract class BasePlugin extends BaseAbstractPlugin implements Plugin { enable( moduleExports: T, diff --git a/packages/opentelemetry-metrics/src/BaseObserverMetric.ts b/packages/opentelemetry-metrics/src/BaseObserverMetric.ts index fcb3ec52cb5..733d701ce3e 100644 --- a/packages/opentelemetry-metrics/src/BaseObserverMetric.ts +++ b/packages/opentelemetry-metrics/src/BaseObserverMetric.ts @@ -28,8 +28,7 @@ const NOOP_CALLBACK = () => {}; * This is a SDK implementation of Base Observer Metric. * All observers should extend this class */ -export abstract class BaseObserverMetric - extends Metric +export abstract class BaseObserverMetric extends Metric implements api.BaseObserver { protected _callback: (observerResult: api.ObserverResult) => unknown; diff --git a/packages/opentelemetry-metrics/src/BatchObserverMetric.ts b/packages/opentelemetry-metrics/src/BatchObserverMetric.ts index 241ff0813a0..fe6d5ffe3d3 100644 --- a/packages/opentelemetry-metrics/src/BatchObserverMetric.ts +++ b/packages/opentelemetry-metrics/src/BatchObserverMetric.ts @@ -27,8 +27,7 @@ const NOOP_CALLBACK = () => {}; const MAX_TIMEOUT_UPDATE_MS = 500; /** This is a SDK implementation of Batch Observer Metric. */ -export class BatchObserverMetric - extends Metric +export class BatchObserverMetric extends Metric implements api.BatchObserver { private _callback: (observerResult: api.BatchObserverResult) => void; private _maxTimeoutUpdateMS: number; diff --git a/packages/opentelemetry-metrics/src/BoundInstrument.ts b/packages/opentelemetry-metrics/src/BoundInstrument.ts index e84bb724876..a70528e43c6 100644 --- a/packages/opentelemetry-metrics/src/BoundInstrument.ts +++ b/packages/opentelemetry-metrics/src/BoundInstrument.ts @@ -72,8 +72,7 @@ export class BaseBoundInstrument { * BoundCounter allows the SDK to observe/record a single metric event. The * value of single instrument in the `Counter` associated with specified Labels. */ -export class BoundCounter - extends BaseBoundInstrument +export class BoundCounter extends BaseBoundInstrument implements api.BoundCounter { constructor( labels: api.Labels, @@ -102,8 +101,7 @@ export class BoundCounter * The value of single instrument in the `UpDownCounter` associated with * specified Labels. */ -export class BoundUpDownCounter - extends BaseBoundInstrument +export class BoundUpDownCounter extends BaseBoundInstrument implements api.BoundCounter { constructor( labels: api.Labels, @@ -123,8 +121,7 @@ export class BoundUpDownCounter /** * BoundMeasure is an implementation of the {@link BoundMeasure} interface. */ -export class BoundValueRecorder - extends BaseBoundInstrument +export class BoundValueRecorder extends BaseBoundInstrument implements api.BoundValueRecorder { constructor( labels: api.Labels, @@ -144,8 +141,7 @@ export class BoundValueRecorder /** * BoundObserver is an implementation of the {@link BoundObserver} interface. */ -export class BoundObserver - extends BaseBoundInstrument +export class BoundObserver extends BaseBoundInstrument implements api.BoundBaseObserver { constructor( labels: api.Labels, diff --git a/packages/opentelemetry-metrics/src/SumObserverMetric.ts b/packages/opentelemetry-metrics/src/SumObserverMetric.ts index 99f9b0d3c6a..892ca934664 100644 --- a/packages/opentelemetry-metrics/src/SumObserverMetric.ts +++ b/packages/opentelemetry-metrics/src/SumObserverMetric.ts @@ -24,8 +24,7 @@ import { Batcher } from './export/Batcher'; import { MetricKind } from './export/types'; /** This is a SDK implementation of SumObserver Metric. */ -export class SumObserverMetric - extends BaseObserverMetric +export class SumObserverMetric extends BaseObserverMetric implements api.SumObserver { constructor( name: string, diff --git a/packages/opentelemetry-metrics/src/UpDownCounterMetric.ts b/packages/opentelemetry-metrics/src/UpDownCounterMetric.ts index 19a8d8a0dd3..14eb1dc6f37 100644 --- a/packages/opentelemetry-metrics/src/UpDownCounterMetric.ts +++ b/packages/opentelemetry-metrics/src/UpDownCounterMetric.ts @@ -23,8 +23,7 @@ import { Batcher } from './export/Batcher'; import { Metric } from './Metric'; /** This is a SDK implementation of UpDownCounter Metric. */ -export class UpDownCounterMetric - extends Metric +export class UpDownCounterMetric extends Metric implements api.UpDownCounter { constructor( name: string, diff --git a/packages/opentelemetry-metrics/src/UpDownSumObserverMetric.ts b/packages/opentelemetry-metrics/src/UpDownSumObserverMetric.ts index 8bb0440487f..c96b34d7fcd 100644 --- a/packages/opentelemetry-metrics/src/UpDownSumObserverMetric.ts +++ b/packages/opentelemetry-metrics/src/UpDownSumObserverMetric.ts @@ -22,8 +22,7 @@ import { Batcher } from './export/Batcher'; import { MetricKind } from './export/types'; /** This is a SDK implementation of UpDownSumObserver Metric. */ -export class UpDownSumObserverMetric - extends BaseObserverMetric +export class UpDownSumObserverMetric extends BaseObserverMetric implements api.UpDownSumObserver { constructor( name: string, diff --git a/packages/opentelemetry-metrics/src/ValueObserverMetric.ts b/packages/opentelemetry-metrics/src/ValueObserverMetric.ts index 8c2547600d9..e71227db43e 100644 --- a/packages/opentelemetry-metrics/src/ValueObserverMetric.ts +++ b/packages/opentelemetry-metrics/src/ValueObserverMetric.ts @@ -21,8 +21,7 @@ import { Batcher } from './export/Batcher'; import { MetricKind } from './export/types'; /** This is a SDK implementation of Value Observer Metric. */ -export class ValueObserverMetric - extends BaseObserverMetric +export class ValueObserverMetric extends BaseObserverMetric implements api.ValueObserver { constructor( name: string, diff --git a/packages/opentelemetry-metrics/src/ValueRecorderMetric.ts b/packages/opentelemetry-metrics/src/ValueRecorderMetric.ts index 82757641056..fa50f9b3a63 100644 --- a/packages/opentelemetry-metrics/src/ValueRecorderMetric.ts +++ b/packages/opentelemetry-metrics/src/ValueRecorderMetric.ts @@ -23,8 +23,7 @@ import { MetricKind } from './export/types'; import { Metric } from './Metric'; /** This is a SDK implementation of Value Recorder Metric. */ -export class ValueRecorderMetric - extends Metric +export class ValueRecorderMetric extends Metric implements api.ValueRecorder { constructor( name: string, diff --git a/packages/opentelemetry-plugin-http/src/http.ts b/packages/opentelemetry-plugin-http/src/http.ts index f27c9b1c464..c050af607d4 100644 --- a/packages/opentelemetry-plugin-http/src/http.ts +++ b/packages/opentelemetry-plugin-http/src/http.ts @@ -25,10 +25,7 @@ import { TraceFlags, getExtractedSpanContext, } from '@opentelemetry/api'; -import { - BasePlugin, - NoRecordingSpan, -} from '@opentelemetry/core'; +import { BasePlugin, NoRecordingSpan } from '@opentelemetry/core'; import { ClientRequest, IncomingMessage, diff --git a/packages/opentelemetry-shim-opentracing/src/shim.ts b/packages/opentelemetry-shim-opentracing/src/shim.ts index 839e7d0ade4..e5fd4dcbfea 100644 --- a/packages/opentelemetry-shim-opentracing/src/shim.ts +++ b/packages/opentelemetry-shim-opentracing/src/shim.ts @@ -177,7 +177,10 @@ export class TracerShim extends opentracing.Tracer { carrier, api.defaultSetter, setCorrelationContext( - api.setExtractedSpanContext(api.Context.ROOT_CONTEXT, oTelSpanContext), + api.setExtractedSpanContext( + api.Context.ROOT_CONTEXT, + oTelSpanContext + ), oTelSpanCorrelationContext ) ); diff --git a/packages/opentelemetry-tracing/src/Tracer.ts b/packages/opentelemetry-tracing/src/Tracer.ts index a52d513a9b4..c670e17d941 100644 --- a/packages/opentelemetry-tracing/src/Tracer.ts +++ b/packages/opentelemetry-tracing/src/Tracer.ts @@ -148,7 +148,9 @@ export class Tracer implements api.Tracer { bind(target: T, span?: api.Span): T { return api.context.bind( target, - span ? api.setActiveSpan(api.context.active(), span) : api.context.active() + span + ? api.setActiveSpan(api.context.active(), span) + : api.context.active() ); } diff --git a/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts b/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts index e3ae904d014..ba151c4c542 100644 --- a/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts +++ b/packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts @@ -15,10 +15,7 @@ */ import { context, suppressInstrumentation } from '@opentelemetry/api'; -import { - ExportResult, - unrefTimer, -} from '@opentelemetry/core'; +import { ExportResult, unrefTimer } from '@opentelemetry/core'; import { SpanProcessor } from '../SpanProcessor'; import { BufferConfig } from '../types'; import { ReadableSpan } from './ReadableSpan';