import * as Duration from "../Duration.ts"; import * as Effect from "../Effect.ts"; import type * as Headers from "../http/Headers.ts"; import type * as HttpClient from "../http/HttpClient.ts"; import * as Layer from "../Layer.ts"; import type * as Scope from "../Scope.ts"; import * as Tracer from "../Tracer.ts"; import * as Exporter from "./OtlpExporter.ts"; import type { KeyValue, Resource } from "./OtlpResource.ts"; import { OtlpSerialization } from "./OtlpSerialization.ts"; /** * Creates a `Tracer` that exports ended sampled spans to an OTLP traces endpoint. * * **Details** * * Spans are batched using the configured interval and batch size, serialized * with `OtlpSerialization`, and flushed when the surrounding `Scope` closes. * * @stability unstable * @category constructors * @since 4.0.0 */ export declare const make: (options: { readonly url: string; readonly resource?: { readonly serviceName?: string | undefined; readonly serviceVersion?: string | undefined; readonly attributes?: Record; } | undefined; readonly headers?: Headers.Input | undefined; /** * Request compression. Defaults to "none". Gzip uses * HttpClientRequest's default minimum body size of 1KB. */ readonly compression?: "gzip" | "none" | undefined; readonly exportInterval?: Duration.Input | undefined; readonly maxBatchSize?: number | undefined; readonly context?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined; readonly shutdownTimeout?: Duration.Input | undefined; }) => Effect.Effect; /** * Provides `Tracer.Tracer` using the OTLP tracer created by `make`. * * @stability unstable * @category layers * @since 4.0.0 */ export declare const layer: (options: { readonly url: string; readonly resource?: { readonly serviceName?: string | undefined; readonly serviceVersion?: string | undefined; readonly attributes?: Record; } | undefined; readonly headers?: Headers.Input | undefined; /** * Request compression. Defaults to "none". Gzip uses * HttpClientRequest's default minimum body size of 1KB. */ readonly compression?: "gzip" | "none" | undefined; readonly exportInterval?: Duration.Input | undefined; readonly maxBatchSize?: number | undefined; readonly context?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined; readonly shutdownTimeout?: Duration.Input | undefined; }) => Layer.Layer; /** * Creates an OTLP traces layer from OpenTelemetry configuration. * * **Details** * * Compression accepts "gzip" or "none". * `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` takes precedence over * `OTEL_EXPORTER_OTLP_COMPRESSION`, defaulting to "none". Gzip uses * HttpClientRequest's default minimum body size of 1KB. * * @stability unstable * @category layers * @since 4.0.0 */ export declare const layerFromConfig: (options?: { readonly resource?: { readonly serviceName?: string | undefined; readonly serviceVersion?: string | undefined; readonly attributes?: Record; } | undefined; readonly headers?: Headers.Input | undefined; readonly context?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined; }) => Layer.Layer; /** * Root OTLP traces payload containing spans grouped by resource. * * @stability unstable * @category models * @since 4.0.0 */ export interface TraceData { readonly resourceSpans: Array; } /** * Group of OTLP scope spans associated with a single resource. * * @stability unstable * @category models * @since 4.0.0 */ export interface ResourceSpan { readonly resource: Resource; readonly scopeSpans: Array; readonly schemaUrl?: string | undefined; } /** * Group of OTLP spans emitted by a single instrumentation scope. * * @stability unstable * @category models * @since 4.0.0 */ export interface ScopeSpan { readonly scope: Scope; readonly spans: Array; readonly schemaUrl?: string | undefined; } interface Scope { readonly name: string; readonly version?: string; } interface OtlpSpan { readonly traceId: string; readonly spanId: string; readonly parentSpanId: string | undefined; readonly name: string; readonly kind: number; readonly startTimeUnixNano: string; readonly endTimeUnixNano: string; readonly attributes: Array; readonly droppedAttributesCount: number; readonly events: Array; readonly droppedEventsCount: number; readonly status: Status; readonly links: Array; readonly droppedLinksCount: number; } interface Event { readonly attributes: Array; readonly name: string; readonly timeUnixNano: string; readonly droppedAttributesCount: number; } interface Link { readonly attributes: Array; readonly spanId: string; readonly traceId: string; readonly droppedAttributesCount: number; } interface Status { readonly code: StatusCode; message?: string; } declare const StatusCode: { readonly Unset: 0; readonly Ok: 1; readonly Error: 2; }; type StatusCode = typeof StatusCode[keyof typeof StatusCode]; export {}; //# sourceMappingURL=OtlpTracer.d.ts.map