@tsuga/cli 1.35.0 → 1.36.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 (3) hide show
  1. package/README.md +61 -0
  2. package/dist/cli.js +60 -60
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -358,6 +358,67 @@ tsuga traces latency-summary --trace-id 78c99c5bb1e4a30297fa134b9dbec64f --from
358
358
  tsuga traces latency-summary --trace-id 78c99c5bb1e4a30297fa134b9dbec64f --from -30m --min-range-duration-ms 50
359
359
  ```
360
360
 
361
+ ### Contrast sets
362
+
363
+ Compares a target group of spans against a baseline and returns the attribute
364
+ values that are over-represented in the target — what those spans have in common
365
+ that the baseline ones do not. Each group carries its own filter and time range.
366
+
367
+ Filters are written in TQL, the same query language as `--query` elsewhere: terms
368
+ are ANDed by whitespace, `span_attributes.*` addresses span attributes, and
369
+ `duration` is in milliseconds. Run `tsuga docs get explore/query-syntax` for the
370
+ full syntax.
371
+
372
+ ```bash
373
+ tsuga traces contrast-sets --generate-skeleton > groups.json
374
+ tsuga traces contrast-sets -f groups.json
375
+ ```
376
+
377
+ Time ranges are Unix seconds, and unlike `--from` / `--to` they are not resolved
378
+ from relative strings — the body takes numbers. The skeleton and the examples
379
+ below carry a fixed window that is long past, so substitute your own:
380
+
381
+ ```bash
382
+ TO=$(date +%s)
383
+ FROM=$((TO - 3600))
384
+ ```
385
+
386
+ Erroring spans against healthy ones, for one service in one window:
387
+
388
+ ```bash
389
+ cat > groups.json <<EOF
390
+ {
391
+ "targetGroup": {"filter": "context.service.name:checkout status_code:error", "timeRange": {"from": $FROM, "to": $TO}},
392
+ "baselineGroup": {"filter": "context.service.name:checkout NOT status_code:error", "timeRange": {"from": $FROM, "to": $TO}}
393
+ }
394
+ EOF
395
+ tsuga traces contrast-sets -f groups.json
396
+ ```
397
+
398
+ Slow spans against normal-latency ones:
399
+
400
+ ```bash
401
+ tsuga traces contrast-sets -d '{
402
+ "targetGroup": {"filter": "context.service.name:checkout duration:>2000", "timeRange": {"from": 1704067200, "to": 1704070800}},
403
+ "baselineGroup": {"filter": "context.service.name:checkout duration:<500", "timeRange": {"from": 1704067200, "to": 1704070800}}
404
+ }'
405
+ ```
406
+
407
+ Before and after a deployment — same filter, two windows:
408
+
409
+ ```bash
410
+ tsuga traces contrast-sets -d '{
411
+ "targetGroup": {"filter": "context.service.name:checkout", "timeRange": {"from": 1704070800, "to": 1704074400}},
412
+ "baselineGroup": {"filter": "context.service.name:checkout", "timeRange": {"from": 1704063600, "to": 1704067200}}
413
+ }'
414
+ ```
415
+
416
+ Each returned value reports `targetSupport` and `baselineSupport` (the percentage
417
+ of each group carrying it), `lift` (`targetSupport / baselineSupport`, omitted
418
+ when the value never appears in the baseline), and `pValue`. Narrow the findings
419
+ with `topK`, `minLift`, and `minSupport`; restrict the attributes tested with
420
+ `candidateAttrs`.
421
+
361
422
  ### Metrics
362
423
 
363
424
  ```bash