@logtape/otel 0.4.0-dev.8 → 0.12.0-dev.190

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/types/mod.d.ts DELETED
@@ -1,85 +0,0 @@
1
- import { type Sink } from "@logtape/logtape";
2
- import { type AnyValue, type LoggerProvider as LoggerProviderBase } from "@opentelemetry/api-logs";
3
- import type { OTLPExporterNodeConfigBase } from "@opentelemetry/otlp-exporter-base";
4
- import { type LogRecordProcessor } from "@opentelemetry/sdk-logs";
5
- /**
6
- * The OpenTelemetry logger provider.
7
- */
8
- type ILoggerProvider = LoggerProviderBase & {
9
- /**
10
- * Adds a new {@link LogRecordProcessor} to this logger.
11
- * @param processor the new LogRecordProcessor to be added.
12
- */
13
- addLogRecordProcessor(processor: LogRecordProcessor): void;
14
- /**
15
- * Flush all buffered data and shut down the LoggerProvider and all registered
16
- * LogRecordProcessor.
17
- *
18
- * Returns a promise which is resolved when all flushes are complete.
19
- */
20
- shutdown?: () => Promise<void>;
21
- };
22
- /**
23
- * The way to render the object in the log record. If `"json"`,
24
- * the object is rendered as a JSON string. If `"inspect"`,
25
- * the object is rendered using `util.inspect` in Node.js/Bun, or
26
- * `Deno.inspect` in Deno.
27
- */
28
- export type ObjectRenderer = "json" | "inspect";
29
- type Message = (string | null | undefined)[];
30
- /**
31
- * Custom `body` attribute formatter.
32
- * @since 0.3.0
33
- */
34
- export type BodyFormatter = (message: Message) => AnyValue;
35
- /**
36
- * Options for creating an OpenTelemetry sink.
37
- */
38
- export interface OpenTelemetrySinkOptions {
39
- /**
40
- * The OpenTelemetry logger provider to use.
41
- */
42
- loggerProvider?: ILoggerProvider;
43
- /**
44
- * The way to render the message in the log record. If `"string"`,
45
- * the message is rendered as a single string with the values are
46
- * interpolated into the message. If `"array"`, the message is
47
- * rendered as an array of strings. `"string"` by default.
48
- *
49
- * Or even fully customizable with a {@link BodyFormatter} function.
50
- * @since 0.2.0
51
- */
52
- messageType?: "string" | "array" | BodyFormatter;
53
- /**
54
- * The way to render the object in the log record. If `"json"`,
55
- * the object is rendered as a JSON string. If `"inspect"`,
56
- * the object is rendered using `util.inspect` in Node.js/Bun, or
57
- * `Deno.inspect` in Deno. `"inspect"` by default.
58
- */
59
- objectRenderer?: ObjectRenderer;
60
- /**
61
- * Whether to log diagnostics. Diagnostic logs are logged to
62
- * the `["logtape", "meta", "otel"]` category.
63
- * Turned off by default.
64
- */
65
- diagnostics?: boolean;
66
- /**
67
- * The OpenTelemetry OTLP exporter configuration to use.
68
- * Ignored if `loggerProvider` is provided.
69
- */
70
- otlpExporterConfig?: OTLPExporterNodeConfigBase;
71
- /**
72
- * The service name to use. If not provided, the service name is
73
- * taken from the `OTEL_SERVICE_NAME` environment variable.
74
- * Ignored if `loggerProvider` is provided.
75
- */
76
- serviceName?: string;
77
- }
78
- /**
79
- * Creates a sink that forwards log records to OpenTelemetry.
80
- * @param options Options for creating the sink.
81
- * @returns The sink.
82
- */
83
- export declare function getOpenTelemetrySink(options?: OpenTelemetrySinkOptions): Sink;
84
- export {};
85
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,IAAI,kBAAkB,EAG1C,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,yBAAyB,CAAC;AAKjC;;GAEG;AACH,KAAK,eAAe,GAAG,kBAAkB,GAAG;IAC1C;;;OAGG;IACH,qBAAqB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAE3D;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CA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