@intentius/chant-lexicon-otel 0.124.46 → 0.124.49
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/README.md +2 -2
- package/dist/build/capability-plugin.d.ts +10 -0
- package/dist/build/capability-plugin.d.ts.map +1 -0
- package/dist/build/capability-plugin.js +19 -0
- package/dist/build/ocb-build.d.ts +38 -0
- package/dist/build/ocb-build.d.ts.map +1 -0
- package/dist/build/ocb-build.js +49 -0
- package/dist/clickhouse-tables.d.ts +73 -0
- package/dist/clickhouse-tables.d.ts.map +1 -0
- package/dist/clickhouse-tables.js +199 -0
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/docs.js +4 -2
- package/dist/codegen/generate.d.ts +29 -10
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/generate.js +82 -17
- package/dist/components/common.d.ts +3 -1
- package/dist/components/common.d.ts.map +1 -1
- package/dist/components/common.js +2 -0
- package/dist/components/connectors.d.ts +25 -90
- package/dist/components/connectors.d.ts.map +1 -1
- package/dist/components/connectors.js +3 -0
- package/dist/components/exporters.d.ts +78 -34
- package/dist/components/exporters.d.ts.map +1 -1
- package/dist/components/exporters.js +26 -1
- package/dist/components/extensions.d.ts +16 -33
- package/dist/components/extensions.d.ts.map +1 -1
- package/dist/components/filtering.d.ts +13 -60
- package/dist/components/filtering.d.ts.map +1 -1
- package/dist/components/k8s-receivers.d.ts +5 -53
- package/dist/components/k8s-receivers.d.ts.map +1 -1
- package/dist/components/overlay.d.ts +25 -0
- package/dist/components/overlay.d.ts.map +1 -0
- package/dist/components/overlay.js +19 -0
- package/dist/components/processors.d.ts +18 -79
- package/dist/components/processors.d.ts.map +1 -1
- package/dist/components/receivers.d.ts +17 -71
- package/dist/components/receivers.d.ts.map +1 -1
- package/dist/components/receivers.js +3 -1
- package/dist/components/sampling.d.ts +19 -35
- package/dist/components/sampling.d.ts.map +1 -1
- package/dist/config-hygiene.d.ts +10 -8
- package/dist/config-hygiene.d.ts.map +1 -1
- package/dist/config-hygiene.js +36 -13
- package/dist/coverage.d.ts +50 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/coverage.js +92 -0
- package/dist/define.d.ts +8 -5
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +10 -6
- package/dist/distribution.d.ts +125 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/distribution.js +227 -0
- package/dist/generated/index.d.ts +4234 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +23 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/init-templates.js +2 -2
- package/dist/integrity.json +11 -9
- package/dist/lint/audit-catalog.d.ts +3 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/audit-catalog.js +5 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/index.js +4 -0
- package/dist/lint/post-synth/otel-helpers.d.ts +2 -1
- package/dist/lint/post-synth/otel-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/otel-helpers.js +1 -1
- package/dist/lint/post-synth/otel119.d.ts +1 -1
- package/dist/lint/post-synth/otel119.js +1 -1
- package/dist/lint/post-synth/otel125.d.ts +1 -1
- package/dist/lint/post-synth/otel125.js +1 -1
- package/dist/lint/post-synth/otel126.d.ts +1 -1
- package/dist/lint/post-synth/otel126.js +1 -1
- package/dist/lint/post-synth/otel127.d.ts +1 -1
- package/dist/lint/post-synth/otel127.js +1 -1
- package/dist/lint/post-synth/otel128.d.ts +8 -0
- package/dist/lint/post-synth/otel128.d.ts.map +1 -0
- package/dist/lint/post-synth/otel128.js +17 -0
- package/dist/lint/post-synth/otel129.d.ts +15 -0
- package/dist/lint/post-synth/otel129.d.ts.map +1 -0
- package/dist/lint/post-synth/otel129.js +92 -0
- package/dist/lsp/completions.d.ts +10 -1
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +29 -1
- package/dist/lsp/hover.d.ts +5 -1
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +16 -3
- package/dist/lsp/properties.d.ts +34 -0
- package/dist/lsp/properties.d.ts.map +1 -0
- package/dist/lsp/properties.js +135 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +5 -0
- package/dist/metric-names.d.ts +36 -8
- package/dist/metric-names.d.ts.map +1 -1
- package/dist/metric-names.js +42 -9
- package/dist/model.d.ts +1 -1
- package/dist/model.js +1 -1
- package/dist/okf/index.md +3 -0
- package/dist/okf/rules/OTEL128.md +11 -0
- package/dist/okf/rules/OTEL129.md +11 -0
- package/dist/okf/types/ClickHouseExporter.md +9 -0
- package/dist/op/activities/collector-audit.d.ts +18 -6
- package/dist/op/activities/collector-audit.d.ts.map +1 -1
- package/dist/op/activities/collector-audit.js +37 -21
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +51 -8
- package/dist/rules/otel-helpers.ts +1 -1
- package/dist/rules/otel119.ts +1 -1
- package/dist/rules/otel125.ts +1 -1
- package/dist/rules/otel126.ts +1 -1
- package/dist/rules/otel127.ts +1 -1
- package/dist/rules/otel128.ts +22 -0
- package/dist/rules/otel129.ts +99 -0
- package/dist/serializer.d.ts +3 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +12 -2
- package/dist/spec/builtins.d.ts +17 -0
- package/dist/spec/builtins.d.ts.map +1 -0
- package/dist/spec/builtins.js +45 -0
- package/dist/spec/fetch.d.ts +120 -0
- package/dist/spec/fetch.d.ts.map +1 -0
- package/dist/spec/fetch.js +282 -0
- package/dist/spec/parse.d.ts +77 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/spec/parse.js +337 -0
- package/dist/spec/pin.d.ts +82 -0
- package/dist/spec/pin.d.ts.map +1 -0
- package/dist/spec/pin.js +126 -0
- package/dist/spec/snapshot-cli.d.ts +13 -0
- package/dist/spec/snapshot-cli.d.ts.map +1 -0
- package/dist/spec/snapshot-cli.js +31 -0
- package/dist/spec/snapshot.d.ts +9 -0
- package/dist/spec/snapshot.d.ts.map +1 -0
- package/dist/spec/snapshot.js +14 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/validate-config.d.ts +1 -1
- package/dist/validate-config.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +1 -0
- package/dist/workspace-links.d.ts +25 -0
- package/dist/workspace-links.d.ts.map +1 -0
- package/dist/workspace-links.js +49 -0
- package/package.json +3 -2
- package/src/build/capability-plugin.ts +30 -0
- package/src/build/ocb-build.ts +73 -0
- package/src/clickhouse-exporter.e2e.test.ts +208 -0
- package/src/clickhouse-tables.test.ts +216 -0
- package/src/clickhouse-tables.ts +223 -0
- package/src/codegen/docs.ts +4 -2
- package/src/codegen/generate.ts +95 -19
- package/src/components/common.ts +4 -2
- package/src/components/connectors.ts +30 -77
- package/src/components/exporters.ts +128 -61
- package/src/components/extensions.ts +22 -36
- package/src/components/filtering.ts +17 -58
- package/src/components/k8s-receivers.test.ts +1 -1
- package/src/components/k8s-receivers.ts +3 -45
- package/src/components/overlay.ts +24 -0
- package/src/components/processors.ts +18 -63
- package/src/components/receivers.ts +20 -60
- package/src/components/sampling.ts +24 -37
- package/src/config-hygiene.ts +36 -13
- package/src/coverage.test.ts +37 -0
- package/src/coverage.ts +121 -0
- package/src/define.test.ts +2 -0
- package/src/define.ts +10 -6
- package/src/distribution.test.ts +250 -0
- package/src/distribution.ts +305 -0
- package/src/generated/index.ts +4576 -0
- package/src/generated/lexicon-otel.json +5 -0
- package/src/generated/properties.json +1 -0
- package/src/import/roundtrip.test.ts +16 -0
- package/src/import/testdata/clickhouse.yaml +37 -0
- package/src/import/testdata/fixtures.ts +17 -2
- package/src/import/testdata/upstream/clickhouse-exporter.yaml +60 -0
- package/src/index.ts +69 -0
- package/src/init-templates.ts +2 -2
- package/src/lint/audit-catalog.ts +15 -0
- package/src/lint/post-synth/index.ts +4 -0
- package/src/lint/post-synth/otel-helpers.ts +1 -1
- package/src/lint/post-synth/otel119.ts +1 -1
- package/src/lint/post-synth/otel125.ts +1 -1
- package/src/lint/post-synth/otel126.ts +1 -1
- package/src/lint/post-synth/otel127.ts +1 -1
- package/src/lint/post-synth/otel128.ts +22 -0
- package/src/lint/post-synth/otel129.ts +99 -0
- package/src/lsp/completions.ts +30 -1
- package/src/lsp/hover.ts +14 -3
- package/src/lsp/properties.test.ts +72 -0
- package/src/lsp/properties.ts +141 -0
- package/src/metric-names.test.ts +11 -0
- package/src/metric-names.ts +64 -16
- package/src/model.ts +1 -1
- package/src/op/activities/collector-audit.test.ts +29 -22
- package/src/op/activities/collector-audit.ts +38 -18
- package/src/plugin.test.ts +2 -0
- package/src/plugin.ts +57 -6
- package/src/serializer.ts +11 -2
- package/src/spec/builtins.ts +56 -0
- package/src/spec/fetch.ts +332 -0
- package/src/spec/otel-schemas.snapshot.json +13932 -0
- package/src/spec/parse.ts +364 -0
- package/src/spec/pin.ts +155 -0
- package/src/spec/snapshot-cli.ts +32 -0
- package/src/spec/snapshot.ts +19 -0
- package/src/spec/spec.test.ts +144 -0
- package/src/validate-config.ts +4 -3
- package/src/validate.ts +1 -0
- package/src/workspace-links.e2e.test.ts +91 -0
- package/src/workspace-links.ts +50 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-hygiene.d.ts","sourceRoot":"","sources":["../src/config-hygiene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAuF,CAAC;
|
|
1
|
+
{"version":3,"file":"config-hygiene.d.ts","sourceRoot":"","sources":["../src/config-hygiene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAuF,CAAC;AAkV/G;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAgCnD,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAkC9C,CAAC;AA0CH,iDAAiD;AACjD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,EAAE,CAY7E"}
|
package/dist/config-hygiene.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* so it runs on emitted YAML, on an imported file and on a config inside a
|
|
6
6
|
* ConfigMap alike. `validateCollectorConfig` calls `configHygieneIssues`.
|
|
7
7
|
*
|
|
8
|
-
* Every list and version here is read from collector or collector-contrib
|
|
9
|
-
* v0.
|
|
8
|
+
* Every list and version here is read from collector or collector-contrib at
|
|
9
|
+
* `COLLECTOR_PIN` (v0.162.0); the lint rules page cites the file for each.
|
|
10
10
|
*/
|
|
11
11
|
import { parseComponentId } from "./model.js";
|
|
12
12
|
import { componentListeners, listenerPaths } from "./validate-config.js";
|
|
@@ -77,10 +77,12 @@ function invertMatchPaths(value, path, out) {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* OTEL119: a field deprecated at or before the pin. The collector still
|
|
80
|
-
*
|
|
80
|
+
* parses each of these at v0.162.0 (`COLLECTOR_PIN`), and a later release
|
|
81
|
+
* drops them.
|
|
81
82
|
*
|
|
82
83
|
* - `invert_match: true` in a `tail_sampling` policy: inverted decisions are
|
|
83
|
-
* deprecated in contrib v0.126.0 (#39833) for a `drop` policy.
|
|
84
|
+
* deprecated in contrib v0.126.0 (#39833) for a `drop` policy, and v0.155.0
|
|
85
|
+
* removed the gate that kept them (#48976).
|
|
84
86
|
* - `service.telemetry.metrics.address`: deprecated in core v0.111.0
|
|
85
87
|
* (#11205) for `readers`.
|
|
86
88
|
* - `dimensions_cache_size` on `spanmetrics`: deprecated in contrib v0.125.0
|
|
@@ -100,7 +102,7 @@ function deprecatedFieldIssues(config) {
|
|
|
100
102
|
code: "OTEL119",
|
|
101
103
|
severity: "warning",
|
|
102
104
|
component: id,
|
|
103
|
-
message: `processor "${id}" policy ${name} sets ${path}; inverted decisions are deprecated since collector-contrib v0.126.0. Use a drop policy to keep the traces out instead`,
|
|
105
|
+
message: `processor "${id}" policy ${name} sets ${path}; inverted decisions are deprecated since collector-contrib v0.126.0, and v0.155.0 removed the gate that kept them. Use a drop policy to keep the traces out instead`,
|
|
104
106
|
});
|
|
105
107
|
}
|
|
106
108
|
});
|
|
@@ -308,8 +310,9 @@ function deliveryIssues(config) {
|
|
|
308
310
|
/**
|
|
309
311
|
* The exporters OTEL125 knows send one request per incoming batch unless
|
|
310
312
|
* told otherwise: `otlp` and `otlphttp`, whose default `sending_queue` at
|
|
311
|
-
* v0.
|
|
312
|
-
* `NewDefaultQueueConfig
|
|
313
|
+
* v0.162.0 has no `batch` (`exporterhelper/internal/queue_sender.go`,
|
|
314
|
+
* `NewDefaultQueueConfig`, while the alpha `pkg.exporterhelper.queueBatchEnabled`
|
|
315
|
+
* gate is off). Other exporters may batch on their own, so they
|
|
313
316
|
* are not checked.
|
|
314
317
|
*/
|
|
315
318
|
const UNBATCHED_EXPORTERS = new Set(["otlp", "otlphttp"]);
|
|
@@ -347,9 +350,9 @@ function batchIssues(config) {
|
|
|
347
350
|
}
|
|
348
351
|
// ── OTEL126, OTEL127: names checked against a fixed list ─────────────
|
|
349
352
|
/**
|
|
350
|
-
* The fields `k8sattributes` can extract at v0.
|
|
351
|
-
* `Config.Validate` (`processor/k8sattributesprocessor/config.go`),
|
|
352
|
-
* the semconv
|
|
353
|
+
* The fields `k8sattributes` can extract at v0.162.0 (`COLLECTOR_PIN`): the
|
|
354
|
+
* cases of `Config.Validate` (`processor/k8sattributesprocessor/config.go`),
|
|
355
|
+
* with the semconv keys and `options.go` constants they name.
|
|
353
356
|
*/
|
|
354
357
|
export const K8S_ATTRIBUTES_METADATA = Object.freeze([
|
|
355
358
|
"k8s.namespace.name",
|
|
@@ -369,12 +372,14 @@ export const K8S_ATTRIBUTES_METADATA = Object.freeze([
|
|
|
369
372
|
"k8s.job.name",
|
|
370
373
|
"k8s.job.uid",
|
|
371
374
|
"k8s.cronjob.name",
|
|
375
|
+
"k8s.cronjob.uid",
|
|
372
376
|
"k8s.node.name",
|
|
373
377
|
"k8s.node.uid",
|
|
374
378
|
"k8s.container.name",
|
|
375
379
|
"container.id",
|
|
376
380
|
"container.image.name",
|
|
377
381
|
"container.image.tag",
|
|
382
|
+
"container.image.tags",
|
|
378
383
|
"service.namespace",
|
|
379
384
|
"service.name",
|
|
380
385
|
"service.version",
|
|
@@ -383,14 +388,22 @@ export const K8S_ATTRIBUTES_METADATA = Object.freeze([
|
|
|
383
388
|
"k8s.cluster.uid",
|
|
384
389
|
]);
|
|
385
390
|
/**
|
|
386
|
-
* The detectors `resourcedetection` knows at v0.
|
|
387
|
-
* in `NewFactory`
|
|
388
|
-
* each detector's
|
|
391
|
+
* The detectors `resourcedetection` knows at v0.162.0 (`COLLECTOR_PIN`): the
|
|
392
|
+
* keys of the map in `NewFactory`
|
|
393
|
+
* (`processor/resourcedetectionprocessor/factory.go`), as each detector's
|
|
394
|
+
* `TypeStr` spells them. `k8snode` is the deprecated alias of `k8s_api`
|
|
395
|
+
* (v0.154.0); both still build.
|
|
389
396
|
*/
|
|
390
397
|
export const RESOURCE_DETECTORS = Object.freeze([
|
|
398
|
+
"akamai",
|
|
399
|
+
"alibaba_ecs",
|
|
391
400
|
"aks",
|
|
392
401
|
"azure",
|
|
402
|
+
"azureappservice",
|
|
403
|
+
"azurecontainerapps",
|
|
404
|
+
"azurefunctions",
|
|
393
405
|
"consul",
|
|
406
|
+
"digitalocean",
|
|
394
407
|
"docker",
|
|
395
408
|
"ec2",
|
|
396
409
|
"ecs",
|
|
@@ -400,11 +413,21 @@ export const RESOURCE_DETECTORS = Object.freeze([
|
|
|
400
413
|
"env",
|
|
401
414
|
"gcp",
|
|
402
415
|
"heroku",
|
|
416
|
+
"hetzner",
|
|
417
|
+
"ibmcloud_classic",
|
|
418
|
+
"ibmcloud_vpc",
|
|
419
|
+
"scaleway",
|
|
403
420
|
"system",
|
|
404
421
|
"openshift",
|
|
422
|
+
"nova",
|
|
423
|
+
"oraclecloud",
|
|
424
|
+
"k8s_api",
|
|
405
425
|
"k8snode",
|
|
406
426
|
"kubeadm",
|
|
407
427
|
"dynatrace",
|
|
428
|
+
"tencent_cvm",
|
|
429
|
+
"upcloud",
|
|
430
|
+
"vultr",
|
|
408
431
|
]);
|
|
409
432
|
/** OTEL126: `k8sattributes` `extract.metadata` names a field the processor can't extract, so the collector refuses the config. */
|
|
410
433
|
function k8sAttributesIssues(config) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverage of the otel lexicon against a distribution manifest (#3361).
|
|
3
|
+
*
|
|
4
|
+
* The question a collector lexicon answers is "which components of the binary
|
|
5
|
+
* I run does chant type?". The committed snapshot holds the `otelcol-contrib`
|
|
6
|
+
* and `otelcol-k8s` manifests' component index at the pinned releases, with
|
|
7
|
+
* each component's type and whether upstream publishes a `config.schema.yaml`
|
|
8
|
+
* for it. Each component is in one of three places:
|
|
9
|
+
*
|
|
10
|
+
* - a built-in, with its config type generated from the schema (or
|
|
11
|
+
* hand-written when upstream publishes none);
|
|
12
|
+
* - not built in, reached through `defineComponent`, which carries its own pin;
|
|
13
|
+
* - a built-in the distribution does not ship, which is a lexicon defect.
|
|
14
|
+
*
|
|
15
|
+
* `unaccountedKinds` (what `check-lexicon` gates on) lists the defects: a
|
|
16
|
+
* built-in missing from the contrib manifest, or a built-in whose upstream
|
|
17
|
+
* schema exists but whose config type is not generated from it. Everything
|
|
18
|
+
* here is read from the snapshot, offline.
|
|
19
|
+
*/
|
|
20
|
+
import { type DistributionName, type OtelSpecSnapshot } from "./spec/fetch.js";
|
|
21
|
+
export interface DistributionCoverage {
|
|
22
|
+
distribution: DistributionName;
|
|
23
|
+
version: string;
|
|
24
|
+
/** Components the manifest lists. */
|
|
25
|
+
components: number;
|
|
26
|
+
/** Of those, how many ship a `config.schema.yaml`. */
|
|
27
|
+
withSchema: number;
|
|
28
|
+
/** Built-ins in this distribution, as `kind/type`. */
|
|
29
|
+
builtin: string[];
|
|
30
|
+
/** Built-ins this distribution does not ship, as `kind/type`. */
|
|
31
|
+
builtinMissing: string[];
|
|
32
|
+
/** Components with a schema chant does not build in, as `kind/type`; `defineComponent` reaches them. */
|
|
33
|
+
schemaNotBuiltin: string[];
|
|
34
|
+
/** Components without a schema chant does not build in, as `kind/type` (or the module when it has no type). */
|
|
35
|
+
noSchemaNotBuiltin: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface OtelCoverageReport {
|
|
38
|
+
/** Built-ins whose config type is generated from upstream, as class names. */
|
|
39
|
+
generated: string[];
|
|
40
|
+
/** Built-ins with a hand-written config type, because upstream publishes no schema, as class names. */
|
|
41
|
+
handWritten: string[];
|
|
42
|
+
distributions: DistributionCoverage[];
|
|
43
|
+
/** The defects, for `check-lexicon`. */
|
|
44
|
+
unaccountedKinds: string[];
|
|
45
|
+
}
|
|
46
|
+
/** The coverage report for a snapshot (the committed one by default). */
|
|
47
|
+
export declare function coverageReport(snapshot?: OtelSpecSnapshot): OtelCoverageReport;
|
|
48
|
+
/** The report as `coverage()` prints it. */
|
|
49
|
+
export declare function formatCoverage(report: OtelCoverageReport): string;
|
|
50
|
+
//# sourceMappingURL=coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../src/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAiB,KAAK,gBAAgB,EAAyB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGlH,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iEAAiE;IACjE,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,wGAAwG;IACxG,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,+GAA+G;IAC/G,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,uGAAuG;IACvG,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,wCAAwC;IACxC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAUD,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,QAAQ,GAAE,gBAAiC,GAAG,kBAAkB,CA0C9F;AAED,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAcjE"}
|
package/dist/coverage.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverage of the otel lexicon against a distribution manifest (#3361).
|
|
3
|
+
*
|
|
4
|
+
* The question a collector lexicon answers is "which components of the binary
|
|
5
|
+
* I run does chant type?". The committed snapshot holds the `otelcol-contrib`
|
|
6
|
+
* and `otelcol-k8s` manifests' component index at the pinned releases, with
|
|
7
|
+
* each component's type and whether upstream publishes a `config.schema.yaml`
|
|
8
|
+
* for it. Each component is in one of three places:
|
|
9
|
+
*
|
|
10
|
+
* - a built-in, with its config type generated from the schema (or
|
|
11
|
+
* hand-written when upstream publishes none);
|
|
12
|
+
* - not built in, reached through `defineComponent`, which carries its own pin;
|
|
13
|
+
* - a built-in the distribution does not ship, which is a lexicon defect.
|
|
14
|
+
*
|
|
15
|
+
* `unaccountedKinds` (what `check-lexicon` gates on) lists the defects: a
|
|
16
|
+
* built-in missing from the contrib manifest, or a built-in whose upstream
|
|
17
|
+
* schema exists but whose config type is not generated from it. Everything
|
|
18
|
+
* here is read from the snapshot, offline.
|
|
19
|
+
*/
|
|
20
|
+
import { BUILTIN_SPECS } from "./spec/builtins.js";
|
|
21
|
+
import { loadSnapshot } from "./spec/snapshot.js";
|
|
22
|
+
import { DISTRIBUTIONS } from "./spec/fetch.js";
|
|
23
|
+
function label(c) {
|
|
24
|
+
return `${c.kind}/${c.type ?? c.module}`;
|
|
25
|
+
}
|
|
26
|
+
function find(index, kind, type) {
|
|
27
|
+
return index.find((c) => c.kind === kind && (c.type === type || c.deprecatedType === type));
|
|
28
|
+
}
|
|
29
|
+
/** The coverage report for a snapshot (the committed one by default). */
|
|
30
|
+
export function coverageReport(snapshot = loadSnapshot()) {
|
|
31
|
+
const contrib = snapshot.distributions["otelcol-contrib"];
|
|
32
|
+
const generated = [];
|
|
33
|
+
const handWritten = [];
|
|
34
|
+
const unaccounted = [];
|
|
35
|
+
for (const b of BUILTIN_SPECS) {
|
|
36
|
+
const hit = find(contrib, b.kind, b.type);
|
|
37
|
+
if (!hit) {
|
|
38
|
+
unaccounted.push(`${b.className}: ${b.kind} "${b.type}" is not in otelcol-contrib ${snapshot.versions["otelcol-contrib"]}`);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (hit.schema && snapshot.schemas[hit.schema] !== undefined)
|
|
42
|
+
generated.push(b.className);
|
|
43
|
+
else if (hit.schema)
|
|
44
|
+
unaccounted.push(`${b.className}: upstream ships ${hit.schema} but the snapshot does not carry it; run \`just snapshot\``);
|
|
45
|
+
else
|
|
46
|
+
handWritten.push(b.className);
|
|
47
|
+
}
|
|
48
|
+
const distributions = DISTRIBUTIONS.map((distribution) => {
|
|
49
|
+
const index = snapshot.distributions[distribution];
|
|
50
|
+
const builtinHits = new Set();
|
|
51
|
+
const builtin = [];
|
|
52
|
+
const builtinMissing = [];
|
|
53
|
+
for (const b of BUILTIN_SPECS) {
|
|
54
|
+
const hit = find(index, b.kind, b.type);
|
|
55
|
+
if (hit) {
|
|
56
|
+
builtinHits.add(hit);
|
|
57
|
+
builtin.push(`${b.kind}/${b.type}`);
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
builtinMissing.push(`${b.kind}/${b.type}`);
|
|
61
|
+
}
|
|
62
|
+
const others = index.filter((c) => !builtinHits.has(c));
|
|
63
|
+
return {
|
|
64
|
+
distribution,
|
|
65
|
+
version: snapshot.versions[distribution],
|
|
66
|
+
components: index.length,
|
|
67
|
+
withSchema: index.filter((c) => c.schema).length,
|
|
68
|
+
builtin,
|
|
69
|
+
builtinMissing,
|
|
70
|
+
schemaNotBuiltin: others.filter((c) => c.schema).map(label),
|
|
71
|
+
noSchemaNotBuiltin: others.filter((c) => !c.schema).map(label),
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
return { generated, handWritten, distributions, unaccountedKinds: unaccounted };
|
|
75
|
+
}
|
|
76
|
+
/** The report as `coverage()` prints it. */
|
|
77
|
+
export function formatCoverage(report) {
|
|
78
|
+
const lines = [
|
|
79
|
+
`otel: ${report.generated.length + report.handWritten.length} built-in components, ${report.generated.length} with config types generated from upstream config.schema.yaml`,
|
|
80
|
+
];
|
|
81
|
+
if (report.handWritten.length > 0)
|
|
82
|
+
lines.push(` hand-written (no upstream schema): ${report.handWritten.join(", ")}`);
|
|
83
|
+
for (const d of report.distributions) {
|
|
84
|
+
lines.push(`${d.distribution} ${d.version}: ${d.components} components, ${d.withSchema} with a schema; ` +
|
|
85
|
+
`${d.builtin.length} built in, ${d.schemaNotBuiltin.length + d.noSchemaNotBuiltin.length} through defineComponent`);
|
|
86
|
+
if (d.builtinMissing.length > 0)
|
|
87
|
+
lines.push(` built-ins this distribution does not ship: ${d.builtinMissing.join(", ")}`);
|
|
88
|
+
}
|
|
89
|
+
for (const u of report.unaccountedKinds)
|
|
90
|
+
lines.push(` unaccounted: ${u}`);
|
|
91
|
+
return lines.join("\n");
|
|
92
|
+
}
|
package/dist/define.d.ts
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* ## Schema pinning
|
|
13
13
|
*
|
|
14
14
|
* Every definition carries a `pin`: the source its config type was written
|
|
15
|
-
* against and the version of that source. Built-ins share `COLLECTOR_PIN
|
|
16
|
-
*
|
|
17
|
-
* them. A custom definition must name its own pin, typically the npm package
|
|
15
|
+
* against and the version of that source. Built-ins share `COLLECTOR_PIN`:
|
|
16
|
+
* their config types are generated from upstream `config.schema.yaml` at that
|
|
17
|
+
* release (`src/spec/`, #3361), so the chant lexicon version pins them. A custom definition must name its own pin, typically the npm package
|
|
18
18
|
* (or Go module) that ships the component and the release its type follows,
|
|
19
19
|
* optionally with a digest of the schema document. chant records the pin; it
|
|
20
20
|
* does not fetch or verify the schema. The pin shows up in three places:
|
|
@@ -43,8 +43,11 @@ export interface SchemaPin {
|
|
|
43
43
|
digest?: string;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* The collector distribution the built-in config types follow
|
|
47
|
-
*
|
|
46
|
+
* The collector distribution the built-in config types follow: the
|
|
47
|
+
* `otelcol-contrib` release whose manifest scopes them and whose component
|
|
48
|
+
* schemas they are generated from (`OTELCOL_CONTRIB_VERSION` in
|
|
49
|
+
* `src/spec/pin.ts`). Bumping it is a lexicon change like any other, released
|
|
50
|
+
* with this package, and it moves `COLLECTOR_IMAGE` with it.
|
|
48
51
|
*/
|
|
49
52
|
export declare const COLLECTOR_PIN: SchemaPin;
|
|
50
53
|
/**
|
package/dist/define.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,E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,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,GACzD,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAEzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,CAAC,MACd,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,MAAM,WAC/C,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KACvC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAG3B;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAQtE;AAED,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAW9F;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,SAAS,CAI1D"}
|
package/dist/define.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* ## Schema pinning
|
|
13
13
|
*
|
|
14
14
|
* Every definition carries a `pin`: the source its config type was written
|
|
15
|
-
* against and the version of that source. Built-ins share `COLLECTOR_PIN
|
|
16
|
-
*
|
|
17
|
-
* them. A custom definition must name its own pin, typically the npm package
|
|
15
|
+
* against and the version of that source. Built-ins share `COLLECTOR_PIN`:
|
|
16
|
+
* their config types are generated from upstream `config.schema.yaml` at that
|
|
17
|
+
* release (`src/spec/`, #3361), so the chant lexicon version pins them. A custom definition must name its own pin, typically the npm package
|
|
18
18
|
* (or Go module) that ships the component and the release its type follows,
|
|
19
19
|
* optionally with a digest of the schema document. chant records the pin; it
|
|
20
20
|
* does not fetch or verify the schema. The pin shows up in three places:
|
|
@@ -33,13 +33,17 @@
|
|
|
33
33
|
*/
|
|
34
34
|
import { createResource } from "@intentius/chant/runtime";
|
|
35
35
|
import { canonicalComponentType, componentId } from "./model.js";
|
|
36
|
+
import { OTELCOL_CONTRIB_VERSION } from "./spec/pin.js";
|
|
36
37
|
/**
|
|
37
|
-
* The collector distribution the built-in config types follow
|
|
38
|
-
*
|
|
38
|
+
* The collector distribution the built-in config types follow: the
|
|
39
|
+
* `otelcol-contrib` release whose manifest scopes them and whose component
|
|
40
|
+
* schemas they are generated from (`OTELCOL_CONTRIB_VERSION` in
|
|
41
|
+
* `src/spec/pin.ts`). Bumping it is a lexicon change like any other, released
|
|
42
|
+
* with this package, and it moves `COLLECTOR_IMAGE` with it.
|
|
39
43
|
*/
|
|
40
44
|
export const COLLECTOR_PIN = Object.freeze({
|
|
41
45
|
source: "github.com/open-telemetry/opentelemetry-collector-contrib",
|
|
42
|
-
version:
|
|
46
|
+
version: OTELCOL_CONTRIB_VERSION,
|
|
43
47
|
});
|
|
44
48
|
/**
|
|
45
49
|
* The semantic-conventions release this package's other attribute keys
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Distribution`, the builder manifest `ocb` (the OpenTelemetry Collector
|
|
3
|
+
* Builder) builds a custom collector from (#3374).
|
|
4
|
+
*
|
|
5
|
+
* The fields are the builder's `Config` as read at v0.130.0
|
|
6
|
+
* (`cmd/builder/internal/builder/config.go` in opentelemetry-collector):
|
|
7
|
+
* `dist`, a module list per component kind, `providers`,
|
|
8
|
+
* `converters`, `replaces`, `excludes` and `conf_resolver`. `telemetry`
|
|
9
|
+
* (v0.146.0) is not in it, and `otelcol_version`, removed in v0.113.0, is
|
|
10
|
+
* not either.
|
|
11
|
+
*
|
|
12
|
+
* A component list takes a module (`{ gomod, import?, name?, path? }`) or a
|
|
13
|
+
* component class. A built-in class writes its module at `COLLECTOR_PIN`
|
|
14
|
+
* (`OtlpReceiver` is `go.opentelemetry.io/collector/receiver/otlpreceiver
|
|
15
|
+
* v0.162.0`), and a `defineComponent` class writes its own pin's source and
|
|
16
|
+
* version, so the manifest names the same versions the config was typed
|
|
17
|
+
* against.
|
|
18
|
+
*
|
|
19
|
+
* The serializer writes the manifest as `builder-config.yaml` beside the
|
|
20
|
+
* collector config when a project declares a `Distribution`. OTEL128 then
|
|
21
|
+
* checks that the collector config uses only components the distribution
|
|
22
|
+
* builds. A project without one sees no change.
|
|
23
|
+
*/
|
|
24
|
+
import type { Declarable } from "@intentius/chant/declarable";
|
|
25
|
+
import { type ComponentClass, type ComponentDefinition } from "./define.js";
|
|
26
|
+
import { type CollectorConfig, type ComponentKind } from "./model.js";
|
|
27
|
+
import type { CollectorIssue } from "./validate-config.js";
|
|
28
|
+
export declare const DISTRIBUTION_TYPE = "OTel::Distribution";
|
|
29
|
+
/** Where the serializer writes the builder manifest, beside the collector config. */
|
|
30
|
+
export declare const DISTRIBUTION_MANIFEST_FILE = "builder-config.yaml";
|
|
31
|
+
/** A Go module the builder adds, as the manifest writes it. */
|
|
32
|
+
export interface DistributionModule {
|
|
33
|
+
/** The module and its version, as in `go.mod`: `github.com/acme/otel/exporter/acmeexporter v1.2.0`. */
|
|
34
|
+
gomod: string;
|
|
35
|
+
/** The Go import path, when it differs from the module path. */
|
|
36
|
+
import?: string;
|
|
37
|
+
/** The package name the generated code imports it as. */
|
|
38
|
+
name?: string;
|
|
39
|
+
/** A local path the module is replaced with. */
|
|
40
|
+
path?: string;
|
|
41
|
+
}
|
|
42
|
+
/** A component the distribution builds: a component class (built-in or `defineComponent`), or its module. */
|
|
43
|
+
export type DistributionComponent = ComponentClass<ComponentKind, string, any> | DistributionModule;
|
|
44
|
+
/** The `dist` section. */
|
|
45
|
+
export interface DistributionDist {
|
|
46
|
+
/** The Go module of the generated collector. */
|
|
47
|
+
module?: string;
|
|
48
|
+
/** The binary's name. */
|
|
49
|
+
name?: string;
|
|
50
|
+
/** The `go` binary to build with. */
|
|
51
|
+
go?: string;
|
|
52
|
+
/** The description `--help` prints. */
|
|
53
|
+
description?: string;
|
|
54
|
+
/** Where the generated sources and the binary go. */
|
|
55
|
+
output_path?: string;
|
|
56
|
+
/** The version the binary reports. */
|
|
57
|
+
version?: string;
|
|
58
|
+
/** Go build tags. */
|
|
59
|
+
build_tags?: string;
|
|
60
|
+
/** Build with debug symbols. */
|
|
61
|
+
debug_compilation?: boolean;
|
|
62
|
+
/** Build with cgo enabled. */
|
|
63
|
+
cgo_enabled?: boolean;
|
|
64
|
+
/** Write `replace` paths as absolute paths in the generated `go.mod`. */
|
|
65
|
+
use_absolute_replace_paths?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface DistributionProps {
|
|
68
|
+
dist: DistributionDist;
|
|
69
|
+
receivers?: DistributionComponent[];
|
|
70
|
+
processors?: DistributionComponent[];
|
|
71
|
+
exporters?: DistributionComponent[];
|
|
72
|
+
connectors?: DistributionComponent[];
|
|
73
|
+
extensions?: DistributionComponent[];
|
|
74
|
+
/** confmap providers (`env`, `file`, `http`, ...). The builder adds its defaults when none are listed. */
|
|
75
|
+
providers?: DistributionModule[];
|
|
76
|
+
/** confmap converters. */
|
|
77
|
+
converters?: DistributionModule[];
|
|
78
|
+
/** `replace` directives for the generated `go.mod`. */
|
|
79
|
+
replaces?: string[];
|
|
80
|
+
/** `exclude` directives for the generated `go.mod`. */
|
|
81
|
+
excludes?: string[];
|
|
82
|
+
conf_resolver?: {
|
|
83
|
+
default_uri_scheme?: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export interface DistributionEntity extends Declarable {
|
|
87
|
+
readonly props: DistributionProps;
|
|
88
|
+
}
|
|
89
|
+
/** A custom collector's builder manifest. Declare at most one per project. */
|
|
90
|
+
export declare const Distribution: new (props: DistributionProps) => DistributionEntity;
|
|
91
|
+
export declare function isDistributionEntity(value: unknown): value is DistributionEntity;
|
|
92
|
+
/**
|
|
93
|
+
* The Go module of every built-in, by `kind:type`. The core collector's
|
|
94
|
+
* components are in opentelemetry-collector, the rest in contrib; both are
|
|
95
|
+
* released at `COLLECTOR_PIN`'s version. A built-in added to `./components`
|
|
96
|
+
* needs a row here (distribution.test.ts checks).
|
|
97
|
+
*/
|
|
98
|
+
export declare const BUILTIN_MODULES: Readonly<Record<string, string>>;
|
|
99
|
+
/** The module a component class is built from, at the version its config type follows. */
|
|
100
|
+
export declare function componentModule(def: ComponentDefinition): DistributionModule;
|
|
101
|
+
/** The builder manifest a distribution writes, as the object `ocb --config` reads. */
|
|
102
|
+
export declare function distributionManifest(dist: DistributionEntity | DistributionProps): Record<string, unknown>;
|
|
103
|
+
/** The builder manifest as the YAML `ocb --config` reads. */
|
|
104
|
+
export declare function distributionYaml(dist: DistributionEntity | DistributionProps): string;
|
|
105
|
+
/**
|
|
106
|
+
* The component type a module builds, when it can be told: a built-in's
|
|
107
|
+
* module, or a module path ending `<type><kind>` as contrib's do
|
|
108
|
+
* (`.../exporter/datadogexporter` is `datadog`). Undefined otherwise.
|
|
109
|
+
*/
|
|
110
|
+
export declare function moduleComponentType(kind: ComponentKind, gomod: string): string | undefined;
|
|
111
|
+
/** What a distribution builds, per kind: the component types it names, and the modules whose type can't be told. */
|
|
112
|
+
export interface DistributionComponents {
|
|
113
|
+
types: Record<ComponentKind, Set<string>>;
|
|
114
|
+
unknown: Record<ComponentKind, string[]>;
|
|
115
|
+
}
|
|
116
|
+
export declare function distributionComponents(dist: DistributionEntity | DistributionProps): DistributionComponents;
|
|
117
|
+
/**
|
|
118
|
+
* OTEL128: the components `config` declares that `dist` does not build. A
|
|
119
|
+
* collector built from the distribution refuses such a config at start with
|
|
120
|
+
* "unknown type". When a kind lists a module whose type can't be told from
|
|
121
|
+
* its path, a missing component may be that module, so it is a warning
|
|
122
|
+
* naming the module rather than an error.
|
|
123
|
+
*/
|
|
124
|
+
export declare function distributionIssues(config: CollectorConfig, dist: DistributionEntity | DistributionProps): CollectorIssue[];
|
|
125
|
+
//# sourceMappingURL=distribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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