@intentius/chant-lexicon-otel 0.124.46 → 0.124.48
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,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Built-in exporters: otlp, otlphttp, debug, prometheus, googlecloud.
|
|
2
|
+
* Built-in exporters: otlp, otlphttp, debug, prometheus, googlecloud, clickhouse.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { defineBuiltin } from "../define";
|
|
6
|
+
import type { Overlay, Require } from "./overlay";
|
|
7
|
+
import type { DebugExporterSchemaConfig, GoogleCloudExporterSchemaConfig, OtlpExporterSchemaConfig, OtlpHttpExporterSchemaConfig, PrometheusExporterSchemaConfig } from "../generated/index";
|
|
6
8
|
import { queueIssues } from "./common";
|
|
7
|
-
import type { Duration, ExporterHelperSettings
|
|
9
|
+
import type { Duration, ExporterHelperSettings } from "./common";
|
|
8
10
|
|
|
9
11
|
// ── otlp ─────────────────────────────────────────────────────────────
|
|
10
12
|
|
|
11
|
-
export type OtlpExporterConfig =
|
|
13
|
+
export type OtlpExporterConfig = OtlpExporterSchemaConfig;
|
|
12
14
|
|
|
13
15
|
/** Sends OTLP over gRPC to another collector or a backend. */
|
|
14
16
|
export const OtlpExporter = defineBuiltin<OtlpExporterConfig, "exporter", "otlp">({
|
|
@@ -22,13 +24,7 @@ export const OtlpExporter = defineBuiltin<OtlpExporterConfig, "exporter", "otlp"
|
|
|
22
24
|
|
|
23
25
|
// ── otlphttp ─────────────────────────────────────────────────────────
|
|
24
26
|
|
|
25
|
-
export type OtlpHttpExporterConfig =
|
|
26
|
-
ExporterHelperSettings & {
|
|
27
|
-
traces_endpoint?: string;
|
|
28
|
-
metrics_endpoint?: string;
|
|
29
|
-
logs_endpoint?: string;
|
|
30
|
-
encoding?: "proto" | "json";
|
|
31
|
-
};
|
|
27
|
+
export type OtlpHttpExporterConfig = OtlpHttpExporterSchemaConfig;
|
|
32
28
|
|
|
33
29
|
/** Sends OTLP over HTTP. `endpoint` gets `/v1/traces` etc. appended; the per-signal endpoints are used as given. */
|
|
34
30
|
export const OtlpHttpExporter = defineBuiltin<OtlpHttpExporterConfig, "exporter", "otlphttp">({
|
|
@@ -48,12 +44,7 @@ export const OtlpHttpExporter = defineBuiltin<OtlpHttpExporterConfig, "exporter"
|
|
|
48
44
|
|
|
49
45
|
// ── debug ────────────────────────────────────────────────────────────
|
|
50
46
|
|
|
51
|
-
export
|
|
52
|
-
verbosity?: "basic" | "normal" | "detailed";
|
|
53
|
-
sampling_initial?: number;
|
|
54
|
-
sampling_thereafter?: number;
|
|
55
|
-
use_internal_logger?: boolean;
|
|
56
|
-
}
|
|
47
|
+
export type DebugExporterConfig = DebugExporterSchemaConfig;
|
|
57
48
|
|
|
58
49
|
/** Writes telemetry to the collector's console, for debugging. */
|
|
59
50
|
export const DebugExporter = defineBuiltin<DebugExporterConfig, "exporter", "debug">({
|
|
@@ -65,18 +56,8 @@ export const DebugExporter = defineBuiltin<DebugExporterConfig, "exporter", "deb
|
|
|
65
56
|
|
|
66
57
|
// ── prometheus ───────────────────────────────────────────────────────
|
|
67
58
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
endpoint: string;
|
|
71
|
-
namespace?: string;
|
|
72
|
-
const_labels?: Record<string, string>;
|
|
73
|
-
send_timestamps?: boolean;
|
|
74
|
-
metric_expiration?: Duration;
|
|
75
|
-
enable_open_metrics?: boolean;
|
|
76
|
-
add_metric_suffixes?: boolean;
|
|
77
|
-
resource_to_telemetry_conversion?: { enabled: boolean };
|
|
78
|
-
tls?: TLSServerSettings;
|
|
79
|
-
}
|
|
59
|
+
/** The exporter has nothing to serve on without an endpoint. */
|
|
60
|
+
export type PrometheusExporterConfig = Require<PrometheusExporterSchemaConfig, "endpoint">;
|
|
80
61
|
|
|
81
62
|
/** Serves metrics on an endpoint Prometheus scrapes. */
|
|
82
63
|
export const PrometheusExporter = defineBuiltin<PrometheusExporterConfig, "exporter", "prometheus">({
|
|
@@ -94,39 +75,48 @@ export interface GoogleCloudResourceFilter {
|
|
|
94
75
|
regex?: string;
|
|
95
76
|
}
|
|
96
77
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The exporter embeds `collector.Config` from GoogleCloudPlatform's
|
|
80
|
+
* opentelemetry-operations-go, outside the collector repositories, so the
|
|
81
|
+
* schema carries only the exporterhelper fields. The rest is written here
|
|
82
|
+
* against that module's config.go.
|
|
83
|
+
*/
|
|
84
|
+
export type GoogleCloudExporterConfig = Overlay<
|
|
85
|
+
GoogleCloudExporterSchemaConfig,
|
|
86
|
+
{
|
|
87
|
+
/** The GCP project. Detected from credentials when omitted. */
|
|
88
|
+
project?: string;
|
|
89
|
+
user_agent?: string;
|
|
90
|
+
destination_project_quota?: boolean;
|
|
91
|
+
metric?: {
|
|
92
|
+
prefix?: string;
|
|
93
|
+
endpoint?: string;
|
|
94
|
+
use_insecure?: boolean;
|
|
95
|
+
known_domains?: string[];
|
|
96
|
+
skip_create_descriptor?: boolean;
|
|
97
|
+
instrumentation_library_labels?: boolean;
|
|
98
|
+
create_service_timeseries?: boolean;
|
|
99
|
+
create_metric_descriptor_buffer_size?: number;
|
|
100
|
+
service_resource_labels?: boolean;
|
|
101
|
+
resource_filters?: GoogleCloudResourceFilter[];
|
|
102
|
+
cumulative_normalization?: boolean;
|
|
103
|
+
sum_of_squared_deviation?: boolean;
|
|
104
|
+
};
|
|
105
|
+
trace?: {
|
|
106
|
+
endpoint?: string;
|
|
107
|
+
use_insecure?: boolean;
|
|
108
|
+
attribute_mappings?: Array<{ key: string; replacement: string }>;
|
|
109
|
+
};
|
|
110
|
+
log?: {
|
|
111
|
+
endpoint?: string;
|
|
112
|
+
use_insecure?: boolean;
|
|
113
|
+
default_log_name?: string;
|
|
114
|
+
resource_filters?: GoogleCloudResourceFilter[];
|
|
115
|
+
service_resource_labels?: boolean;
|
|
116
|
+
error_reporting_type?: boolean;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
>;
|
|
130
120
|
|
|
131
121
|
/**
|
|
132
122
|
* Sends traces to Cloud Trace, metrics to Cloud Monitoring and logs to Cloud
|
|
@@ -144,3 +134,80 @@ export const GoogleCloudExporter = defineBuiltin<GoogleCloudExporterConfig, "exp
|
|
|
144
134
|
return [`googlecloud://projects/${c.project ?? "(detected)"}`, ...overrides];
|
|
145
135
|
},
|
|
146
136
|
});
|
|
137
|
+
|
|
138
|
+
// ── clickhouse ───────────────────────────────────────────────────────
|
|
139
|
+
|
|
140
|
+
/** One metric type's table under `metrics_tables`. */
|
|
141
|
+
export interface ClickHouseMetricTable {
|
|
142
|
+
name?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The `clickhouse` exporter's config at contrib v0.130.0
|
|
147
|
+
* (`exporter/clickhouseexporter/config.go`). Stability there: traces and logs
|
|
148
|
+
* beta, metrics alpha.
|
|
149
|
+
*/
|
|
150
|
+
export interface ClickHouseExporterConfig extends ExporterHelperSettings {
|
|
151
|
+
/** The server, as a DSN URL: `tcp://clickhouse:9000`, `http://clickhouse:8123`, `https://...`. A path names the database. */
|
|
152
|
+
endpoint: string;
|
|
153
|
+
username?: string;
|
|
154
|
+
password?: string;
|
|
155
|
+
/** The database to write to (default `default`). Wins over the endpoint's database unless it is `default`. */
|
|
156
|
+
database?: string;
|
|
157
|
+
/** Extra DSN query parameters, such as `dial_timeout`. */
|
|
158
|
+
connection_params?: Record<string, string>;
|
|
159
|
+
/** Default `otel_logs`. */
|
|
160
|
+
logs_table_name?: string;
|
|
161
|
+
/** Default `otel_traces`. */
|
|
162
|
+
traces_table_name?: string;
|
|
163
|
+
/** @deprecated A prefix for the metric tables, read only when `metrics_tables` names none. Use `metrics_tables`. */
|
|
164
|
+
metrics_table_name?: string;
|
|
165
|
+
/** The table per metric type (defaults `otel_metrics_gauge`, `_sum`, `_summary`, `_histogram`, `_exponential_histogram`). */
|
|
166
|
+
metrics_tables?: {
|
|
167
|
+
gauge?: ClickHouseMetricTable;
|
|
168
|
+
sum?: ClickHouseMetricTable;
|
|
169
|
+
summary?: ClickHouseMetricTable;
|
|
170
|
+
histogram?: ClickHouseMetricTable;
|
|
171
|
+
exponential_histogram?: ClickHouseMetricTable;
|
|
172
|
+
};
|
|
173
|
+
/** How long rows are kept, as a Go duration (`72h`). Used only when the exporter creates the tables. 0 means no TTL. */
|
|
174
|
+
ttl?: Duration;
|
|
175
|
+
/** The engine of the tables the exporter creates (default `MergeTree()`). */
|
|
176
|
+
table_engine?: { name?: string; params?: string };
|
|
177
|
+
/** Adds `ON CLUSTER <name>` to the exporter's create statements. */
|
|
178
|
+
cluster_name?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Run the create statements for the database and tables at start (default
|
|
181
|
+
* true). The exporter's README advises false in production, with the schema
|
|
182
|
+
* managed elsewhere, such as the sql lexicon's `OtelTables`.
|
|
183
|
+
*/
|
|
184
|
+
create_schema?: boolean;
|
|
185
|
+
/** `none`, `zstd`, `lz4` (default), `gzip`, `deflate`, `br`, or `true` for lz4. */
|
|
186
|
+
compress?: "none" | "zstd" | "lz4" | "gzip" | "deflate" | "br" | "true";
|
|
187
|
+
/** Async inserts (default true), unless the endpoint or `connection_params` set them. */
|
|
188
|
+
async_insert?: boolean;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Writes traces, metrics and logs into ClickHouse tables. The tables it writes
|
|
193
|
+
* are the ones `ClickHouseExporterConfig` names; OTEL129 checks them against
|
|
194
|
+
* the tables a sql build in the same root declares.
|
|
195
|
+
*/
|
|
196
|
+
export const ClickHouseExporter = defineBuiltin<ClickHouseExporterConfig, "exporter", "clickhouse">({
|
|
197
|
+
kind: "exporter",
|
|
198
|
+
type: "clickhouse",
|
|
199
|
+
description: "Writes traces, metrics and logs into ClickHouse tables",
|
|
200
|
+
validate: (c) => {
|
|
201
|
+
const problems: string[] = [];
|
|
202
|
+
if (!c.endpoint) problems.push("endpoint is empty; the exporter requires it");
|
|
203
|
+
else if (!c.endpoint.includes("${")) {
|
|
204
|
+
try {
|
|
205
|
+
new URL(c.endpoint);
|
|
206
|
+
} catch {
|
|
207
|
+
problems.push(`endpoint ${c.endpoint} is not a URL; the exporter parses it as a DSN such as tcp://host:9000`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return [...problems, ...queueIssues(c)];
|
|
211
|
+
},
|
|
212
|
+
endpoints: (c) => (c.endpoint ? [c.endpoint] : []),
|
|
213
|
+
});
|
|
@@ -3,16 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { defineBuiltin } from "../define";
|
|
6
|
-
import {
|
|
7
|
-
import type {
|
|
6
|
+
import type { Overlay, Require } from "./overlay";
|
|
7
|
+
import type { HealthCheckExtensionSchemaConfig, K8sLeaderElectorExtensionSchemaConfig, PprofExtensionSchemaConfig, ZPagesExtensionSchemaConfig } from "../generated/index";
|
|
8
|
+
import { goDurationMs, type TLSServerSettings } from "./common";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The extension's config embeds contrib's `internal/healthcheck` Config, for
|
|
12
|
+
* which upstream publishes no schema, so its fields are written here against
|
|
13
|
+
* that package's config.go.
|
|
14
|
+
*/
|
|
15
|
+
export type HealthCheckExtensionConfig = Overlay<
|
|
16
|
+
HealthCheckExtensionSchemaConfig,
|
|
17
|
+
{
|
|
18
|
+
/** Default `localhost:13133`. */
|
|
19
|
+
endpoint?: string;
|
|
20
|
+
path?: string;
|
|
21
|
+
tls?: TLSServerSettings;
|
|
22
|
+
response_body?: { healthy?: string; unhealthy?: string };
|
|
23
|
+
}
|
|
24
|
+
>;
|
|
16
25
|
|
|
17
26
|
/** Serves an HTTP health endpoint for liveness and readiness probes. */
|
|
18
27
|
export const HealthCheckExtension = defineBuiltin<HealthCheckExtensionConfig, "extension", "health_check">({
|
|
@@ -22,13 +31,7 @@ export const HealthCheckExtension = defineBuiltin<HealthCheckExtensionConfig, "e
|
|
|
22
31
|
endpoints: (c) => [`${c.endpoint ?? "localhost:13133"}${c.path ?? "/"}`],
|
|
23
32
|
});
|
|
24
33
|
|
|
25
|
-
export
|
|
26
|
-
/** Default `localhost:1777`. */
|
|
27
|
-
endpoint?: string;
|
|
28
|
-
block_profile_fraction?: number;
|
|
29
|
-
mutex_profile_fraction?: number;
|
|
30
|
-
save_to_file?: string;
|
|
31
|
-
}
|
|
34
|
+
export type PprofExtensionConfig = PprofExtensionSchemaConfig;
|
|
32
35
|
|
|
33
36
|
/** Serves Go's net/http/pprof profiling endpoints. */
|
|
34
37
|
export const PprofExtension = defineBuiltin<PprofExtensionConfig, "extension", "pprof">({
|
|
@@ -38,10 +41,7 @@ export const PprofExtension = defineBuiltin<PprofExtensionConfig, "extension", "
|
|
|
38
41
|
endpoints: (c) => [c.endpoint ?? "localhost:1777"],
|
|
39
42
|
});
|
|
40
43
|
|
|
41
|
-
export
|
|
42
|
-
/** Default `localhost:55679`. */
|
|
43
|
-
endpoint?: string;
|
|
44
|
-
}
|
|
44
|
+
export type ZPagesExtensionConfig = ZPagesExtensionSchemaConfig;
|
|
45
45
|
|
|
46
46
|
/** Serves in-process zPages for live debugging of pipelines. */
|
|
47
47
|
export const ZPagesExtension = defineBuiltin<ZPagesExtensionConfig, "extension", "zpages">({
|
|
@@ -60,22 +60,8 @@ export const ZPagesExtension = defineBuiltin<ZPagesExtensionConfig, "extension",
|
|
|
60
60
|
// Upstream marks it alpha. It ships in the otelcol-contrib and otelcol-k8s
|
|
61
61
|
// distributions at v0.130.0.
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
auth_type?: K8sAuthType;
|
|
66
|
-
/** With `auth_type: kubeConfig`, the kubeconfig context to use instead of the current one. */
|
|
67
|
-
context?: string;
|
|
68
|
-
/** The Lease object the replicas compete for. Required. */
|
|
69
|
-
lease_name: string;
|
|
70
|
-
/** The namespace of the Lease. Required. */
|
|
71
|
-
lease_namespace: string;
|
|
72
|
-
/** How long a lease is held without renewal. Default `15s`. */
|
|
73
|
-
lease_duration?: Duration;
|
|
74
|
-
/** How long the leader keeps retrying a renewal before giving up the lease; less than `lease_duration`. Default `10s`. */
|
|
75
|
-
renew_deadline?: Duration;
|
|
76
|
-
/** How long to wait between attempts to acquire or renew. Default `2s`. */
|
|
77
|
-
retry_period?: Duration;
|
|
78
|
-
}
|
|
63
|
+
/** The extension refuses to start without the Lease's name and namespace. */
|
|
64
|
+
export type K8sLeaderElectorExtensionConfig = Require<K8sLeaderElectorExtensionSchemaConfig, "lease_name" | "lease_namespace">;
|
|
79
65
|
|
|
80
66
|
/**
|
|
81
67
|
* Elects one leader among collector replicas through a Kubernetes Lease, so a
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { defineBuiltin } from "../define";
|
|
11
|
-
import type {
|
|
11
|
+
import type { Overlay } from "./overlay";
|
|
12
|
+
import type { FilterProcessorSchemaConfig, RedactionProcessorSchemaConfig, TransformProcessorSchemaConfig } from "../generated/index";
|
|
12
13
|
|
|
13
14
|
/** What an OTTL processor does when a condition or statement errors at run time. */
|
|
14
15
|
export type OttlErrorMode = "ignore" | "silent" | "propagate";
|
|
@@ -58,38 +59,7 @@ export interface FilterLogMatch {
|
|
|
58
59
|
* match blocks (for traces, the legacy blocks sit under `spans`), not both:
|
|
59
60
|
* the collector rejects a signal that mixes them.
|
|
60
61
|
*/
|
|
61
|
-
export
|
|
62
|
-
/** Default `propagate`: an erroring condition fails the batch. `ignore` logs and moves on. */
|
|
63
|
-
error_mode?: OttlErrorMode;
|
|
64
|
-
traces?: {
|
|
65
|
-
/** Drops the span, e.g. `attributes["http.route"] == "/healthz"`. */
|
|
66
|
-
span?: string[];
|
|
67
|
-
/** Drops the span event. */
|
|
68
|
-
spanevent?: string[];
|
|
69
|
-
};
|
|
70
|
-
/** Legacy span matching. With `include`, spans that do not match are dropped; with `exclude`, spans that match. */
|
|
71
|
-
spans?: { include?: AttributesMatch; exclude?: AttributesMatch };
|
|
72
|
-
metrics?: {
|
|
73
|
-
/** Drops the whole metric, e.g. `name == "http.server.duration" and type == METRIC_DATA_TYPE_HISTOGRAM`. */
|
|
74
|
-
metric?: string[];
|
|
75
|
-
/** Drops the data point. */
|
|
76
|
-
datapoint?: string[];
|
|
77
|
-
/** Legacy: keeps only the metrics that match. */
|
|
78
|
-
include?: FilterMetricMatch;
|
|
79
|
-
/** Legacy: drops the metrics that match. */
|
|
80
|
-
exclude?: FilterMetricMatch;
|
|
81
|
-
/** Legacy: options for the `regexp` match type. */
|
|
82
|
-
regexp?: FilterRegexpSettings;
|
|
83
|
-
};
|
|
84
|
-
logs?: {
|
|
85
|
-
/** Drops the log record, e.g. `severity_number < SEVERITY_NUMBER_WARN`. */
|
|
86
|
-
log_record?: string[];
|
|
87
|
-
/** Legacy: keeps only the log records that match. */
|
|
88
|
-
include?: FilterLogMatch;
|
|
89
|
-
/** Legacy: drops the log records that match. */
|
|
90
|
-
exclude?: FilterLogMatch;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
62
|
+
export type FilterProcessorConfig = FilterProcessorSchemaConfig;
|
|
93
63
|
|
|
94
64
|
/** Drops spans, span events, metrics, data points and log records that match OTTL conditions. */
|
|
95
65
|
export const FilterProcessor = defineBuiltin<FilterProcessorConfig, "processor", "filter">({
|
|
@@ -150,13 +120,19 @@ export interface TransformStatementGroup<Ctx extends string = string> {
|
|
|
150
120
|
/** Each entry is a group, or a bare statement whose context the collector infers. */
|
|
151
121
|
export type TransformStatements<Ctx extends string> = Array<string | TransformStatementGroup<Ctx>>;
|
|
152
122
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
123
|
+
/**
|
|
124
|
+
* A statement list also takes bare statement strings, which upstream's
|
|
125
|
+
* custom unmarshaller accepts and its schema does not show; each list is
|
|
126
|
+
* typed here for the contexts its signal allows.
|
|
127
|
+
*/
|
|
128
|
+
export type TransformProcessorConfig = Overlay<
|
|
129
|
+
TransformProcessorSchemaConfig,
|
|
130
|
+
{
|
|
131
|
+
trace_statements?: TransformStatements<TraceStatementContext>;
|
|
132
|
+
metric_statements?: TransformStatements<MetricStatementContext>;
|
|
133
|
+
log_statements?: TransformStatements<LogStatementContext>;
|
|
134
|
+
}
|
|
135
|
+
>;
|
|
160
136
|
|
|
161
137
|
const TRANSFORM_CONTEXTS: Record<"trace_statements" | "metric_statements" | "log_statements", readonly string[]> = {
|
|
162
138
|
trace_statements: ["resource", "scope", "span", "spanevent"],
|
|
@@ -208,24 +184,7 @@ export const TransformProcessor = defineBuiltin<TransformProcessorConfig, "proce
|
|
|
208
184
|
* hash when `hash_function` is set; `allowed_values` exempts a value from
|
|
209
185
|
* masking. Patterns are Go (RE2) regular expressions.
|
|
210
186
|
*/
|
|
211
|
-
export
|
|
212
|
-
/** Keep every key, so only values are masked. Default false. */
|
|
213
|
-
allow_all_keys?: boolean;
|
|
214
|
-
/** The keys that survive when `allow_all_keys` is false. */
|
|
215
|
-
allowed_keys?: string[];
|
|
216
|
-
/** Keys never touched: not deleted, not masked. */
|
|
217
|
-
ignored_keys?: string[];
|
|
218
|
-
/** Regexes on keys; every value of a matching key is masked. */
|
|
219
|
-
blocked_key_patterns?: string[];
|
|
220
|
-
/** Regexes on values; the matching part is masked. */
|
|
221
|
-
blocked_values?: string[];
|
|
222
|
-
/** Regexes on values that are never masked, even when they match a blocked pattern. */
|
|
223
|
-
allowed_values?: string[];
|
|
224
|
-
/** Hash blocked values with this function instead of masking them. */
|
|
225
|
-
hash_function?: "md5" | "sha1" | "sha3";
|
|
226
|
-
/** How much the processor records about what it redacted, as span attributes. Default `info`. */
|
|
227
|
-
summary?: "debug" | "info" | "silent";
|
|
228
|
-
}
|
|
187
|
+
export type RedactionProcessorConfig = RedactionProcessorSchemaConfig;
|
|
229
188
|
|
|
230
189
|
/** Deletes attributes whose keys aren't allowed, and masks or hashes values that match blocked patterns. */
|
|
231
190
|
export const RedactionProcessor = defineBuiltin<RedactionProcessorConfig, "processor", "redaction">({
|
|
@@ -72,7 +72,7 @@ receivers:
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
test("an unknown distribution is reported", () => {
|
|
75
|
-
//
|
|
75
|
+
// The schema types `distribution` as a string; the check names the two values.
|
|
76
76
|
expect(problems(new K8sClusterReceiver({ distribution: "eks" }))).toEqual([
|
|
77
77
|
'distribution "eks" is not kubernetes or openshift',
|
|
78
78
|
]);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { defineBuiltin } from "../define";
|
|
8
|
-
import type {
|
|
8
|
+
import type { K8sClusterReceiverSchemaConfig, KubeletStatsReceiverSchemaConfig } from "../generated/index";
|
|
9
9
|
|
|
10
10
|
/** How a receiver authenticates to the Kubernetes API or the kubelet. */
|
|
11
11
|
export type K8sAuthType = "none" | "serviceAccount" | "kubeConfig" | "tls";
|
|
@@ -21,26 +21,7 @@ export type K8sAllocatableType = "cpu" | "memory" | "ephemeral-storage" | "stora
|
|
|
21
21
|
|
|
22
22
|
export type K8sNodeCondition = "Ready" | "MemoryPressure" | "DiskPressure" | "PIDPressure" | "NetworkUnavailable";
|
|
23
23
|
|
|
24
|
-
export
|
|
25
|
-
/** Default `serviceAccount`. */
|
|
26
|
-
auth_type?: K8sAuthType;
|
|
27
|
-
/** Default `10s`. */
|
|
28
|
-
collection_interval?: Duration;
|
|
29
|
-
/** Default `[Ready]`. */
|
|
30
|
-
node_conditions_to_report?: Array<K8sNodeCondition | (string & {})>;
|
|
31
|
-
allocatable_types_to_report?: K8sAllocatableType[];
|
|
32
|
-
/** Default `kubernetes`. `openshift` adds cluster quota metrics. */
|
|
33
|
-
distribution?: "kubernetes" | "openshift";
|
|
34
|
-
/** Exporter ids that receive entity metadata updates. */
|
|
35
|
-
metadata_exporters?: string[];
|
|
36
|
-
metadata_collection_interval?: Duration;
|
|
37
|
-
/** The id of a `k8s_leader_elector` extension, so only the leader among replicas collects. */
|
|
38
|
-
k8s_leader_elector?: string;
|
|
39
|
-
/** Watch one namespace instead of the whole cluster. */
|
|
40
|
-
namespace?: string;
|
|
41
|
-
metrics?: Record<string, MetricToggle>;
|
|
42
|
-
resource_attributes?: Record<string, MetricToggle>;
|
|
43
|
-
}
|
|
24
|
+
export type K8sClusterReceiverConfig = K8sClusterReceiverSchemaConfig;
|
|
44
25
|
|
|
45
26
|
/**
|
|
46
27
|
* Cluster-level metrics and entity events from the Kubernetes API. Run one
|
|
@@ -61,30 +42,7 @@ export const K8sClusterReceiver = defineBuiltin<K8sClusterReceiverConfig, "recei
|
|
|
61
42
|
|
|
62
43
|
export type KubeletMetricGroup = "container" | "pod" | "node" | "volume";
|
|
63
44
|
|
|
64
|
-
export
|
|
65
|
-
/** Default `10s`. */
|
|
66
|
-
collection_interval?: Duration;
|
|
67
|
-
initial_delay?: Duration;
|
|
68
|
-
/** Default `tls`, which needs `cert_file` and `key_file`. In a pod, use `serviceAccount`. */
|
|
69
|
-
auth_type?: K8sAuthType;
|
|
70
|
-
/** The kubelet, e.g. `https://${env:K8S_NODE_NAME}:10250`. */
|
|
71
|
-
endpoint?: string;
|
|
72
|
-
insecure_skip_verify?: boolean;
|
|
73
|
-
ca_file?: string;
|
|
74
|
-
cert_file?: string;
|
|
75
|
-
key_file?: string;
|
|
76
|
-
/** Default `[container, pod, node]`. */
|
|
77
|
-
metric_groups?: KubeletMetricGroup[];
|
|
78
|
-
/** Extra labels on container and volume metrics. */
|
|
79
|
-
extra_metadata_labels?: Array<"container.id" | "k8s.volume.type">;
|
|
80
|
-
/** Kubernetes API access, for persistent volume claim metadata. */
|
|
81
|
-
k8s_api_config?: { auth_type: K8sAuthType; context?: string };
|
|
82
|
-
/** The node name, for the limit and request utilization metrics; usually `${env:K8S_NODE_NAME}`. */
|
|
83
|
-
node?: string;
|
|
84
|
-
collect_all_network_interfaces?: { pod?: boolean; node?: boolean };
|
|
85
|
-
metrics?: Record<string, MetricToggle>;
|
|
86
|
-
resource_attributes?: Record<string, MetricToggle>;
|
|
87
|
-
}
|
|
45
|
+
export type KubeletStatsReceiverConfig = KubeletStatsReceiverSchemaConfig;
|
|
88
46
|
|
|
89
47
|
/** Node, pod, container and volume resource metrics from the local kubelet. Run one instance per node. */
|
|
90
48
|
export const KubeletStatsReceiver = defineBuiltin<KubeletStatsReceiverConfig, "receiver", "kubeletstats">({
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a built-in's hand-written definition adds to its generated config type
|
|
3
|
+
* (#3361).
|
|
4
|
+
*
|
|
5
|
+
* The config types come from upstream `config.schema.yaml`
|
|
6
|
+
* (`src/generated/index.ts`). A schema cannot say everything the component
|
|
7
|
+
* needs, so a `defineBuiltin` file may overlay the generated type, and only
|
|
8
|
+
* for one of these reasons, stated where it is used:
|
|
9
|
+
*
|
|
10
|
+
* - upstream publishes no schema for a `$ref`, so the generated field is
|
|
11
|
+
* `unknown` (the health_check extension, hostmetrics' scrapers, the filter
|
|
12
|
+
* processor's conditions);
|
|
13
|
+
* - the field is a tagged union upstream writes as a struct of optional
|
|
14
|
+
* members, and the component's checks narrow on the tag (tail_sampling's
|
|
15
|
+
* policies, signaltometrics' metric types);
|
|
16
|
+
* - the component cannot start without the field. `schemagen` writes no
|
|
17
|
+
* `required`, so {@link Require} restores it.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** `S` with the keys of `O` replaced by `O`'s. */
|
|
21
|
+
export type Overlay<S, O> = Omit<S, keyof O> & O;
|
|
22
|
+
|
|
23
|
+
/** `S` with keys `K` required. */
|
|
24
|
+
export type Require<S, K extends keyof S> = Omit<S, K> & { [P in K]-?: Exclude<S[P], undefined> };
|
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { defineBuiltin } from "../define";
|
|
7
|
-
import
|
|
7
|
+
import type { Require } from "./overlay";
|
|
8
|
+
import type { AttributesProcessorSchemaConfig, BatchProcessorSchemaConfig, DeltaToCumulativeProcessorSchemaConfig, K8sAttributesProcessorSchemaConfig, MemoryLimiterProcessorSchemaConfig, ResourceDetectionProcessorSchemaConfig, ResourceProcessorSchemaConfig } from "../generated/index";
|
|
9
|
+
import { goDurationMs } from "./common";
|
|
10
|
+
|
|
11
|
+
/** One entry of `actions` (attributes) or `attributes` (resource), as upstream's `attraction.ActionKeyValue` types it. */
|
|
12
|
+
export type AttributeActionConfig = NonNullable<AttributesProcessorSchemaConfig["actions"]>[number];
|
|
8
13
|
|
|
9
14
|
// ── batch ────────────────────────────────────────────────────────────
|
|
10
15
|
|
|
11
|
-
export
|
|
12
|
-
timeout?: Duration;
|
|
13
|
-
send_batch_size?: number;
|
|
14
|
-
send_batch_max_size?: number;
|
|
15
|
-
metadata_keys?: string[];
|
|
16
|
-
metadata_cardinality_limit?: number;
|
|
17
|
-
}
|
|
16
|
+
export type BatchProcessorConfig = BatchProcessorSchemaConfig;
|
|
18
17
|
|
|
19
18
|
/** Batches telemetry before export, to cut request count and compress better. */
|
|
20
19
|
export const BatchProcessor = defineBuiltin<BatchProcessorConfig, "processor", "batch">({
|
|
@@ -29,13 +28,8 @@ export const BatchProcessor = defineBuiltin<BatchProcessorConfig, "processor", "
|
|
|
29
28
|
|
|
30
29
|
// ── memory_limiter ───────────────────────────────────────────────────
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
limit_mib?: number;
|
|
35
|
-
spike_limit_mib?: number;
|
|
36
|
-
limit_percentage?: number;
|
|
37
|
-
spike_limit_percentage?: number;
|
|
38
|
-
}
|
|
31
|
+
/** With no `check_interval` the limiter never measures, so chant asks for it. */
|
|
32
|
+
export type MemoryLimiterProcessorConfig = Require<MemoryLimiterProcessorSchemaConfig, "check_interval">;
|
|
39
33
|
|
|
40
34
|
/** Refuses data when the collector nears its memory limit. Belongs first in every pipeline. */
|
|
41
35
|
export const MemoryLimiterProcessor = defineBuiltin<MemoryLimiterProcessorConfig, "processor", "memory_limiter">({
|
|
@@ -59,9 +53,8 @@ export const MemoryLimiterProcessor = defineBuiltin<MemoryLimiterProcessorConfig
|
|
|
59
53
|
|
|
60
54
|
// ── resource ─────────────────────────────────────────────────────────
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
56
|
+
/** The processor refuses to start with no actions. */
|
|
57
|
+
export type ResourceProcessorConfig = Require<ResourceProcessorSchemaConfig, "attributes">;
|
|
65
58
|
|
|
66
59
|
/** Inserts, updates or deletes resource attributes. */
|
|
67
60
|
export const ResourceProcessor = defineBuiltin<ResourceProcessorConfig, "processor", "resource">({
|
|
@@ -89,11 +82,8 @@ export interface AttributesMatch {
|
|
|
89
82
|
libraries?: Array<{ name: string; version?: string }>;
|
|
90
83
|
}
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
include?: AttributesMatch;
|
|
95
|
-
exclude?: AttributesMatch;
|
|
96
|
-
}
|
|
85
|
+
/** The processor refuses to start with no actions. */
|
|
86
|
+
export type AttributesProcessorConfig = Require<AttributesProcessorSchemaConfig, "actions">;
|
|
97
87
|
|
|
98
88
|
/** Inserts, updates, hashes or deletes span, log and metric attributes. */
|
|
99
89
|
export const AttributesProcessor = defineBuiltin<AttributesProcessorConfig, "processor", "attributes">({
|
|
@@ -103,7 +93,7 @@ export const AttributesProcessor = defineBuiltin<AttributesProcessorConfig, "pro
|
|
|
103
93
|
validate: (c) => actionProblems(c.actions, "actions"),
|
|
104
94
|
});
|
|
105
95
|
|
|
106
|
-
function actionProblems(actions:
|
|
96
|
+
function actionProblems(actions: ReadonlyArray<AttributeActionConfig> | undefined, field: string): string[] {
|
|
107
97
|
if (!actions || actions.length === 0) return [`${field} is empty, so the processor changes nothing`];
|
|
108
98
|
const problems: string[] = [];
|
|
109
99
|
actions.forEach((a, i) => {
|
|
@@ -136,27 +126,7 @@ export interface K8sPodAssociationSource {
|
|
|
136
126
|
name?: string;
|
|
137
127
|
}
|
|
138
128
|
|
|
139
|
-
export
|
|
140
|
-
auth_type?: "none" | "serviceAccount" | "kubeConfig" | "tls";
|
|
141
|
-
passthrough?: boolean;
|
|
142
|
-
filter?: {
|
|
143
|
-
node?: string;
|
|
144
|
-
node_from_env_var?: string;
|
|
145
|
-
namespace?: string;
|
|
146
|
-
fields?: Array<{ key: string; value: string; op?: "equals" | "not-equals" }>;
|
|
147
|
-
labels?: Array<{ key: string; value: string; op?: "equals" | "not-equals" | "exists" | "does-not-exist" }>;
|
|
148
|
-
};
|
|
149
|
-
extract?: {
|
|
150
|
-
metadata?: string[];
|
|
151
|
-
labels?: K8sFieldExtract[];
|
|
152
|
-
annotations?: K8sFieldExtract[];
|
|
153
|
-
otel_annotations?: boolean;
|
|
154
|
-
};
|
|
155
|
-
pod_association?: Array<{ sources: K8sPodAssociationSource[] }>;
|
|
156
|
-
exclude?: { pods?: Array<{ name: string }> };
|
|
157
|
-
wait_for_metadata?: boolean;
|
|
158
|
-
wait_for_metadata_timeout?: Duration;
|
|
159
|
-
}
|
|
129
|
+
export type K8sAttributesProcessorConfig = K8sAttributesProcessorSchemaConfig;
|
|
160
130
|
|
|
161
131
|
/** Adds Kubernetes pod, namespace and node metadata to telemetry. */
|
|
162
132
|
export const K8sAttributesProcessor = defineBuiltin<K8sAttributesProcessorConfig, "processor", "k8sattributes">({
|
|
@@ -186,18 +156,8 @@ export type ResourceDetector =
|
|
|
186
156
|
| "kubeadm"
|
|
187
157
|
| "dynatrace";
|
|
188
158
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
timeout?: Duration;
|
|
192
|
-
override?: boolean;
|
|
193
|
-
/** Per-detector settings, e.g. `system: { hostname_sources: ["os"] }`. */
|
|
194
|
-
system?: Record<string, unknown>;
|
|
195
|
-
ec2?: Record<string, unknown>;
|
|
196
|
-
gcp?: Record<string, unknown>;
|
|
197
|
-
azure?: Record<string, unknown>;
|
|
198
|
-
k8snode?: Record<string, unknown>;
|
|
199
|
-
docker?: Record<string, unknown>;
|
|
200
|
-
}
|
|
159
|
+
/** With no detectors the processor detects nothing, so chant asks for the list. */
|
|
160
|
+
export type ResourceDetectionProcessorConfig = Require<ResourceDetectionProcessorSchemaConfig, "detectors">;
|
|
201
161
|
|
|
202
162
|
/** Detects the host's resource attributes (cloud, container, host) and adds them. */
|
|
203
163
|
export const ResourceDetectionProcessor = defineBuiltin<
|
|
@@ -221,12 +181,7 @@ export const ResourceDetectionProcessor = defineBuiltin<
|
|
|
221
181
|
// total in memory, so one collector instance must see all of a stream's
|
|
222
182
|
// deltas for its totals to be right.
|
|
223
183
|
|
|
224
|
-
export
|
|
225
|
-
/** How long a stream that receives no samples is kept before it is dropped. Positive. Default `5m`. */
|
|
226
|
-
max_stale?: Duration;
|
|
227
|
-
/** The most streams tracked at once; samples of new streams past it are dropped. Not negative. Default unlimited. */
|
|
228
|
-
max_streams?: number;
|
|
229
|
-
}
|
|
184
|
+
export type DeltaToCumulativeProcessorConfig = DeltaToCumulativeProcessorSchemaConfig;
|
|
230
185
|
|
|
231
186
|
/**
|
|
232
187
|
* Turns delta metrics into cumulative ones by keeping a running total per
|