@intentius/chant-lexicon-otel 0.95.1 → 0.96.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/README.md +30 -9
- package/dist/catalog.d.ts +2 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/collector.d.ts +4 -1
- package/dist/collector.d.ts.map +1 -1
- package/dist/components/connectors.d.ts +156 -0
- package/dist/components/connectors.d.ts.map +1 -0
- package/dist/components/filtering.d.ts +95 -0
- package/dist/components/filtering.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/k8s-receivers.d.ts +74 -0
- package/dist/components/k8s-receivers.d.ts.map +1 -0
- package/dist/components/sampling.d.ts +260 -0
- package/dist/components/sampling.d.ts.map +1 -0
- package/dist/define.d.ts +31 -4
- package/dist/define.d.ts.map +1 -1
- package/dist/genai.d.ts +165 -0
- package/dist/genai.d.ts.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +8 -7
- package/dist/lint/audit-catalog.d.ts +2 -1
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/otel-helpers.d.ts +1 -1
- package/dist/lint/post-synth/otel-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/otel101.d.ts +1 -1
- package/dist/lint/post-synth/otel103.d.ts +1 -1
- package/dist/lint/post-synth/otel112.d.ts +8 -0
- package/dist/lint/post-synth/otel112.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +70 -0
- package/dist/metric-names.d.ts +121 -0
- package/dist/metric-names.d.ts.map +1 -0
- package/dist/model.d.ts +23 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/okf/index.md +15 -0
- package/dist/okf/rules/OTEL112.md +11 -0
- package/dist/okf/types/CountConnector.md +9 -0
- package/dist/okf/types/FilterProcessor.md +9 -0
- package/dist/okf/types/ForwardConnector.md +9 -0
- package/dist/okf/types/K8sClusterReceiver.md +9 -0
- package/dist/okf/types/KubeletStatsReceiver.md +9 -0
- package/dist/okf/types/LoadBalancingExporter.md +9 -0
- package/dist/okf/types/ProbabilisticSamplerProcessor.md +9 -0
- package/dist/okf/types/RedactionProcessor.md +9 -0
- package/dist/okf/types/RoutingConnector.md +9 -0
- package/dist/okf/types/ServiceGraphConnector.md +9 -0
- package/dist/okf/types/SpanMetricsConnector.md +9 -0
- package/dist/okf/types/SumConnector.md +9 -0
- package/dist/okf/types/TailSamplingProcessor.md +9 -0
- package/dist/okf/types/TransformProcessor.md +9 -0
- package/dist/pipeline.d.ts +9 -3
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/rules/otel-helpers.ts +1 -1
- package/dist/rules/otel101.ts +1 -1
- package/dist/rules/otel103.ts +1 -1
- package/dist/rules/otel112.ts +17 -0
- package/dist/semconv.d.ts +33 -0
- package/dist/semconv.d.ts.map +1 -0
- package/dist/serializer.d.ts +1 -1
- package/dist/skills/chant-otel.md +28 -5
- package/dist/topology.d.ts +34 -5
- package/dist/topology.d.ts.map +1 -1
- package/dist/validate-config.d.ts +6 -2
- package/dist/validate-config.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/catalog.ts +2 -1
- package/src/codegen/docs.ts +14 -8
- package/src/collector.ts +9 -1
- package/src/components/connectors.ts +276 -0
- package/src/components/filtering.test.ts +192 -0
- package/src/components/filtering.ts +192 -0
- package/src/components/index.ts +4 -0
- package/src/components/k8s-receivers.test.ts +123 -0
- package/src/components/k8s-receivers.ts +107 -0
- package/src/components/sampling.test.ts +464 -0
- package/src/components/sampling.ts +521 -0
- package/src/connectors.test.ts +388 -0
- package/src/define.ts +36 -4
- package/src/genai.test.ts +526 -0
- package/src/genai.ts +466 -0
- package/src/generated/lexicon-otel.json +70 -0
- package/src/index.ts +39 -0
- package/src/lint/audit-catalog.ts +11 -2
- package/src/lint/post-synth/index.ts +2 -0
- package/src/lint/post-synth/otel-helpers.ts +1 -1
- package/src/lint/post-synth/otel101.ts +1 -1
- package/src/lint/post-synth/otel103.ts +1 -1
- package/src/lint/post-synth/otel112.ts +17 -0
- package/src/metric-names.test.ts +80 -0
- package/src/metric-names.ts +176 -0
- package/src/model.ts +26 -4
- package/src/otelcol-validate.test.ts +143 -0
- package/src/pipeline.ts +9 -3
- package/src/plugin.test.ts +1 -0
- package/src/plugin.ts +1 -1
- package/src/semconv.ts +63 -0
- package/src/serializer.ts +1 -1
- package/src/skills/chant-otel.md +28 -5
- package/src/topology.ts +54 -8
- package/src/validate-config.ts +92 -4
- package/src/validate.ts +8 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @intentius/chant-lexicon-otel
|
|
2
2
|
|
|
3
|
-
OpenTelemetry Collector lexicon for [chant](https://github.com/INTENTIUS/chant): typed receivers, processors, exporters, extensions and pipelines, serialized to the collector YAML `otelcol --config` reads.
|
|
3
|
+
OpenTelemetry Collector lexicon for [chant](https://github.com/INTENTIUS/chant): typed receivers, processors, exporters, connectors, extensions and pipelines, serialized to the collector YAML `otelcol --config` reads.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { OtlpReceiver, BatchProcessor, OtlpExporter, Pipeline } from "@intentius/chant-lexicon-otel";
|
|
@@ -17,26 +17,46 @@ export { otlp, batch, backend, traces };
|
|
|
17
17
|
|
|
18
18
|
| Kind | Types |
|
|
19
19
|
|---|---|
|
|
20
|
-
| receivers | otlp, prometheus, hostmetrics, filelog |
|
|
21
|
-
| processors | batch, memory_limiter, resource, attributes, k8sattributes, resourcedetection |
|
|
22
|
-
| exporters | otlp, otlphttp, debug, prometheus, googlecloud |
|
|
20
|
+
| receivers | otlp, prometheus, hostmetrics, filelog, k8s_cluster, kubeletstats |
|
|
21
|
+
| processors | batch, memory_limiter, resource, attributes, k8sattributes, resourcedetection, filter, transform, redaction, tail_sampling, probabilistic_sampler |
|
|
22
|
+
| exporters | otlp, otlphttp, debug, prometheus, googlecloud, loadbalancing |
|
|
23
|
+
| connectors | spanmetrics, servicegraph, routing, forward, count, sum |
|
|
23
24
|
| extensions | health_check, pprof, zpages |
|
|
24
25
|
|
|
25
26
|
The config types follow the collector-contrib release in `COLLECTOR_PIN`.
|
|
26
27
|
|
|
28
|
+
## Connectors
|
|
29
|
+
|
|
30
|
+
A connector joins two pipelines: it is an exporter in the pipeline that feeds it and a receiver in the pipeline it feeds. Put the same entity on both sides.
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
const spanmetrics = new SpanMetricsConnector({ dimensions: [{ name: "http.route" }] });
|
|
34
|
+
|
|
35
|
+
export const traces = new Pipeline({ signal: "traces", receivers: [otlp], exporters: [backend, spanmetrics] });
|
|
36
|
+
export const red = new Pipeline({ signal: "metrics", name: "red", receivers: [spanmetrics], exporters: [prom] });
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Each connector supports fixed signal pairs (`spanmetrics`: traces to metrics). OTEL101 fails a connector listed on one side only, OTEL112 fails a pipeline whose signal the connector can't pair, and `collectorTopology()` reports each pipeline-to-pipeline hop in `edges`. A custom connector declares its pairs with `connects` in `defineComponent`.
|
|
40
|
+
|
|
41
|
+
`spanMetricsNames(connector)` returns the Prometheus names of a `spanmetrics` connector's metrics (`traces_span_metrics_calls_total` and so on), read from its namespace, dimensions and histogram unit, for queries and dashboards that should follow the declaration.
|
|
42
|
+
|
|
43
|
+
## GenAI preset
|
|
44
|
+
|
|
45
|
+
`genAiPipeline(options)` returns a collector for workloads that emit OpenTelemetry GenAI spans. Prompt, completion, system-instruction and tool-call content is deleted from spans, span events and log records unless `keepContent: true` is set, and every GenAI span becomes call, error, duration and token metrics before any sampling. The attribute keys follow `GENAI_SEMCONV_PIN` (semantic-conventions v1.41.1), which `collectorTopology()` returns under `semconv`. `genAiComponents()` gives the pieces for pipelines of your own, and `genAiMetrics()` the metric names a dashboard reads.
|
|
46
|
+
|
|
27
47
|
## Components chant doesn't ship
|
|
28
48
|
|
|
29
|
-
`defineComponent<Config>()({ kind, type, pin, validate?, endpoints? })` returns a class that serializes and lints like a built-in. `pin` records the schema source and version the config type follows; it is written as a `# chant:` comment above the emitted config and returned by `collectorTopology()`.
|
|
49
|
+
`defineComponent<Config>()({ kind, type, pin, validate?, endpoints?, connects? })` returns a class that serializes and lints like a built-in. `pin` records the schema source and version the config type follows; it is written as a `# chant:` comment above the emitted config and returned by `collectorTopology()`.
|
|
30
50
|
|
|
31
51
|
## Checks
|
|
32
52
|
|
|
33
|
-
OTEL001 and OTEL002 run on source (id syntax, literal credentials). OTEL101 to OTEL109 run after a build: undeclared or unused components, empty pipelines, extension wiring, `memory_limiter` placement, id syntax, each component's own config rules, duplicate ids
|
|
53
|
+
OTEL001 and OTEL002 run on source (id syntax, literal credentials). OTEL101 to OTEL109 and OTEL112 run after a build: undeclared or unused components (a connector must be on both sides), empty pipelines, extension wiring, `memory_limiter` placement, id syntax, each component's own config rules, duplicate ids, missing schema pins, and connector signal pairs.
|
|
34
54
|
|
|
35
55
|
## Plain-data API
|
|
36
56
|
|
|
37
57
|
- `collectorYaml(entities)` and `buildCollectorConfig(entities)` render a config inside another lexicon (the k8s `GkeOtelCollector` uses them).
|
|
38
58
|
- `validateCollectorConfig(config)` and `validateCollectorEntities(entities)` run the checks without a build.
|
|
39
|
-
- `collectorTopology(config)` and `collectorTopologyOf(entities)` return pipelines, endpoints, schema pins
|
|
59
|
+
- `collectorTopology(config)` and `collectorTopologyOf(entities)` return pipelines, endpoints, schema pins, the signals each exporter carries, the connector edges between pipelines, and the semantic-convention pins the config's attribute keys follow.
|
|
40
60
|
|
|
41
61
|
## Project structure
|
|
42
62
|
|
|
@@ -45,5 +65,6 @@ OTEL001 and OTEL002 run on source (id syntax, literal credentials). OTEL101 to O
|
|
|
45
65
|
- `src/pipeline.ts`: `Pipeline` and `Service`
|
|
46
66
|
- `src/collector.ts`, `src/yaml.ts`: entities to config to YAML
|
|
47
67
|
- `src/validate-config.ts`, `src/lint/`: checks
|
|
48
|
-
- `src/topology.ts`: the read surface
|
|
49
|
-
- `
|
|
68
|
+
- `src/topology.ts`, `src/semconv.ts`: the read surface
|
|
69
|
+
- `src/genai.ts`: the GenAI preset
|
|
70
|
+
- `examples/`: getting-started, k8s-node-agent, genai-agent, custom-component
|
package/dist/catalog.d.ts
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* completions and hover, and the docs.
|
|
5
5
|
*/
|
|
6
6
|
import type { LexiconEntry } from "@intentius/chant/lsp/lexicon-providers";
|
|
7
|
+
import type { ComponentKind } from "./model.js";
|
|
7
8
|
export interface CatalogEntry {
|
|
8
9
|
className: string;
|
|
9
10
|
entityType: string;
|
|
10
|
-
kind:
|
|
11
|
+
kind: ComponentKind | "pipeline" | "service";
|
|
11
12
|
/** The collector type, for components. */
|
|
12
13
|
type?: string;
|
|
13
14
|
description: string;
|
package/dist/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD,eAAO,MAAM,eAAe,EAAE,YAAY,EAsBzC,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAM9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqEH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB9E"}
|
package/dist/collector.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ import { type CollectorConfig } from "./model.js";
|
|
|
12
12
|
import { type PipelineEntity, type ServiceEntity } from "./pipeline.js";
|
|
13
13
|
export interface BuiltCollector {
|
|
14
14
|
config: CollectorConfig;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* One line per custom component naming its schema pin, and one per semconv
|
|
17
|
+
* vocabulary the config uses. Becomes the YAML's `# chant:` header.
|
|
18
|
+
*/
|
|
16
19
|
header: string[];
|
|
17
20
|
/** Non-fatal problems, e.g. two components declaring the same id. */
|
|
18
21
|
warnings: string[];
|
package/dist/collector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAc,KAAK,eAAe,EAAuB,MAAM,SAAS,CAAC;AAChF,OAAO,EAAwD,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAc,KAAK,eAAe,EAAuB,MAAM,SAAS,CAAC;AAChF,OAAO,EAAwD,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3H,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAuBD,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGjF;AAOD,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,cAAc,CAqF7G;AAED,yFAAyF;AACzF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAG9F"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in connectors: spanmetrics, servicegraph, routing, forward, count, sum.
|
|
3
|
+
*
|
|
4
|
+
* A connector is an exporter in one pipeline and a receiver in another. Put
|
|
5
|
+
* the same entity in `exporters` of the pipeline that feeds it and in
|
|
6
|
+
* `receivers` of the pipeline it feeds. `connects` lists the signal pairs each
|
|
7
|
+
* connector's factory registers; OTEL112 checks pipelines against them.
|
|
8
|
+
*/
|
|
9
|
+
import type { Duration } from "./common.js";
|
|
10
|
+
/** A span or resource attribute added as a metric dimension. */
|
|
11
|
+
export interface SpanMetricsDimension {
|
|
12
|
+
name: string;
|
|
13
|
+
/** Value used when the attribute is missing. Without it, spans lacking the attribute get no dimension. */
|
|
14
|
+
default?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SpanMetricsConnectorConfig {
|
|
17
|
+
/** Extra dimensions on every metric, beyond service.name, span.name, span.kind and status.code. */
|
|
18
|
+
dimensions?: SpanMetricsDimension[];
|
|
19
|
+
/** Extra dimensions on the calls metric only. */
|
|
20
|
+
calls_dimensions?: SpanMetricsDimension[];
|
|
21
|
+
/** Default dimensions to leave out. */
|
|
22
|
+
exclude_dimensions?: string[];
|
|
23
|
+
resource_metrics_cache_size?: number;
|
|
24
|
+
/** Resource attributes that key the metrics' resource, so a restart doesn't start a new series. */
|
|
25
|
+
resource_metrics_key_attributes?: string[];
|
|
26
|
+
aggregation_temporality?: "AGGREGATION_TEMPORALITY_CUMULATIVE" | "AGGREGATION_TEMPORALITY_DELTA";
|
|
27
|
+
histogram?: {
|
|
28
|
+
disable?: boolean;
|
|
29
|
+
unit?: "ms" | "s";
|
|
30
|
+
/** Explicit bucket boundaries. Set this or `exponential`, not both. */
|
|
31
|
+
explicit?: {
|
|
32
|
+
buckets?: Duration[];
|
|
33
|
+
};
|
|
34
|
+
exponential?: {
|
|
35
|
+
max_size?: number;
|
|
36
|
+
};
|
|
37
|
+
/** Extra dimensions on the duration histogram only. */
|
|
38
|
+
dimensions?: SpanMetricsDimension[];
|
|
39
|
+
};
|
|
40
|
+
/** How often metrics are emitted (default 60s). */
|
|
41
|
+
metrics_flush_interval?: Duration;
|
|
42
|
+
/** Drop a series not updated for this long. */
|
|
43
|
+
metrics_expiration?: Duration;
|
|
44
|
+
metric_timestamp_cache_size?: number;
|
|
45
|
+
/** Prefix for the emitted metric names (default `traces.span.metrics`). */
|
|
46
|
+
namespace?: string;
|
|
47
|
+
exemplars?: {
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
max_per_data_point?: number;
|
|
50
|
+
};
|
|
51
|
+
/** Also count span events. Needs `dimensions` when enabled. */
|
|
52
|
+
events?: {
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
dimensions?: SpanMetricsDimension[];
|
|
55
|
+
};
|
|
56
|
+
include_instrumentation_scope?: string[];
|
|
57
|
+
aggregation_cardinality_limit?: number;
|
|
58
|
+
}
|
|
59
|
+
/** Turns spans into request, error and duration (RED) metrics. */
|
|
60
|
+
export declare const SpanMetricsConnector: import("../index.js").ComponentClass<"connector", "spanmetrics", SpanMetricsConnectorConfig>;
|
|
61
|
+
export interface ServiceGraphConnectorConfig {
|
|
62
|
+
latency_histogram_buckets?: Duration[];
|
|
63
|
+
/** Span attributes added as dimensions on the edge metrics. */
|
|
64
|
+
dimensions?: string[];
|
|
65
|
+
/** How long an unpaired client or server span waits for its other half. */
|
|
66
|
+
store?: {
|
|
67
|
+
ttl?: Duration;
|
|
68
|
+
max_items?: number;
|
|
69
|
+
};
|
|
70
|
+
cache_loop?: Duration;
|
|
71
|
+
store_expiration_loop?: Duration;
|
|
72
|
+
/** Attributes that name the peer when only one side of a call is instrumented. */
|
|
73
|
+
virtual_node_peer_attributes?: string[];
|
|
74
|
+
virtual_node_extra_label?: boolean;
|
|
75
|
+
metrics_flush_interval?: Duration;
|
|
76
|
+
/** Attributes that name the database for a database call edge. */
|
|
77
|
+
database_name_attributes?: string[];
|
|
78
|
+
}
|
|
79
|
+
/** Builds service-to-service edge metrics from paired client and server spans. */
|
|
80
|
+
export declare const ServiceGraphConnector: import("../index.js").ComponentClass<"connector", "servicegraph", ServiceGraphConnectorConfig>;
|
|
81
|
+
export interface RoutingTableItem {
|
|
82
|
+
/** The OTTL context the condition runs in. `request` routes on request metadata such as headers. */
|
|
83
|
+
context?: "resource" | "span" | "metric" | "datapoint" | "log" | "request";
|
|
84
|
+
/** An OTTL `route() where ...` statement. Set this or `condition`, not both. */
|
|
85
|
+
statement?: string;
|
|
86
|
+
/** An OTTL condition. Set this or `statement`, not both. */
|
|
87
|
+
condition?: string;
|
|
88
|
+
/** Pipeline ids (`traces/tenant-a`) that receive matching data. Each must list this connector as a receiver. */
|
|
89
|
+
pipelines: string[];
|
|
90
|
+
}
|
|
91
|
+
export interface RoutingConnectorConfig {
|
|
92
|
+
table: RoutingTableItem[];
|
|
93
|
+
/** Pipelines for data no route matches. */
|
|
94
|
+
default_pipelines?: string[];
|
|
95
|
+
error_mode?: "ignore" | "silent" | "propagate";
|
|
96
|
+
}
|
|
97
|
+
/** Sends each item to the pipelines whose route matches it. */
|
|
98
|
+
export declare const RoutingConnector: import("../index.js").ComponentClass<"connector", "routing", RoutingConnectorConfig>;
|
|
99
|
+
export interface ForwardConnectorConfig {
|
|
100
|
+
}
|
|
101
|
+
/** Passes data unchanged from one pipeline to another of the same signal. */
|
|
102
|
+
export declare const ForwardConnector: import("../index.js").ComponentClass<"connector", "forward", ForwardConnectorConfig>;
|
|
103
|
+
export interface CountMetricInfo {
|
|
104
|
+
description?: string;
|
|
105
|
+
/** OTTL conditions; an item is counted when any matches. None counts every item. */
|
|
106
|
+
conditions?: string[];
|
|
107
|
+
/** Attributes to split the count by. Not supported for `metrics`. */
|
|
108
|
+
attributes?: Array<{
|
|
109
|
+
key: string;
|
|
110
|
+
default_value?: string | number | boolean;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
/** Each key is the name of a metric to emit. */
|
|
114
|
+
export interface CountConnectorConfig {
|
|
115
|
+
spans?: Record<string, CountMetricInfo>;
|
|
116
|
+
spanevents?: Record<string, CountMetricInfo>;
|
|
117
|
+
metrics?: Record<string, CountMetricInfo>;
|
|
118
|
+
datapoints?: Record<string, CountMetricInfo>;
|
|
119
|
+
logs?: Record<string, CountMetricInfo>;
|
|
120
|
+
profiles?: Record<string, CountMetricInfo>;
|
|
121
|
+
}
|
|
122
|
+
/** Counts spans, span events, metrics, data points or log records, as metrics. */
|
|
123
|
+
export declare const CountConnector: import("../index.js").ComponentClass<"connector", "count", CountConnectorConfig>;
|
|
124
|
+
export interface SumMetricInfo {
|
|
125
|
+
/** The attribute whose numeric value is summed. Strings that parse as numbers count; others are skipped. */
|
|
126
|
+
source_attribute: string;
|
|
127
|
+
description?: string;
|
|
128
|
+
/** OTTL conditions; an item is summed when any matches. None sums every item that has the attribute. */
|
|
129
|
+
conditions?: string[];
|
|
130
|
+
/**
|
|
131
|
+
* Attributes to split the sum by. Not supported for `metrics`. An item
|
|
132
|
+
* missing one of them is skipped unless it has a `default_value`. Use at
|
|
133
|
+
* most one: with more, the pinned collector adds each value once per
|
|
134
|
+
* attribute (OTEL107 reports it).
|
|
135
|
+
*/
|
|
136
|
+
attributes?: Array<{
|
|
137
|
+
key: string;
|
|
138
|
+
default_value?: string | number | boolean;
|
|
139
|
+
}>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Each key is the name of a metric to emit. The connector emits monotonic
|
|
143
|
+
* sums with delta temporality; the `prometheus` exporter accumulates them,
|
|
144
|
+
* while an exporter that needs cumulative input wants a `deltatocumulative`
|
|
145
|
+
* processor in front of it.
|
|
146
|
+
*/
|
|
147
|
+
export interface SumConnectorConfig {
|
|
148
|
+
spans?: Record<string, SumMetricInfo>;
|
|
149
|
+
spanevents?: Record<string, SumMetricInfo>;
|
|
150
|
+
metrics?: Record<string, SumMetricInfo>;
|
|
151
|
+
datapoints?: Record<string, SumMetricInfo>;
|
|
152
|
+
logs?: Record<string, SumMetricInfo>;
|
|
153
|
+
}
|
|
154
|
+
/** Sums a numeric attribute of spans, span events, data points or log records, as metrics. */
|
|
155
|
+
export declare const SumConnector: import("../index.js").ComponentClass<"connector", "sum", SumConnectorConfig>;
|
|
156
|
+
//# sourceMappingURL=connectors.d.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AC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;CAChF;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACtC;AAED,8FAA8F;AAC9F,eAAO,MAAM,YAAY,qEAoCvB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in processors that drop, rewrite or redact telemetry: filter,
|
|
3
|
+
* transform, redaction.
|
|
4
|
+
*
|
|
5
|
+
* `filter` and `transform` take OTTL. chant types the structure around it
|
|
6
|
+
* (which signal, which context, which list) and keeps each OTTL condition or
|
|
7
|
+
* statement as a string; the collector parses them when it loads the config.
|
|
8
|
+
*/
|
|
9
|
+
/** What an OTTL processor does when a condition or statement errors at run time. */
|
|
10
|
+
export type OttlErrorMode = "ignore" | "silent" | "propagate";
|
|
11
|
+
/** OTTL conditions per context. Telemetry matching any condition is dropped. */
|
|
12
|
+
export interface FilterProcessorConfig {
|
|
13
|
+
/** Default `propagate`: an erroring condition fails the batch. `ignore` logs and moves on. */
|
|
14
|
+
error_mode?: OttlErrorMode;
|
|
15
|
+
traces?: {
|
|
16
|
+
/** Drops the span, e.g. `attributes["http.route"] == "/healthz"`. */
|
|
17
|
+
span?: string[];
|
|
18
|
+
/** Drops the span event. */
|
|
19
|
+
spanevent?: string[];
|
|
20
|
+
};
|
|
21
|
+
metrics?: {
|
|
22
|
+
/** Drops the whole metric, e.g. `name == "http.server.duration" and type == METRIC_DATA_TYPE_HISTOGRAM`. */
|
|
23
|
+
metric?: string[];
|
|
24
|
+
/** Drops the data point. */
|
|
25
|
+
datapoint?: string[];
|
|
26
|
+
};
|
|
27
|
+
logs?: {
|
|
28
|
+
/** Drops the log record, e.g. `severity_number < SEVERITY_NUMBER_WARN`. */
|
|
29
|
+
log_record?: string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Drops spans, span events, metrics, data points and log records that match OTTL conditions. */
|
|
33
|
+
export declare const FilterProcessor: import("../index.js").ComponentClass<"processor", "filter", FilterProcessorConfig>;
|
|
34
|
+
/** OTTL contexts a trace statement group can run in. */
|
|
35
|
+
export type TraceStatementContext = "resource" | "scope" | "span" | "spanevent";
|
|
36
|
+
/** OTTL contexts a metric statement group can run in. */
|
|
37
|
+
export type MetricStatementContext = "resource" | "scope" | "metric" | "datapoint";
|
|
38
|
+
/** OTTL contexts a log statement group can run in. */
|
|
39
|
+
export type LogStatementContext = "resource" | "scope" | "log";
|
|
40
|
+
/**
|
|
41
|
+
* A group of OTTL statements run in one context. `conditions` gate every
|
|
42
|
+
* statement in the group; each statement may also carry its own `where`.
|
|
43
|
+
*/
|
|
44
|
+
export interface TransformStatementGroup<Ctx extends string = string> {
|
|
45
|
+
/** The OTTL context. Leave it out and the collector infers it from the paths the statements use. */
|
|
46
|
+
context?: Ctx;
|
|
47
|
+
conditions?: string[];
|
|
48
|
+
statements: string[];
|
|
49
|
+
/** Overrides the processor's `error_mode` for this group. */
|
|
50
|
+
error_mode?: OttlErrorMode;
|
|
51
|
+
}
|
|
52
|
+
/** Each entry is a group, or a bare statement whose context the collector infers. */
|
|
53
|
+
export type TransformStatements<Ctx extends string> = Array<string | TransformStatementGroup<Ctx>>;
|
|
54
|
+
export interface TransformProcessorConfig {
|
|
55
|
+
/** Default `propagate`. */
|
|
56
|
+
error_mode?: OttlErrorMode;
|
|
57
|
+
trace_statements?: TransformStatements<TraceStatementContext>;
|
|
58
|
+
metric_statements?: TransformStatements<MetricStatementContext>;
|
|
59
|
+
log_statements?: TransformStatements<LogStatementContext>;
|
|
60
|
+
}
|
|
61
|
+
/** Rewrites telemetry with OTTL statements, grouped per signal and context. */
|
|
62
|
+
export declare const TransformProcessor: import("../index.js").ComponentClass<"processor", "transform", TransformProcessorConfig>;
|
|
63
|
+
/**
|
|
64
|
+
* Attribute keys and values to keep, mask or hash. Applies to span, span
|
|
65
|
+
* event, log record and metric data point attributes (not resource
|
|
66
|
+
* attributes).
|
|
67
|
+
*
|
|
68
|
+
* Keys: with `allow_all_keys` false, any attribute whose key is not in
|
|
69
|
+
* `allowed_keys` or `ignored_keys` is deleted. Values: a value matching a
|
|
70
|
+
* `blocked_values` pattern, or any value of a key matching a
|
|
71
|
+
* `blocked_key_patterns` pattern, is masked with `****`, or replaced by its
|
|
72
|
+
* hash when `hash_function` is set; `allowed_values` exempts a value from
|
|
73
|
+
* masking. Patterns are Go (RE2) regular expressions.
|
|
74
|
+
*/
|
|
75
|
+
export interface RedactionProcessorConfig {
|
|
76
|
+
/** Keep every key, so only values are masked. Default false. */
|
|
77
|
+
allow_all_keys?: boolean;
|
|
78
|
+
/** The keys that survive when `allow_all_keys` is false. */
|
|
79
|
+
allowed_keys?: string[];
|
|
80
|
+
/** Keys never touched: not deleted, not masked. */
|
|
81
|
+
ignored_keys?: string[];
|
|
82
|
+
/** Regexes on keys; every value of a matching key is masked. */
|
|
83
|
+
blocked_key_patterns?: string[];
|
|
84
|
+
/** Regexes on values; the matching part is masked. */
|
|
85
|
+
blocked_values?: string[];
|
|
86
|
+
/** Regexes on values that are never masked, even when they match a blocked pattern. */
|
|
87
|
+
allowed_values?: string[];
|
|
88
|
+
/** Hash blocked values with this function instead of masking them. */
|
|
89
|
+
hash_function?: "md5" | "sha1" | "sha3";
|
|
90
|
+
/** How much the processor records about what it redacted, as span attributes. Default `info`. */
|
|
91
|
+
summary?: "debug" | "info" | "silent";
|
|
92
|
+
}
|
|
93
|
+
/** Deletes attributes whose keys aren't allowed, and masks or hashes values that match blocked patterns. */
|
|
94
|
+
export declare const RedactionProcessor: import("../index.js").ComponentClass<"processor", "redaction", RedactionProcessorConfig>;
|
|
95
|
+
//# sourceMappingURL=filtering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["../../src/components/filtering.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,oFAAoF;AACpF,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAI9D,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,8FAA8F;IAC9F,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE;QACP,qEAAqE;QACrE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,4BAA4B;QAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,4GAA4G;QAC5G,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,4BAA4B;QAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,2EAA2E;QAC3E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACH;AAED,iGAAiG;AACjG,eAAO,MAAM,eAAe,2EAuB1B,CAAC;AAIH,wDAAwD;AACxD,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;AAChF,yDAAyD;AACzD,MAAM,MAAM,sBAAsB,GAAG,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EAAE,CAAC;IAC1B,sEAAsE;IACtE,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC,iGAAiG;IACjG,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;CACvC;AAED,4GAA4G;AAC5G,eAAO,MAAM,kBAAkB,iFAwB7B,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from "./common.js";
|
|
2
2
|
export * from "./receivers.js";
|
|
3
|
+
export * from "./k8s-receivers.js";
|
|
3
4
|
export * from "./processors.js";
|
|
5
|
+
export * from "./filtering.js";
|
|
4
6
|
export * from "./exporters.js";
|
|
7
|
+
export * from "./connectors.js";
|
|
5
8
|
export * from "./extensions.js";
|
|
9
|
+
export * from "./sampling.js";
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Kubernetes receivers: k8s_cluster (cluster-level object metrics,
|
|
3
|
+
* one instance per cluster) and kubeletstats (node, pod and container
|
|
4
|
+
* resource metrics from each node's kubelet, one instance per node).
|
|
5
|
+
*/
|
|
6
|
+
import type { Duration } from "./common.js";
|
|
7
|
+
/** How a receiver authenticates to the Kubernetes API or the kubelet. */
|
|
8
|
+
export type K8sAuthType = "none" | "serviceAccount" | "kubeConfig" | "tls";
|
|
9
|
+
/** Turns one generated metric or resource attribute on or off. */
|
|
10
|
+
export interface MetricToggle {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type K8sAllocatableType = "cpu" | "memory" | "ephemeral-storage" | "storage" | "pods";
|
|
14
|
+
export type K8sNodeCondition = "Ready" | "MemoryPressure" | "DiskPressure" | "PIDPressure" | "NetworkUnavailable";
|
|
15
|
+
export interface K8sClusterReceiverConfig {
|
|
16
|
+
/** Default `serviceAccount`. */
|
|
17
|
+
auth_type?: K8sAuthType;
|
|
18
|
+
/** Default `10s`. */
|
|
19
|
+
collection_interval?: Duration;
|
|
20
|
+
/** Default `[Ready]`. */
|
|
21
|
+
node_conditions_to_report?: Array<K8sNodeCondition | (string & {})>;
|
|
22
|
+
allocatable_types_to_report?: K8sAllocatableType[];
|
|
23
|
+
/** Default `kubernetes`. `openshift` adds cluster quota metrics. */
|
|
24
|
+
distribution?: "kubernetes" | "openshift";
|
|
25
|
+
/** Exporter ids that receive entity metadata updates. */
|
|
26
|
+
metadata_exporters?: string[];
|
|
27
|
+
metadata_collection_interval?: Duration;
|
|
28
|
+
/** The id of a `k8s_leader_elector` extension, so only the leader among replicas collects. */
|
|
29
|
+
k8s_leader_elector?: string;
|
|
30
|
+
/** Watch one namespace instead of the whole cluster. */
|
|
31
|
+
namespace?: string;
|
|
32
|
+
metrics?: Record<string, MetricToggle>;
|
|
33
|
+
resource_attributes?: Record<string, MetricToggle>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Cluster-level metrics and entity events from the Kubernetes API. Run one
|
|
37
|
+
* instance per cluster (a single-replica Deployment, or behind
|
|
38
|
+
* `k8s_leader_elector`); on every node it reports each object once per node.
|
|
39
|
+
*/
|
|
40
|
+
export declare const K8sClusterReceiver: import("../index.js").ComponentClass<"receiver", "k8s_cluster", K8sClusterReceiverConfig>;
|
|
41
|
+
export type KubeletMetricGroup = "container" | "pod" | "node" | "volume";
|
|
42
|
+
export interface KubeletStatsReceiverConfig {
|
|
43
|
+
/** Default `10s`. */
|
|
44
|
+
collection_interval?: Duration;
|
|
45
|
+
initial_delay?: Duration;
|
|
46
|
+
/** Default `tls`, which needs `cert_file` and `key_file`. In a pod, use `serviceAccount`. */
|
|
47
|
+
auth_type?: K8sAuthType;
|
|
48
|
+
/** The kubelet, e.g. `https://${env:K8S_NODE_NAME}:10250`. */
|
|
49
|
+
endpoint?: string;
|
|
50
|
+
insecure_skip_verify?: boolean;
|
|
51
|
+
ca_file?: string;
|
|
52
|
+
cert_file?: string;
|
|
53
|
+
key_file?: string;
|
|
54
|
+
/** Default `[container, pod, node]`. */
|
|
55
|
+
metric_groups?: KubeletMetricGroup[];
|
|
56
|
+
/** Extra labels on container and volume metrics. */
|
|
57
|
+
extra_metadata_labels?: Array<"container.id" | "k8s.volume.type">;
|
|
58
|
+
/** Kubernetes API access, for persistent volume claim metadata. */
|
|
59
|
+
k8s_api_config?: {
|
|
60
|
+
auth_type: K8sAuthType;
|
|
61
|
+
context?: string;
|
|
62
|
+
};
|
|
63
|
+
/** The node name, for the limit and request utilization metrics; usually `${env:K8S_NODE_NAME}`. */
|
|
64
|
+
node?: string;
|
|
65
|
+
collect_all_network_interfaces?: {
|
|
66
|
+
pod?: boolean;
|
|
67
|
+
node?: boolean;
|
|
68
|
+
};
|
|
69
|
+
metrics?: Record<string, MetricToggle>;
|
|
70
|
+
resource_attributes?: Record<string, MetricToggle>;
|
|
71
|
+
}
|
|
72
|
+
/** Node, pod, container and volume resource metrics from the local kubelet. Run one instance per node. */
|
|
73
|
+
export declare const KubeletStatsReceiver: import("../index.js").ComponentClass<"receiver", "kubeletstats", KubeletStatsReceiverConfig>;
|
|
74
|
+
//# sourceMappingURL=k8s-receivers.d.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