@vzn/vx-otel 0.0.530 → 0.0.532

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 (3) hide show
  1. package/README.md +9 -3
  2. package/package.json +2 -2
  3. package/src/otlp.ts +21 -0
package/README.md CHANGED
@@ -113,7 +113,12 @@ otel({
113
113
  ran how many files its key read (`vx.task.input_files`) and what its key
114
114
  changed since the last entry the cache saved for it
115
115
  (`vx.cache.miss.change_count`, and `vx.cache.miss.changes`, the first ten
116
- as `changed file packages/a/src/x.ts`). A
116
+ as `changed file packages/a/src/x.ts`), and what the cache cost: the
117
+ artifact's size (`vx.cache.artifact_bytes`, a hit's entry or the one a
118
+ miss saved), a miss's save (`vx.cache.save_ms`) and a remote hit's
119
+ download (`vx.cache.fetch_ms`). The run span adds the remote uploads
120
+ once they settled (`vx.cache.upload.count`, `.bytes`, `.ms` summed,
121
+ `.failed`). A
117
122
  failed task sets span status
118
123
  `ERROR`. A task span links to the spans of the tasks it waited on (a
119
124
  group seen through to the tasks behind it), and carries an event per
@@ -144,8 +149,9 @@ backend adds runs rather than reading each as the series' new total.
144
149
  `vx.task.duration` (ms, with `vx.cache.source`), and for a task the runner
145
150
  measured `vx.task.cpu_time` (ms) and `vx.task.peak_memory` (bytes), on a
146
151
  hit `vx.task.time_saved` (ms), `vx.task.admission_held` (ms) when an
147
- `admit` policy held it, and `vx.task.queued` (ms) when it waited for a
148
- worker; a skipped task sends none. While a task runs, its process tree is sampled
152
+ `admit` policy held it, `vx.task.queued` (ms) when it waited for a
153
+ worker, `vx.task.artifact_size` (bytes), `vx.task.cache_save` and
154
+ `vx.task.cache_fetch` (ms); a skipped task sends none. While a task runs, its process tree is sampled
149
155
  each second: `vx.task.cpu_usage` (cores busy since the last sample, 1 =
150
156
  one core) and `vx.task.memory` (resident bytes). Sampling runs only while
151
157
  metrics export; a remote task, or a task under 1 s, has no samples.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx-otel",
3
- "version": "0.0.530",
3
+ "version": "0.0.532",
4
4
  "license": "MIT",
5
5
  "description": "OpenTelemetry exporter for vx — a telemetry plugin mapping runs to OTLP traces + metrics (CI/CD + VCS semantic conventions).",
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "peerDependencies": {
37
- "@vzn/vx": "^0.0.530"
37
+ "@vzn/vx": "^0.0.532"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",
package/src/otlp.ts CHANGED
@@ -151,6 +151,13 @@ const VX_ATTR = {
151
151
  taskQueuedMs: 'vx.task.queued_ms',
152
152
  taskInputFiles: 'vx.task.input_files',
153
153
  missChangeCount: 'vx.cache.miss.change_count',
154
+ artifactBytes: 'vx.cache.artifact_bytes',
155
+ fetchMs: 'vx.cache.fetch_ms',
156
+ saveMs: 'vx.cache.save_ms',
157
+ uploadCount: 'vx.cache.upload.count',
158
+ uploadBytes: 'vx.cache.upload.bytes',
159
+ uploadMs: 'vx.cache.upload.ms',
160
+ uploadFailed: 'vx.cache.upload.failed',
154
161
  missChanges: 'vx.cache.miss.changes',
155
162
  ciJob: 'vx.ci.job',
156
163
  ciAttempt: 'vx.ci.attempt',
@@ -406,6 +413,14 @@ export function runSpanAttributes(run: RunContextRecord, summary?: RunSummaryRec
406
413
  boolAttr(VX_ATTR.runExitOk, summary.exitOk),
407
414
  strAttr(SEMCONV.pipelineResult, pipelineResult(summary)),
408
415
  )
416
+ if (summary.uploads !== undefined) {
417
+ attrs.push(
418
+ intAttr(VX_ATTR.uploadCount, summary.uploads.count),
419
+ intAttr(VX_ATTR.uploadBytes, summary.uploads.bytes),
420
+ intAttr(VX_ATTR.uploadMs, summary.uploads.ms),
421
+ intAttr(VX_ATTR.uploadFailed, summary.uploads.failed),
422
+ )
423
+ }
409
424
  }
410
425
  return attrs
411
426
  }
@@ -520,6 +535,9 @@ export function taskSpanAttributes(t: TaskTelemetry, run: TaskSpanRunContext): K
520
535
  attrs.push(intAttr(VX_ATTR.taskAdmissionHeldMs, t.admissionHeldMs))
521
536
  if (t.queuedMs !== undefined) attrs.push(intAttr(VX_ATTR.taskQueuedMs, t.queuedMs))
522
537
  if (t.inputFiles !== undefined) attrs.push(intAttr(VX_ATTR.taskInputFiles, t.inputFiles))
538
+ if (t.artifactBytes !== undefined) attrs.push(intAttr(VX_ATTR.artifactBytes, t.artifactBytes))
539
+ if (t.fetchMs !== undefined) attrs.push(intAttr(VX_ATTR.fetchMs, t.fetchMs))
540
+ if (t.saveMs !== undefined) attrs.push(intAttr(VX_ATTR.saveMs, t.saveMs))
523
541
  if (t.inputChanges !== undefined) {
524
542
  // `changed file src/a.ts`: what moved the key since the last saved entry.
525
543
  attrs.push(
@@ -725,6 +743,9 @@ function taskMetrics(points: readonly TaskMetricPoint[]): unknown[] {
725
743
  if (t.storedDurationMs !== undefined) add('vx.task.time_saved', 'ms', at(t.storedDurationMs))
726
744
  if (t.admissionHeldMs !== undefined) add('vx.task.admission_held', 'ms', at(t.admissionHeldMs))
727
745
  if (t.queuedMs !== undefined) add('vx.task.queued', 'ms', at(t.queuedMs))
746
+ if (t.artifactBytes !== undefined) add('vx.task.artifact_size', 'By', at(t.artifactBytes))
747
+ if (t.fetchMs !== undefined) add('vx.task.cache_fetch', 'ms', at(t.fetchMs))
748
+ if (t.saveMs !== undefined) add('vx.task.cache_save', 'ms', at(t.saveMs))
728
749
  }
729
750
  return [...series].map(([name, { unit, dataPoints }]) => ({ name, unit, gauge: { dataPoints } }))
730
751
  }