@glasstrace/sdk 0.2.1 → 0.2.3

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.cts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as z from './v4/classic/external.cjs';
2
- import { Context } from '@opentelemetry/api';
3
- import { SpanProcessor, Span, ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
4
- import { ExportResult } from '@opentelemetry/core';
2
+ import { ReadableSpan } from './export/ReadableSpan';
3
+ import { Span } from './Span';
4
+ import { SpanProcessor } from './SpanProcessor';
5
+ import { SpanExporter } from './export/SpanExporter';
6
+ import { ExportResult } from './ExportResult';
5
7
 
6
8
  /** Anonymous API key: `gt_anon_` + 48 hex chars. */
7
9
  declare const AnonApiKeySchema: z.core.$ZodBranded<z.ZodString, "AnonApiKey", "out">;
@@ -298,7 +300,7 @@ declare function getActiveConfig(): CaptureConfig;
298
300
  declare class GlasstraceSpanProcessor implements SpanProcessor {
299
301
  private readonly wrappedProcessor;
300
302
  constructor(wrappedProcessor: SpanProcessor, _sessionManager?: SessionManager, _apiKey?: string | (() => string), _getConfig?: () => CaptureConfig, _environment?: string);
301
- onStart(span: Span, parentContext: Context): void;
303
+ onStart(span: Span, parentContext: Parameters<SpanProcessor["onStart"]>[1]): void;
302
304
  onEnd(readableSpan: ReadableSpan): void;
303
305
  shutdown(): Promise<void>;
304
306
  forceFlush(): Promise<void>;
@@ -452,6 +454,12 @@ declare function computeBuildHash(maps?: SourceMapEntry[]): Promise<string>;
452
454
  */
453
455
  declare function uploadSourceMaps(apiKey: string, endpoint: string, buildHash: string, maps: SourceMapEntry[]): Promise<SourceMapUploadResponse>;
454
456
 
457
+ /**
458
+ * Manual error capture API.
459
+ *
460
+ * Provides a simple function for developers to manually record errors
461
+ * as span events, independent of the `consoleErrors` config flag.
462
+ */
455
463
  /**
456
464
  * Records an error as a span event on the currently active OTel span.
457
465
  *
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as z from './v4/classic/external.cjs';
2
- import { Context } from '@opentelemetry/api';
3
- import { SpanProcessor, Span, ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
4
- import { ExportResult } from '@opentelemetry/core';
2
+ import { ReadableSpan } from './export/ReadableSpan';
3
+ import { Span } from './Span';
4
+ import { SpanProcessor } from './SpanProcessor';
5
+ import { SpanExporter } from './export/SpanExporter';
6
+ import { ExportResult } from './ExportResult';
5
7
 
6
8
  /** Anonymous API key: `gt_anon_` + 48 hex chars. */
7
9
  declare const AnonApiKeySchema: z.core.$ZodBranded<z.ZodString, "AnonApiKey", "out">;
@@ -298,7 +300,7 @@ declare function getActiveConfig(): CaptureConfig;
298
300
  declare class GlasstraceSpanProcessor implements SpanProcessor {
299
301
  private readonly wrappedProcessor;
300
302
  constructor(wrappedProcessor: SpanProcessor, _sessionManager?: SessionManager, _apiKey?: string | (() => string), _getConfig?: () => CaptureConfig, _environment?: string);
301
- onStart(span: Span, parentContext: Context): void;
303
+ onStart(span: Span, parentContext: Parameters<SpanProcessor["onStart"]>[1]): void;
302
304
  onEnd(readableSpan: ReadableSpan): void;
303
305
  shutdown(): Promise<void>;
304
306
  forceFlush(): Promise<void>;
@@ -452,6 +454,12 @@ declare function computeBuildHash(maps?: SourceMapEntry[]): Promise<string>;
452
454
  */
453
455
  declare function uploadSourceMaps(apiKey: string, endpoint: string, buildHash: string, maps: SourceMapEntry[]): Promise<SourceMapUploadResponse>;
454
456
 
457
+ /**
458
+ * Manual error capture API.
459
+ *
460
+ * Provides a simple function for developers to manually record errors
461
+ * as span events, independent of the `consoleErrors` config flag.
462
+ */
455
463
  /**
456
464
  * Records an error as a span event on the currently active OTel span.
457
465
  *