@ultimat3/core 31.40.0 → 31.41.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/core",
3
- "version": "31.40.0",
3
+ "version": "31.41.0",
4
4
  "description": "Ultimate's foundation: errors, context, env, config, clock, ids, logging, telemetry, lifecycle",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -54,6 +54,6 @@
54
54
  "test": "bun test"
55
55
  },
56
56
  "dependencies": {
57
- "@ultimat3/schema": "31.40.0"
57
+ "@ultimat3/schema": "31.41.0"
58
58
  }
59
59
  }
@@ -67,7 +67,14 @@ export const FRAMEWORK_ENV: readonly FrameworkEnvName[] = [
67
67
  ...contract('core', 'OTEL_EXPORTER_OTLP_ENDPOINT', 'OTEL_EXPORTER_OTLP_HEADERS'),
68
68
  ...contract('core', 'OTEL_EXPORTER_OTLP_PROTOCOL', 'OTEL_TRACES_SAMPLER'),
69
69
  ...contract('core', 'OTEL_TRACES_SAMPLER_ARG'),
70
- // The signal-specific family (`OTEL_TRACES_EXPORTER`, `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`).
70
+ // Each exporter's own endpoint, headers and protocol (`otlp.ts`'s `SIGNAL_KEYS`), read before
71
+ // the general pair: configuration an app declares, exactly as it declares the general endpoint.
72
+ ...contract('core', 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT', 'OTEL_EXPORTER_OTLP_TRACES_HEADERS'),
73
+ ...contract('core', 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', 'OTEL_EXPORTER_OTLP_METRICS_HEADERS'),
74
+ ...contract('core', 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT', 'OTEL_EXPORTER_OTLP_LOGS_HEADERS'),
75
+ ...contract('core', 'OTEL_EXPORTER_OTLP_TRACES_PROTOCOL', 'OTEL_EXPORTER_OTLP_METRICS_PROTOCOL'),
76
+ ...contract('core', 'OTEL_EXPORTER_OTLP_LOGS_PROTOCOL'),
77
+ // The rest of the family (`OTEL_TRACES_EXPORTER`, `OTEL_LOGS_EXPORTER`): switches.
71
78
  prefix('OTEL_', 'core', 'switch'),
72
79
  ...host('core', 'USERNAME', 'USERDOMAIN'),
73
80
  ...contract('db', 'DATABASE_URL', 'DATABASE_POOL_MAX', 'DATABASE_POOLER'),
package/src/otlp.ts CHANGED
@@ -52,8 +52,27 @@ const GRPC_PORT = '4317';
52
52
 
53
53
  export type OtlpEnv = Readonly<Record<string, string | undefined>>;
54
54
 
55
- const signalKey = (signal: OtlpSignal, suffix: string): string =>
56
- `OTEL_EXPORTER_OTLP_${signal.toUpperCase()}_${suffix}`;
55
+ /** Each signal's own variables, spelled whole so `FRAMEWORK_ENV`'s scan sees every read. */
56
+ const SIGNAL_KEYS = {
57
+ traces: {
58
+ ENDPOINT: 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT',
59
+ HEADERS: 'OTEL_EXPORTER_OTLP_TRACES_HEADERS',
60
+ PROTOCOL: 'OTEL_EXPORTER_OTLP_TRACES_PROTOCOL',
61
+ },
62
+ metrics: {
63
+ ENDPOINT: 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT',
64
+ HEADERS: 'OTEL_EXPORTER_OTLP_METRICS_HEADERS',
65
+ PROTOCOL: 'OTEL_EXPORTER_OTLP_METRICS_PROTOCOL',
66
+ },
67
+ logs: {
68
+ ENDPOINT: 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT',
69
+ HEADERS: 'OTEL_EXPORTER_OTLP_LOGS_HEADERS',
70
+ PROTOCOL: 'OTEL_EXPORTER_OTLP_LOGS_PROTOCOL',
71
+ },
72
+ } as const satisfies Record<OtlpSignal, Record<'ENDPOINT' | 'HEADERS' | 'PROTOCOL', string>>;
73
+
74
+ const signalKey = (signal: OtlpSignal, suffix: 'ENDPOINT' | 'HEADERS' | 'PROTOCOL'): string =>
75
+ SIGNAL_KEYS[signal][suffix];
57
76
 
58
77
  /**
59
78
  * OTLP/HTTP JSON only. gRPC needs HTTP/2 plus protobuf, which is a dependency and a second wire