@lorekit/cli 1.23.0 → 1.24.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/telemetry.mjs +15 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lorekit/cli",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "Install the LoreKit shared-memory skill and run health checks for the LoreKit MCP server.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/telemetry.mjs CHANGED
@@ -32,7 +32,9 @@ import { readLorekitJson } from './config.mjs';
32
32
  // (empty in the source tree, so default export stays off until built/injected).
33
33
  const DEFAULT_ENDPOINT = 'https://ingress.europe-west4.gcp.dash0-dev.com';
34
34
  const DEFAULT_TOKEN = TELEMETRY_TOKEN; // injected from LOREKIT_TELEMETRY_TOKEN at publish
35
- const DEFAULT_DATASET = '';
35
+ // Ship to the `default` Dash0 dataset unless `DASH0_DATASET` overrides it, so
36
+ // CLI telemetry lands alongside every other LoreKit component (all `default`).
37
+ const DEFAULT_DATASET = 'default';
36
38
 
37
39
  // Flags worth counting (e.g. how many installs are --global). Bounded on
38
40
  // purpose: only these booleans are ever attached, never free-form values.
@@ -125,8 +127,17 @@ export function resolveTelemetryConfig(env = process.env, repoConfig) {
125
127
  return { enabled: false };
126
128
  }
127
129
 
128
- const dataset = env.DASH0_DATASET || DEFAULT_DATASET;
129
- if (dataset) headers['Dash0-Dataset'] = dataset;
130
+ // Dataset routing, highest precedence first: an explicit `Dash0-Dataset`
131
+ // already parsed from OTEL_EXPORTER_OTLP_HEADERS wins and is never clobbered;
132
+ // otherwise DASH0_DATASET; otherwise the baked-in DEFAULT_DATASET (`default`).
133
+ // HTTP header names are case-insensitive, so match any casing the caller used
134
+ // (e.g. `dash0-dataset`) rather than only the canonical spelling — otherwise a
135
+ // second, conflicting header would be appended.
136
+ const hasDataset = Object.keys(headers).some((k) => k.toLowerCase() === 'dash0-dataset');
137
+ if (!hasDataset) {
138
+ const dataset = env.DASH0_DATASET || DEFAULT_DATASET;
139
+ if (dataset) headers['Dash0-Dataset'] = dataset;
140
+ }
130
141
 
131
142
  return { enabled: true, endpoint, headers };
132
143
  }
@@ -156,7 +167,7 @@ function toOtlpAttributes(attributes) {
156
167
 
157
168
  function resourceAttributes(version) {
158
169
  return [
159
- { key: 'service.name', value: { stringValue: 'lorekit-cli' } },
170
+ { key: 'service.name', value: { stringValue: 'cli' } },
160
171
  { key: 'service.namespace', value: { stringValue: 'lorekit' } },
161
172
  { key: 'service.version', value: { stringValue: String(version) } },
162
173
  { key: 'process.runtime.name', value: { stringValue: 'nodejs' } },