@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/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-Cn0-xz8L.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-Cn0-xz8L.js';
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
- 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_HEADER_VARIABLES, OtelHookConfig, OtelHookConfigPatch, 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, parseEnvironmentConfig, parseOtlpHeadersValue, parseResourceAttributesValue, resolveConfig, resolveOtlpHeaders, resourceAttributeValueSchema, resourceAttributesSchema, sanitizeResourceAttributes, unionOtlpHeaderNames };
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 };