@osfactory/otel-hook 0.7.0 → 0.9.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/README.md +202 -3
- package/dist/cli.js +1527 -730
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +51 -3
- package/dist/config.js +481 -160
- package/dist/config.js.map +1 -1
- package/dist/destinations-C6Bm89W6.d.ts +169 -0
- package/dist/diagnostics.d.ts +8 -0
- package/dist/diagnostics.js +2 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/{otlp-log-sink-eUEjaLhk.d.ts → export-destinations-d8tZV0G4.d.ts} +255 -7
- package/dist/{hook-Dh8OO4Wa.d.ts → hook-zA1b4cWd.d.ts} +2 -2
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1379 -695
- package/dist/index.js.map +1 -1
- package/dist/integration.d.ts +25 -7
- package/dist/integration.js +742 -181
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.js +3 -1
- package/dist/lifecycle.js.map +1 -1
- package/dist/providers.d.ts +3 -3
- package/dist/{registry-CIVvRlVK.d.ts → registry-B8ZHc2bc.d.ts} +1 -1
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.js +245 -121
- package/dist/runtime.js.map +1 -1
- package/dist/{schema-Cn0-xz8L.d.ts → schema-BxiVsU-d.d.ts} +68 -2
- package/dist/telemetry.d.ts +22 -65
- package/dist/telemetry.js +657 -69
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +659 -535
- package/dist/testing.js.map +1 -1
- package/package.json +9 -9
package/dist/config.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { g as OtelHookConfigPatch, O as OtelHookConfig } from './schema-
|
|
3
|
-
export { D as DEFAULT_CONFIG, a as DEFAULT_DETECTION_POLICY, b as DEFAULT_DIAGNOSTICS_POLICY, c as DEFAULT_EXPORTER_POLICY, d as DEFAULT_LOGS_POLICY, e as DetectionPolicy, f as DiagnosticsPolicy, E as ExporterPolicy, L as LogsPolicy, h as detectionPolicySchema, i as diagnosticsPolicySchema, j as exporterPolicySchema, l as logsPolicySchema, o as otelHookConfigPatchSchema, k as otelHookConfigSchema } from './schema-
|
|
2
|
+
import { g as OtelHookConfigPatch, O as OtelHookConfig } from './schema-BxiVsU-d.js';
|
|
3
|
+
export { D as DEFAULT_CONFIG, a as DEFAULT_DETECTION_POLICY, b as DEFAULT_DIAGNOSTICS_POLICY, c as DEFAULT_EXPORTER_POLICY, d as DEFAULT_LOGS_POLICY, e as DetectionPolicy, f as DiagnosticsPolicy, E as ExporterPolicy, L as LogsPolicy, h as detectionPolicySchema, i as diagnosticsPolicySchema, j as exporterPolicySchema, l as logsPolicySchema, o as otelHookConfigPatchSchema, k as otelHookConfigSchema } from './schema-BxiVsU-d.js';
|
|
4
4
|
import { OtelHookErrorInfo } from './errors.js';
|
|
5
5
|
import { b as Attributes } from './primitives-CJ8-rn-f.js';
|
|
6
|
+
export { D as DEFAULT_DESTINATION_NAME, a as DEFAULT_SPOOL_POLICY, b as DESTINATION_NAME_PATTERN, c as DestinationDescription, E as ExportDestination, d as ExportDestinationConfig, e as ExportSignal, H as HEADER_ENV_REFERENCE_PREFIX, f as HeaderValueReference, M as MAX_DESTINATION_HEADERS, g as MAX_EXPORT_DESTINATIONS, R as ResolvedDestinationHeaders, S as SpoolPolicy, h as describeExportDestinations, i as effectiveSpoolPolicy, j as endpointOrigin, k as exportDestinationSchema, l as exportDestinationsSchema, m as exportSignalSchema, n as hasConfiguredDestinations, p as parseHeaderValueReference, r as resolveDestinationHeaders, o as resolveExportDestinations, s as spoolPolicySchema } from './destinations-C6Bm89W6.js';
|
|
6
7
|
export { g as contentModeSchema } from './policy-CimmCfRp.js';
|
|
7
8
|
import './taxonomy-DwhTtuWd.js';
|
|
8
9
|
import './content-M9xIKG7h.js';
|
|
@@ -200,10 +201,21 @@ type EnvironmentConfigResult = {
|
|
|
200
201
|
* `OTLP_HEADER_VARIABLES`: only the header *names* they set enter the
|
|
201
202
|
* configuration patch, and their values are resolved by `resolveOtlpHeaders`
|
|
202
203
|
* for the sinks alone.
|
|
204
|
+
*
|
|
205
|
+
* `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` is read too, but listed in
|
|
206
|
+
* `OTLP_ENDPOINT_VARIABLES` with its two siblings: an endpoint is not identity,
|
|
207
|
+
* yet a `TRACE` name in this list would defeat the guard that keeps identity
|
|
208
|
+
* variables out of it.
|
|
203
209
|
*/
|
|
204
210
|
declare const ENVIRONMENT_VARIABLES: Readonly<{
|
|
205
211
|
exporterEnabled: "OTEL_HOOK_ENABLED";
|
|
212
|
+
/** Full traces URL; otel-hook's own variable, above the standard ones. */
|
|
206
213
|
exporterEndpoint: "OTEL_HOOK_EXPORTER_ENDPOINT";
|
|
214
|
+
/**
|
|
215
|
+
* Standard base URL: `/v1/traces` and `/v1/logs` are appended per signal. A
|
|
216
|
+
* value already ending in `/v1/traces` is the legacy full traces URL and is
|
|
217
|
+
* used as-is (see `otlpSignalEndpointFromBase`).
|
|
218
|
+
*/
|
|
207
219
|
otlpEndpoint: "OTEL_EXPORTER_OTLP_ENDPOINT";
|
|
208
220
|
exporterProtocol: "OTEL_HOOK_EXPORTER_PROTOCOL";
|
|
209
221
|
exporterTimeoutMillis: "OTEL_HOOK_EXPORTER_TIMEOUT_MS";
|
|
@@ -314,4 +326,40 @@ declare const unionOtlpHeaderNames: (...lists: readonly (readonly string[])[]) =
|
|
|
314
326
|
/** {@link unionOtlpHeaderNames} over the names of header maps. */
|
|
315
327
|
declare const describeOtlpHeaderNames: (...sources: readonly Readonly<Record<string, string>>[]) => readonly string[];
|
|
316
328
|
|
|
317
|
-
|
|
329
|
+
/**
|
|
330
|
+
* OTLP/HTTP endpoint URLs per signal, as the OpenTelemetry exporter
|
|
331
|
+
* specification defines them.
|
|
332
|
+
*
|
|
333
|
+
* - `OTEL_EXPORTER_OTLP_ENDPOINT` is a **base** URL: the signal path
|
|
334
|
+
* (`/v1/traces`, `/v1/logs`) is appended to it.
|
|
335
|
+
* - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` / `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`
|
|
336
|
+
* are full URLs, used as they are.
|
|
337
|
+
*
|
|
338
|
+
* One compatibility rule: earlier releases read `OTEL_EXPORTER_OTLP_ENDPOINT`
|
|
339
|
+
* as the full traces URL. A base URL that already ends in `/v1/traces` is
|
|
340
|
+
* therefore taken to be that full URL, not a base to append to, so an existing
|
|
341
|
+
* `…/v1/traces` value keeps posting where it did.
|
|
342
|
+
*/
|
|
343
|
+
/**
|
|
344
|
+
* The standard endpoint variables. `generic` and `logs` also appear in
|
|
345
|
+
* `ENVIRONMENT_VARIABLES`; `traces` does not, because that list is guarded
|
|
346
|
+
* against identity-looking (`TRACE`) names.
|
|
347
|
+
*/
|
|
348
|
+
declare const OTLP_ENDPOINT_VARIABLES: Readonly<{
|
|
349
|
+
generic: "OTEL_EXPORTER_OTLP_ENDPOINT";
|
|
350
|
+
traces: "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT";
|
|
351
|
+
logs: "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT";
|
|
352
|
+
}>;
|
|
353
|
+
type OtlpSignal = "traces" | "logs";
|
|
354
|
+
/**
|
|
355
|
+
* The URL a signal posts to, given an `OTEL_EXPORTER_OTLP_ENDPOINT` base.
|
|
356
|
+
*
|
|
357
|
+
* Trailing slashes on the base are dropped before the signal path is appended,
|
|
358
|
+
* so `https://host/otlp` and `https://host/otlp/` both give
|
|
359
|
+
* `https://host/otlp/v1/traces`. A base ending in `/v1/traces` (the legacy
|
|
360
|
+
* full-URL form) is used as-is for traces and has that suffix swapped for
|
|
361
|
+
* `/v1/logs` for logs.
|
|
362
|
+
*/
|
|
363
|
+
declare const otlpSignalEndpointFromBase: (base: string, signal: OtlpSignal) => string;
|
|
364
|
+
|
|
365
|
+
export { CONFIG_SOURCE_PRECEDENCE, type ConfigLayer, type ConfigProvenance, type ConfigResolution, type ConfigSource, EMPTY_RESOURCE_ATTRIBUTES, ENVIRONMENT_VARIABLES, type EnvironmentConfigResult, type EnvironmentRecord, MAX_OTLP_HEADERS, MAX_RESOURCE_ATTRIBUTES, MAX_RESOURCE_ATTRIBUTE_KEY_LENGTH, MAX_RESOURCE_ATTRIBUTE_VALUE_LENGTH, OTLP_ENDPOINT_VARIABLES, OTLP_HEADER_VARIABLES, OtelHookConfig, OtelHookConfigPatch, type OtlpSignal, type ParsedOtlpHeaders, type ParsedResourceAttributes, RESERVED_RESOURCE_ATTRIBUTE_KEYS, RESOURCE_ATTRIBUTE_KEY_PATTERN, RESOURCE_ATTRIBUTE_KEY_REJECTION_DETAIL, type ResolvedOtlpHeaders, type ResourceAttributeKeyRejection, type ResourceAttributeValue, type ResourceAttributes, checkResourceAttributeKey, configSourceSchema, describeOtlpHeaderNames, describeResolvedConfig, describeResourceAttributeNames, isReservedResourceAttributeKey, isSecretResourceAttributeKey, mergeOtlpHeaders, otlpSignalEndpointFromBase, parseEnvironmentConfig, parseOtlpHeadersValue, parseResourceAttributesValue, resolveConfig, resolveOtlpHeaders, resourceAttributeValueSchema, resourceAttributesSchema, sanitizeResourceAttributes, unionOtlpHeaderNames };
|