@inference-net/otel-cf-workers 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { OTLPExporterError } from '@opentelemetry/otlp-exporter-base';
11
11
  import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
12
12
  import { Resource } from '@opentelemetry/resources';
13
13
  import { Sampler } from '@opentelemetry/sdk-trace-base';
14
- import { Span } from '@opentelemetry/api';
14
+ import { Span as Span_2 } from '@opentelemetry/api';
15
15
  import { SpanContext } from '@opentelemetry/api';
16
16
  import { SpanExporter } from '@opentelemetry/sdk-trace-base';
17
17
  import { SpanKind } from '@opentelemetry/api';
@@ -56,7 +56,7 @@ export declare class BatchTraceSpanProcessor implements TraceFlushableSpanProces
56
56
  private traces;
57
57
  constructor(exporter: SpanExporter);
58
58
  getTraceState(traceId: string): TraceState;
59
- onStart(span: Span, _parentContext: Context): void;
59
+ onStart(span: Span_2, _parentContext: Context): void;
60
60
  onEnd(span: ReadableSpan): void;
61
61
  forceFlush(traceId?: traceId): Promise<void>;
62
62
  shutdown(): Promise<void>;
@@ -142,8 +142,8 @@ export declare interface HandlerInstrumentation<T extends Trigger, R extends any
142
142
  getInitialSpanInfo: (trigger: T) => InitialSpanInfo;
143
143
  getAttributesFromResult?: (result: Awaited<R>) => Attributes;
144
144
  instrumentTrigger?: (trigger: T) => T;
145
- executionSucces?: (span: Span, trigger: T, result: Awaited<R>) => void;
146
- executionFailed?: (span: Span, trigger: T, error?: any) => void;
145
+ executionSucces?: (span: Span_2, trigger: T, result: Awaited<R>) => void;
146
+ executionFailed?: (span: Span_2, trigger: T, error?: any) => void;
147
147
  }
148
148
 
149
149
  declare type HeadSamplerConf = Sampler | ParentRatioSamplingConfig;
@@ -327,7 +327,7 @@ export declare class MultiTransportLogRecordProcessor implements LogRecordProces
327
327
  shutdown(): Promise<void>;
328
328
  }
329
329
 
330
- declare type OnSpanEnd = (span: Span) => void;
330
+ declare type OnSpanEnd = (span: Span_2) => void;
331
331
 
332
332
  export declare type OrPromise<T extends any> = T | Promise<T>;
333
333
 
@@ -453,7 +453,7 @@ export declare const SEVERITY_NUMBERS: {
453
453
 
454
454
  export declare type SeverityNumber = (typeof SEVERITY_NUMBERS)[keyof typeof SEVERITY_NUMBERS];
455
455
 
456
- export declare class SpanImpl implements Span, ReadableSpan {
456
+ export declare class SpanImpl implements Span_2, ReadableSpan {
457
457
  name: string;
458
458
  private readonly _spanContext;
459
459
  private readonly onEnd;
@@ -546,7 +546,7 @@ declare class TraceState {
546
546
  private localRootSpan?;
547
547
  private traceDecision?;
548
548
  constructor(exporter: SpanExporter);
549
- addSpan(span: Span): void;
549
+ addSpan(span: Span_2): void;
550
550
  endSpan(span: ReadableSpan): void;
551
551
  sample(): void;
552
552
  flush(): Promise<void>;
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ function passthroughGet(target, prop, thisArg) {
96
96
  }
97
97
  }
98
98
 
99
- const PACKAGE_VERSION = "2.4.0";
99
+ const PACKAGE_VERSION = "2.5.0";
100
100
  const PACKAGE_NAME = "@inference-net/otel-cf-workers";
101
101
  const ATTR_CLOUDFLARE_COLO = "cloudflare.colo";
102
102
  const ATTR_CLOUDFLARE_RAY_ID = "cloudflare.ray_id";
@@ -298,7 +298,7 @@ class OTLPExporter {
298
298
  } else {
299
299
  onError(new OTLPExporterError(`Exporter received a statusCode: ${response.status}`));
300
300
  }
301
- await response.body?.cancel();
301
+ response.body?.cancel();
302
302
  }).catch((error) => {
303
303
  onError(new OTLPExporterError(`Exception during export: ${error.toString()}`, error.code, error.stack));
304
304
  });
@@ -3525,7 +3525,6 @@ function findVersionMeta() {
3525
3525
  });
3526
3526
  }
3527
3527
  const createResource = (serviceConfig, versionMeta) => {
3528
- console.log({ versionMeta });
3529
3528
  const workerResourceAttrs = {
3530
3529
  "cloud.provider": "cloudflare",
3531
3530
  "cloud.platform": "cloudflare.workers",