@intentius/chant-lexicon-otel 0.106.4 → 0.108.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +1 -1
  2. package/dist/collector.d.ts +6 -0
  3. package/dist/collector.d.ts.map +1 -1
  4. package/dist/composites/catalog.d.ts.map +1 -1
  5. package/dist/composites/genai-pipeline.d.ts +33 -0
  6. package/dist/composites/genai-pipeline.d.ts.map +1 -0
  7. package/dist/composites/index.d.ts +8 -0
  8. package/dist/composites/index.d.ts.map +1 -1
  9. package/dist/composites/otlp-collector.d.ts +43 -0
  10. package/dist/composites/otlp-collector.d.ts.map +1 -0
  11. package/dist/composites/red-metrics.d.ts +77 -0
  12. package/dist/composites/red-metrics.d.ts.map +1 -0
  13. package/dist/composites/tail-sampling-tier.d.ts +90 -0
  14. package/dist/composites/tail-sampling-tier.d.ts.map +1 -0
  15. package/dist/configmap.d.ts +16 -0
  16. package/dist/configmap.d.ts.map +1 -1
  17. package/dist/genai.d.ts +19 -0
  18. package/dist/genai.d.ts.map +1 -1
  19. package/dist/import/embedded.d.ts +8 -0
  20. package/dist/import/embedded.d.ts.map +1 -1
  21. package/dist/index.d.ts +8 -5
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/integrity.json +3 -3
  24. package/dist/lint/post-synth/otel-helpers.d.ts +9 -2
  25. package/dist/lint/post-synth/otel-helpers.d.ts.map +1 -1
  26. package/dist/manifest.json +1 -1
  27. package/dist/metric-names.d.ts +68 -0
  28. package/dist/metric-names.d.ts.map +1 -1
  29. package/dist/op/activities/collector-audit.d.ts +95 -0
  30. package/dist/op/activities/collector-audit.d.ts.map +1 -0
  31. package/dist/op/activities/collector-health.d.ts +74 -0
  32. package/dist/op/activities/collector-health.d.ts.map +1 -0
  33. package/dist/op/activities/exec.d.ts +19 -0
  34. package/dist/op/activities/exec.d.ts.map +1 -0
  35. package/dist/op/activities/github.d.ts +55 -0
  36. package/dist/op/activities/github.d.ts.map +1 -0
  37. package/dist/op/activities/index.d.ts +20 -0
  38. package/dist/op/activities/index.d.ts.map +1 -0
  39. package/dist/op/activities/otelcol.d.ts +96 -0
  40. package/dist/op/activities/otelcol.d.ts.map +1 -0
  41. package/dist/op/activity-contracts.d.ts +96 -0
  42. package/dist/op/activity-contracts.d.ts.map +1 -0
  43. package/dist/op/audit-op.d.ts +35 -0
  44. package/dist/op/audit-op.d.ts.map +1 -0
  45. package/dist/op/builders.d.ts +43 -0
  46. package/dist/op/builders.d.ts.map +1 -0
  47. package/dist/platform.d.ts +14 -0
  48. package/dist/platform.d.ts.map +1 -1
  49. package/dist/rules/otel-helpers.ts +18 -5
  50. package/package.json +14 -3
  51. package/src/collector.ts +9 -0
  52. package/src/composites/catalog.test.ts +1 -1
  53. package/src/composites/catalog.ts +292 -0
  54. package/src/composites/genai-pipeline.test.ts +53 -0
  55. package/src/composites/genai-pipeline.ts +40 -0
  56. package/src/composites/index.ts +8 -0
  57. package/src/composites/otlp-collector.test.ts +43 -0
  58. package/src/composites/otlp-collector.ts +70 -0
  59. package/src/composites/red-metrics.test.ts +131 -0
  60. package/src/composites/red-metrics.ts +148 -0
  61. package/src/composites/tail-sampling-tier.test.ts +100 -0
  62. package/src/composites/tail-sampling-tier.ts +182 -0
  63. package/src/configmap-operator.test.ts +44 -0
  64. package/src/configmap.ts +35 -0
  65. package/src/detect.ts +13 -1
  66. package/src/genai.ts +72 -59
  67. package/src/import/embedded.test.ts +36 -0
  68. package/src/import/embedded.ts +28 -4
  69. package/src/index.ts +57 -2
  70. package/src/lint/post-synth/otel-helpers.ts +18 -5
  71. package/src/metric-names.ts +141 -0
  72. package/src/op/activities/collector-audit.test.ts +166 -0
  73. package/src/op/activities/collector-audit.ts +265 -0
  74. package/src/op/activities/collector-health.test.ts +115 -0
  75. package/src/op/activities/collector-health.ts +211 -0
  76. package/src/op/activities/exec.ts +33 -0
  77. package/src/op/activities/github.ts +127 -0
  78. package/src/op/activities/index.ts +19 -0
  79. package/src/op/activities/otelcol.test.ts +162 -0
  80. package/src/op/activities/otelcol.ts +233 -0
  81. package/src/op/activity-contracts.test.ts +103 -0
  82. package/src/op/activity-contracts.ts +92 -0
  83. package/src/op/audit-op.ts +53 -0
  84. package/src/op/builders.ts +52 -0
  85. package/src/op/testdata/otelcol-components-v0.130.0.yaml +82 -0
  86. package/src/platform.ts +45 -8
@@ -146,5 +146,73 @@ export interface ServiceGraphNames {
146
146
  export declare function serviceGraphNames(connector: ServiceGraphNamingConfig | Declared, exporter?: PrometheusNaming | {
147
147
  props?: PrometheusNaming;
148
148
  }): ServiceGraphNames;
149
+ /** A label matcher: `[label, op, value]`. */
150
+ export type PromMatcher = [label: string, op: "=" | "!=" | "=~" | "!~", value: string];
151
+ /** `metric{a="x", b=~"y"}`; just `metric` with no matchers. */
152
+ export declare function promSelector(metric: string, matchers: PromMatcher[]): string;
153
+ /** `sum by (labels) (rate(sel[range]))`, or `sum (...)` with no labels. */
154
+ export declare function promSumRate(sel: string, by: string[], range: string): string;
155
+ /**
156
+ * `errors / all` as rates summed by `by`, with the numerator padded to zero:
157
+ * `(errors or all * 0) / all`. A group with calls but no error series gets 0
158
+ * instead of dropping out of the result.
159
+ */
160
+ export declare function promErrorRatio(errorSel: string, allSel: string, by: string[], range: string): string;
161
+ /** A number as PromQL writes it, without float noise. */
162
+ export declare function promNumber(n: number): string;
163
+ /** `histogram_quantile(q, sum by (le, labels) (rate(bucket[range])))`. */
164
+ export declare function promQuantile(q: number, bucketSel: string, by: string[], range: string): string;
165
+ /** The `span_kind` label values the spanmetrics connector writes. */
166
+ export type SpanMetricsKind = "SPAN_KIND_UNSPECIFIED" | "SPAN_KIND_INTERNAL" | "SPAN_KIND_SERVER" | "SPAN_KIND_CLIENT" | "SPAN_KIND_PRODUCER" | "SPAN_KIND_CONSUMER";
167
+ /** Every `span_kind` value, in the order the spec lists them. */
168
+ export declare const SPAN_METRICS_KINDS: readonly SpanMetricsKind[];
169
+ /** The kinds RED queries count unless told otherwise: the spans that serve a request or consume a message. */
170
+ export declare const RED_DEFAULT_SPAN_KINDS: readonly SpanMetricsKind[];
171
+ /** What `spanMetricsRedQueries` takes besides the names. */
172
+ export interface RedQueryOptions {
173
+ /** The range every `rate` reads: `$__rate_interval` on a dashboard, `5m` in a rule. */
174
+ range: string;
175
+ /** Duration quantiles, one expression each (default p50, p95 and p99). */
176
+ quantiles?: number[];
177
+ /** A regex the service label must match, e.g. `$service`. Unset: no service matcher. */
178
+ serviceMatch?: string;
179
+ /**
180
+ * The span kinds counted (default server and consumer spans). `[]` counts
181
+ * every kind. With the default, a connector that excludes `span.kind`
182
+ * gets no kind filter; naming kinds for such a connector is an error.
183
+ */
184
+ spanKinds?: readonly SpanMetricsKind[];
185
+ /** Labels the results are split by besides the service label. */
186
+ by?: string[];
187
+ /** The name errors are reported under, e.g. `RedDashboard`. */
188
+ owner?: string;
189
+ }
190
+ /** The RED expressions for one spanmetrics connector. */
191
+ export interface RedQueries {
192
+ /** The service label the results are split by. */
193
+ service: string;
194
+ /** The span-kind matcher, or none. */
195
+ kindMatchers: PromMatcher[];
196
+ /** Counted spans per second. */
197
+ rate: string;
198
+ /** Errors over counted spans, 0 for a service with none. */
199
+ errorRatio: string;
200
+ /** One expression per quantile, in the histogram's unit. Empty when the connector has no histogram. */
201
+ duration: Array<{
202
+ quantile: number;
203
+ expr: string;
204
+ }>;
205
+ }
206
+ /**
207
+ * The span-kind matcher for `kinds`, or none: none for `[]`, and none for
208
+ * the default kinds when the connector excludes `span.kind`.
209
+ */
210
+ export declare function spanKindMatchers(names: SpanMetricsNames, kinds: readonly SpanMetricsKind[] | undefined, owner?: string): PromMatcher[];
211
+ /**
212
+ * Rate, error ratio and duration quantiles per service, from a spanmetrics
213
+ * connector's names. The grafana lexicon's `RedDashboard` and the prometheus
214
+ * lexicon's `RedAlerts` both build their queries here.
215
+ */
216
+ export declare function spanMetricsRedQueries(names: SpanMetricsNames, options: RedQueryOptions): RedQueries;
149
217
  export {};
150
218
  //# sourceMappingURL=metric-names.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metric-names.d.ts","sourceRoot":"","sources":["../src/metric-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,oGAAoG;AACpG,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,GAAG,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uGAAuG;IACvG,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,mGAAmG;AACnG,eAAO,MAAM,8BAA8B,EAAE,SAAS,MAAM,EAA6E,CAAC;AAE1I,8DAA8D;AAC9D,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AAEnE,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAYrD,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAqB,GAAG,MAAM,CAQlI;AAED,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,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C,iEAAiE;IACjE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,QAAQ,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAID;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAAE,KAAK,SAAqB,GAAG,WAAW,EAAE,CASlJ;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,UAAU,CAoBnG"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * `collectorAudit`: the otel lexicon's pins against what upstream has
3
+ * released since (#3369), the activity behind `CollectorAuditOp`.
4
+ *
5
+ * Three readings, each against a moving upstream:
6
+ *
7
+ * - the contrib release list against `COLLECTOR_PIN`: how many releases
8
+ * the pin is behind, and the newest one.
9
+ * - component stability from each built-in component's `metadata.yaml`, at
10
+ * the pin and at the newest release: a signal whose stability level
11
+ * changed between the two, and any signal that is `deprecated` or
12
+ * `unmaintained` at the newest release. A component's file is looked up
13
+ * in contrib, then in core, at `<kind>/<type><kind>/metadata.yaml`; one
14
+ * found in neither is listed as unchecked, never as a finding.
15
+ * - `GENAI_SEMCONV_PIN` against the semantic-conventions releases.
16
+ *
17
+ * `mode` says what to do with the findings: `report` returns them;
18
+ * `issue` keeps one open issue current; `pull-request` also bumps the pins
19
+ * in the lexicon's `src/define.ts` on a proposal branch and opens (or
20
+ * edits) a pull request with the findings as its body. Only the pin values
21
+ * change: the config types written against the old pin are the reviewer's
22
+ * to move, which the body says.
23
+ */
24
+ import type { ComponentKind } from "../../model.js";
25
+ import { type CommandRunner } from "./github.js";
26
+ export type CollectorAuditMode = "report" | "issue" | "pull-request";
27
+ export declare const CONTRIB_REPO = "open-telemetry/opentelemetry-collector-contrib";
28
+ export declare const CORE_REPO = "open-telemetry/opentelemetry-collector";
29
+ export declare const SEMCONV_REPO = "open-telemetry/semantic-conventions";
30
+ export interface CollectorAuditArgs {
31
+ mode?: CollectorAuditMode;
32
+ /**
33
+ * The otel lexicon's directory, whose `src/define.ts` a pull request
34
+ * edits. Default `<cwd>/lexicons/otel`.
35
+ */
36
+ lexiconDir?: string;
37
+ /** Check component stability. Default true. */
38
+ stability?: boolean;
39
+ /** At most this many `metadata.yaml` reads. Default 200. */
40
+ stabilityBudget?: number;
41
+ /** The proposal branch. Default `chant/otel-pins`. */
42
+ branch?: string;
43
+ /** Replaces fetch. For tests. */
44
+ _fetch?: typeof fetch;
45
+ /** Replaces git and gh. For tests. */
46
+ _run?: CommandRunner;
47
+ }
48
+ export type CollectorAuditFindingKind = "collector-pin-behind" | "semconv-pin-behind" | "stability-changed" | "deprecated";
49
+ export interface CollectorAuditFinding {
50
+ kind: CollectorAuditFindingKind;
51
+ /** The pin or the component (`receiver/otlp`) the finding is about. */
52
+ subject: string;
53
+ detail: string;
54
+ }
55
+ export interface CollectorAuditResult {
56
+ mode: CollectorAuditMode;
57
+ collector: {
58
+ pin: string;
59
+ latest: string | null;
60
+ behind: number;
61
+ };
62
+ semconv: {
63
+ pin: string;
64
+ latest: string | null;
65
+ behind: number;
66
+ };
67
+ findings: CollectorAuditFinding[];
68
+ /** Components whose metadata.yaml was in neither repository, or past the budget. */
69
+ unchecked: string[];
70
+ summary: string;
71
+ issueUrl?: string;
72
+ prUrl?: string;
73
+ }
74
+ /** A built-in component's kind and collector type. */
75
+ export interface BuiltinComponent {
76
+ kind: ComponentKind;
77
+ type: string;
78
+ }
79
+ export declare function builtinComponents(): BuiltinComponent[];
80
+ /** The directory a component lives in upstream: `receiver/k8s_cluster` is `receiver/k8sclusterreceiver`. */
81
+ export declare function componentDir(c: BuiltinComponent): string;
82
+ /** Stability level by signal, from a `metadata.yaml`'s `status.stability`. */
83
+ export type Stability = Record<string, string>;
84
+ export declare function parseStability(text: string): Stability | undefined;
85
+ /** Findings for one component, from its stability at the pin and at the newest release. */
86
+ export declare function stabilityFindings(c: BuiltinComponent, atPin: Stability | undefined, atLatest: Stability, pin: string, latest: string): CollectorAuditFinding[];
87
+ /** `src/define.ts` with `COLLECTOR_PIN` and `GENAI_SEMCONV_PIN` moved to the given versions. */
88
+ export declare function bumpPins(text: string, to: {
89
+ collector?: string;
90
+ genai?: string;
91
+ }): string;
92
+ export declare function renderCollectorAuditSummary(r: Omit<CollectorAuditResult, "summary" | "mode">): string;
93
+ /** Audit the otel lexicon's pins and its built-in components against upstream releases. */
94
+ export declare function collectorAudit(args?: CollectorAuditArgs): Promise<CollectorAuditResult>;
95
+ //# sourceMappingURL=collector-audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collector-audit.d.ts","sourceRoot":"","sources":["../../../src/op/activities/collector-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAgF,KAAK,aAAa,EAAgB,MAAM,UAAU,CAAC;AAE1I,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAC;AAErE,eAAO,MAAM,YAAY,mDAAmD,CAAC;AAC7E,eAAO,MAAM,SAAS,2CAA2C,CAAC;AAClE,eAAO,MAAM,YAAY,wCAAwC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,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atD;AAED,4GAA4G;AAC5G,wBAAgB,YAAY,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAExD;AAED,8EAA8E;AAC9E,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAelE;AAsBD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAc9J;AAMD,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAUzF;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG,MAAM,CAarG;AAED,2FAA2F;AAC3F,wBAAsB,cAAc,CAAC,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqEjG"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Running collectors as resources a `ConvergeOp` observes (#3369).
3
+ *
4
+ * `collectorHealthObserve` returns one resource per collector, from the
5
+ * endpoints its config declares:
6
+ *
7
+ * - the `health_check` extension (`service.extensions`), at its `endpoint`
8
+ * and `path`. At v0.130.0 it answers on `localhost:13133` at `/` by
9
+ * default, 200 while the collector runs, and reports no per-component
10
+ * status, so a 200 is all it says.
11
+ * - the `zpages` extension, when the service enables it: `/debug/servicez`
12
+ * on its endpoint (default `localhost:55679`).
13
+ * - the collector's own metrics, when `service.telemetry.metrics` declares
14
+ * where they are served: a `pull` reader's prometheus exporter
15
+ * (`host`/`port`), or the older `address`. `/metrics` on it.
16
+ *
17
+ * A collector whose service enables no `health_check` is `unknown`, never
18
+ * `drifted`: nothing it declares says whether it is healthy. One that does
19
+ * is `in-sync` when every declared endpoint answers 200, and `drifted`
20
+ * otherwise, with each endpoint that did not in the detail.
21
+ *
22
+ * The config's hosts are where the collector listens, which is often
23
+ * `0.0.0.0` or a pod address. `host` replaces the host of every endpoint (a
24
+ * port-forward, a container's published ports), and `endpoints` replaces
25
+ * whole URLs.
26
+ */
27
+ export type CollectorEndpointKind = "healthCheck" | "zpages" | "telemetry";
28
+ export interface ObservedCollector {
29
+ /** The resource name. */
30
+ name: string;
31
+ /** The collector config file, relative to the working directory, read on each tick. */
32
+ config?: string;
33
+ /** The config itself, in place of `config`. */
34
+ configObject?: Record<string, unknown>;
35
+ /** Where the collector is reached, replacing every endpoint's host. Default: the config's host, with 0.0.0.0 and empty read as localhost. */
36
+ host?: string;
37
+ /** Whole URLs, replacing the ones read from the config. */
38
+ endpoints?: Partial<Record<CollectorEndpointKind, string>>;
39
+ }
40
+ export interface CollectorHealthObserveArgs {
41
+ collectors: ObservedCollector[];
42
+ /** Per-request timeout, ms. Default 5000. */
43
+ timeoutMs?: number;
44
+ /** Probes of a failing endpoint before it counts as down. Default 2. */
45
+ probes?: number;
46
+ /** Time between probes, ms. Default 1000. */
47
+ probeIntervalMs?: number;
48
+ /** Replaces fetch. For tests. */
49
+ _fetch?: typeof fetch;
50
+ }
51
+ export interface CollectorHealthObserveResult {
52
+ resources: {
53
+ name: string;
54
+ status: "in-sync" | "drifted" | "unknown";
55
+ detail: string;
56
+ }[];
57
+ }
58
+ export interface DeclaredEndpoint {
59
+ kind: CollectorEndpointKind;
60
+ url: string;
61
+ }
62
+ /** `host:port`, `:port` or a URL, as host and port. A `${env:...}` host reads as unknown (empty). */
63
+ export declare function splitEndpoint(endpoint: string): {
64
+ host: string;
65
+ port: string;
66
+ } | undefined;
67
+ /**
68
+ * The endpoints a collector config declares, as URLs. `healthCheck` is
69
+ * present only when the service enables a `health_check` extension.
70
+ */
71
+ export declare function declaredEndpoints(config: Record<string, unknown>, host?: string, overrides?: Partial<Record<CollectorEndpointKind, string>>): DeclaredEndpoint[];
72
+ /** Observe each collector through the endpoints its config declares: one resource per collector. */
73
+ export declare function collectorHealthObserve(args: CollectorHealthObserveArgs): Promise<CollectorHealthObserveResult>;
74
+ //# sourceMappingURL=collector-health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collector-health.d.ts","sourceRoot":"","sources":["../../../src/op/activities/collector-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAOH,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,6IAA6I;IAC7I,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1F;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AASD,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAO1F;AAyCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAM,GAAG,gBAAgB,EAAE,CAoBpK;AAyBD,oGAAoG;AACpG,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAoCpH"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * How the otel activities run a binary: a child process whose exit code,
3
+ * stdout and stderr are returned rather than thrown, so the caller decides
4
+ * what a non-zero exit means. Tests pass their own runner.
5
+ */
6
+ export interface ExecResult {
7
+ /** The exit code, or null when the binary could not be started. */
8
+ code: number | null;
9
+ stdout: string;
10
+ stderr: string;
11
+ /** Why the binary could not be started (ENOENT and the like). */
12
+ error?: string;
13
+ }
14
+ export type ExecRunner = (bin: string, args: string[], opts?: {
15
+ cwd?: string;
16
+ timeoutMs?: number;
17
+ }) => Promise<ExecResult>;
18
+ export declare const defaultExec: ExecRunner;
19
+ //# sourceMappingURL=exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/op/activities/exec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3H,eAAO,MAAM,WAAW,EAAE,UAatB,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * What the audit activities read from GitHub and write back to it: release
3
+ * lists over the REST API, and a sticky issue or a proposal pull request
4
+ * through `git` and `gh`. The prometheus lexicon's rule audit uses the issue
5
+ * half too.
6
+ */
7
+ /** Runs `git` or `gh`, returning stdout. Rejects on a non-zero exit. */
8
+ export type CommandRunner = (bin: "git" | "gh", args: string[], cwd: string) => Promise<string>;
9
+ export declare const defaultRunner: CommandRunner;
10
+ export interface Release {
11
+ tag: string;
12
+ publishedAt?: string;
13
+ }
14
+ /** `v1.2.3` as numbers, or undefined when the tag is not a plain semver. */
15
+ export declare function semverOf(tag: string): [number, number, number] | undefined;
16
+ export declare function compareSemver(a: string, b: string): number;
17
+ /**
18
+ * The published, non-prerelease releases of `repo` (`owner/name`) with a
19
+ * plain semver tag, newest first. Reads one page of 100, which covers
20
+ * months of collector releases.
21
+ */
22
+ export declare function fetchReleases(repo: string, f?: typeof fetch, token?: string | undefined): Promise<Release[]>;
23
+ /**
24
+ * Open an issue titled `title`, or edit the body of the open one that
25
+ * already has that title, so a scheduled audit keeps one issue current
26
+ * instead of opening one per run. Returns its URL.
27
+ */
28
+ export declare function stickyIssue(run: CommandRunner, cwd: string, title: string, body: string, labels?: string[]): Promise<string>;
29
+ export interface ProposalFile {
30
+ /** Path relative to the repository root. */
31
+ path: string;
32
+ content: string;
33
+ }
34
+ export interface ProposeOptions {
35
+ /** The repository root. */
36
+ root: string;
37
+ branch: string;
38
+ title: string;
39
+ body: string;
40
+ files: ProposalFile[];
41
+ commitMessage: string;
42
+ remote?: string;
43
+ /** The branch the pull request targets. Default: the remote's default branch. */
44
+ base?: string;
45
+ /** A directory for the worktree the commit is made in. */
46
+ worktreeDir: string;
47
+ }
48
+ /**
49
+ * Commit `files` on `branch`, from the remote's default branch, in a
50
+ * worktree of its own (the checked-out branch and working tree are never
51
+ * touched), push it, and open a pull request, or edit the open one for that
52
+ * branch. Returns the pull request's URL.
53
+ */
54
+ export declare function proposePullRequest(run: CommandRunner, o: ProposeOptions): Promise<string>;
55
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../src/op/activities/github.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wEAAwE;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEhG,eAAO,MAAM,aAAa,EAAE,aAMxB,CAAC;AAEL,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAG1E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAAE,OAAO,KAAa,EAAE,KAAK,qBAA2B,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAU/H;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAUtI;AAED,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA0B/F"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * otel Op activities (#3369), resolved by the core activity registry when a
3
+ * project's `chant.config.ts` lists the `otel` lexicon. Every function this
4
+ * module exports is an activity, bound by its export name, so the helpers
5
+ * behind them stay in their own files.
6
+ *
7
+ * - `otelcolValidate`, `otelcolComponents`: the collector binary's own
8
+ * checks over a config file.
9
+ * - `collectorHealthObserve`: running collectors as the resources of a
10
+ * `ConvergeOp({ observe })`.
11
+ * - `collectorAudit`: the lexicon's pins against upstream releases, the
12
+ * step of `CollectorAuditOp`.
13
+ */
14
+ export { otelcolValidate, otelcolComponents } from "./otelcol.js";
15
+ export type { OtelcolValidateArgs, OtelcolValidateResult, OtelcolComponentsArgs, OtelcolComponentsResult, MissingComponent } from "./otelcol.js";
16
+ export { collectorHealthObserve } from "./collector-health.js";
17
+ export type { CollectorHealthObserveArgs, CollectorHealthObserveResult, ObservedCollector, CollectorEndpointKind } from "./collector-health.js";
18
+ export { collectorAudit } from "./collector-audit.js";
19
+ export type { CollectorAuditArgs, CollectorAuditResult, CollectorAuditFinding, CollectorAuditFindingKind, CollectorAuditMode } from "./collector-audit.js";
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC9I,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC7I,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * `otelcol validate` and `otelcol components` as Op steps (#3369).
3
+ *
4
+ * - `otelcolValidate` runs the collector binary's own `validate` over a
5
+ * config file. Before it does, it reads the binary's version and refuses
6
+ * when that is not the version chant's config types follow
7
+ * (`COLLECTOR_PIN`): a different collector accepts and rejects different
8
+ * fields, so its verdict is not about the config chant built. A step that
9
+ * names a `version` checks the binary against that version instead.
10
+ * - `otelcolComponents` reads the binary's component list and refuses a
11
+ * config that uses a receiver, processor, exporter, connector or
12
+ * extension the binary was not built with: the failure a custom or core
13
+ * distribution gives at start, found before it starts.
14
+ *
15
+ * The binary is `bin`, else `$OTELCOL_BIN`, else `otelcol-contrib` on PATH.
16
+ */
17
+ import { type ComponentKind } from "../../model.js";
18
+ import { type ExecRunner } from "./exec.js";
19
+ export interface OtelcolValidateArgs {
20
+ /** The collector config file, relative to the working directory. */
21
+ config: string;
22
+ /** The collector binary. Default `$OTELCOL_BIN`, else `otelcol-contrib`. */
23
+ bin?: string;
24
+ /**
25
+ * The collector version the binary must be, e.g. `v0.131.0`. Default
26
+ * `COLLECTOR_PIN`'s version: the one chant's config types follow.
27
+ */
28
+ version?: string;
29
+ /** Replaces the child process. For tests. */
30
+ _exec?: ExecRunner;
31
+ }
32
+ export interface OtelcolValidateResult {
33
+ config: string;
34
+ bin: string;
35
+ /** The binary's version, `v`-prefixed. */
36
+ version: string;
37
+ /** Always true: a config the binary rejects fails the step. */
38
+ ok: boolean;
39
+ output: string;
40
+ }
41
+ export interface OtelcolComponentsArgs {
42
+ /** The collector config file, relative to the working directory. */
43
+ config: string;
44
+ /** The collector binary. Default `$OTELCOL_BIN`, else `otelcol-contrib`. */
45
+ bin?: string;
46
+ /** Replaces the child process. For tests. */
47
+ _exec?: ExecRunner;
48
+ }
49
+ export interface MissingComponent {
50
+ kind: ComponentKind;
51
+ /** The component id as the config writes it, e.g. `spanmetrics/genai`. */
52
+ id: string;
53
+ type: string;
54
+ }
55
+ export interface OtelcolComponentsResult {
56
+ config: string;
57
+ bin: string;
58
+ /** The binary's version from its build info, when it prints one. */
59
+ version?: string;
60
+ /** Components the config declares, by kind. */
61
+ used: Record<ComponentKind, string[]>;
62
+ /** Always empty: a config that uses a missing component fails the step. */
63
+ missing: MissingComponent[];
64
+ }
65
+ /** The binary a step runs. */
66
+ export declare function otelcolBin(explicit?: string, env?: NodeJS.ProcessEnv): string;
67
+ /**
68
+ * The version `otelcol --version` prints: `otelcol-contrib version 0.130.0`.
69
+ * Undefined when the output names none.
70
+ */
71
+ export declare function parseOtelcolVersion(output: string): string | undefined;
72
+ /** Run `otelcol validate` over `config`, after checking the binary is the pinned (or the given) version. */
73
+ export declare function otelcolValidate(args: OtelcolValidateArgs): Promise<OtelcolValidateResult>;
74
+ /** What `otelcol components` lists, by kind: component type names. */
75
+ export interface OtelcolComponentList {
76
+ version?: string;
77
+ components: Record<ComponentKind, Set<string>>;
78
+ }
79
+ /**
80
+ * Read `otelcol components` output. The format is YAML and marked unstable
81
+ * upstream, so this reads what it can: each section may be a list of
82
+ * objects with a `name` (v0.130.0), a list of plain names (older builds),
83
+ * or a mapping keyed by name. Unknown top-level keys are ignored.
84
+ */
85
+ export declare function parseComponentsOutput(text: string): OtelcolComponentList;
86
+ /** The component ids a config declares, by kind. */
87
+ export declare function configComponents(config: Record<string, unknown>): Record<ComponentKind, string[]>;
88
+ /**
89
+ * The components `used` names that `list` lacks. A renamed built-in counts
90
+ * under either name: a binary that lists `otlp_grpc` runs a config that says
91
+ * `otlp`, and the other way round.
92
+ */
93
+ export declare function missingComponents(used: Record<ComponentKind, string[]>, list: OtelcolComponentList): MissingComponent[];
94
+ /** Check `config` uses only components the binary was built with, from `otelcol components`. */
95
+ export declare function otelcolComponents(args: OtelcolComponentsArgs): Promise<OtelcolComponentsResult>;
96
+ //# sourceMappingURL=otelcol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otelcol.d.ts","sourceRoot":"","sources":["../../../src/op/activities/otelcol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EAAyE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACxH,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM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,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CA0BxE;AAED,oDAAoD;AACpD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAQjG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,GAAG,gBAAgB,EAAE,CAYvH;AAED,gGAAgG;AAChG,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAkBrG"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Activity contracts for this lexicon's `op/activities` (#3369).
3
+ *
4
+ * Resolved by convention at `@intentius/chant-lexicon-otel/op/activity-contracts`:
5
+ * `loadActivityContracts` merges them into the map OPS012 checks each step's
6
+ * args against and OPS013 checks each step-output reference against. Every
7
+ * activity here has one. `collectorHealthObserve` needs its return schema
8
+ * most: it is the observer of a `ConvergeOp({ observe })`, whose Converge
9
+ * step reads the observer's whole output.
10
+ *
11
+ * Each `args` schema mirrors the `*Args` interface in `./activities/`,
12
+ * without the `_`-prefixed test seams, and is a `z.strictObject`, so a
13
+ * misspelled key fails the build.
14
+ */
15
+ export declare const otelcolValidateContract: import("@intentius/chant/op").ActivityContract<{
16
+ config: string;
17
+ bin?: string | undefined;
18
+ version?: string | undefined;
19
+ }, {
20
+ config: string;
21
+ bin: string;
22
+ version: string;
23
+ ok: boolean;
24
+ output: string;
25
+ }>;
26
+ export declare const otelcolComponentsContract: import("@intentius/chant/op").ActivityContract<{
27
+ config: string;
28
+ bin?: string | undefined;
29
+ }, {
30
+ config: string;
31
+ bin: string;
32
+ version?: string | undefined;
33
+ used: {
34
+ receiver: string[];
35
+ processor: string[];
36
+ exporter: string[];
37
+ connector: string[];
38
+ extension: string[];
39
+ };
40
+ missing: {
41
+ kind: "connector" | "exporter" | "extension" | "processor" | "receiver";
42
+ id: string;
43
+ type: string;
44
+ }[];
45
+ }>;
46
+ export declare const collectorHealthObserveContract: import("@intentius/chant/op").ActivityContract<{
47
+ collectors: {
48
+ name: string;
49
+ config?: string | undefined;
50
+ configObject?: Record<string, unknown> | undefined;
51
+ host?: string | undefined;
52
+ endpoints?: {
53
+ healthCheck?: string | undefined;
54
+ zpages?: string | undefined;
55
+ telemetry?: string | undefined;
56
+ } | undefined;
57
+ }[];
58
+ timeoutMs?: number | undefined;
59
+ probes?: number | undefined;
60
+ probeIntervalMs?: number | undefined;
61
+ }, {
62
+ resources: {
63
+ name: string;
64
+ status: "drifted" | "in-sync" | "unknown";
65
+ detail: string;
66
+ }[];
67
+ }>;
68
+ export declare const collectorAuditContract: import("@intentius/chant/op").ActivityContract<{
69
+ mode?: "issue" | "pull-request" | "report" | undefined;
70
+ lexiconDir?: string | undefined;
71
+ stability?: boolean | undefined;
72
+ stabilityBudget?: number | undefined;
73
+ branch?: string | undefined;
74
+ }, {
75
+ mode: "issue" | "pull-request" | "report";
76
+ collector: {
77
+ pin: string;
78
+ latest: string | null;
79
+ behind: number;
80
+ };
81
+ semconv: {
82
+ pin: string;
83
+ latest: string | null;
84
+ behind: number;
85
+ };
86
+ findings: {
87
+ kind: "collector-pin-behind" | "deprecated" | "semconv-pin-behind" | "stability-changed";
88
+ subject: string;
89
+ detail: string;
90
+ }[];
91
+ unchecked: string[];
92
+ summary: string;
93
+ issueUrl?: string | undefined;
94
+ prUrl?: string | undefined;
95
+ }>;
96
+ //# sourceMappingURL=activity-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../src/op/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,eAAO,MAAM,uBAAuB;;;;;;;;;;EAInC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;EAUrC,CAAC;AAIF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;EAmB1C,CAAC;AAIF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBlC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `CollectorAuditOp`: the otel lexicon's pins against upstream, as an Op
3
+ * with an optional schedule (#3369). It sits at observe, like
4
+ * `WorkflowAuditOp`: one `collectorAudit` step reads the contrib release
5
+ * list against `COLLECTOR_PIN`, each built-in component's stability from its
6
+ * `metadata.yaml`, and `GENAI_SEMCONV_PIN` against the semantic-conventions
7
+ * releases. `onFinding` says what happens with findings: `report` (the
8
+ * default), `issue`, or `pull-request`, which bumps the pins on a proposal
9
+ * branch and opens a pull request. Review and merge of that pull request
10
+ * are the approval.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * export const { op } = CollectorAuditOp({ name: "collector-audit", schedule: "0 6 * * 1", onFinding: "pull-request" });
15
+ * ```
16
+ */
17
+ import { type OpResource } from "@intentius/chant/op";
18
+ import type { CollectorAuditMode } from "./activities/collector-audit.js";
19
+ export interface CollectorAuditOpConfig {
20
+ /** Op name (kebab-case). */
21
+ name: string;
22
+ /** Cron expression; omit for one-shot `chant run`. */
23
+ schedule?: string;
24
+ /** @default "report" */
25
+ onFinding?: CollectorAuditMode;
26
+ /** The otel lexicon's directory a pull request edits. Default `lexicons/otel`. */
27
+ lexiconDir?: string;
28
+ /** At most this many `metadata.yaml` reads. Default 200. */
29
+ stabilityBudget?: number;
30
+ }
31
+ export interface CollectorAuditOpResources {
32
+ op: InstanceType<typeof OpResource>;
33
+ }
34
+ export declare function CollectorAuditOp(config: CollectorAuditOpConfig): CollectorAuditOpResources;
35
+ //# sourceMappingURL=audit-op.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-op.d.ts","sourceRoot":"","sources":["../../src/op/audit-op.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;CACrC;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,yBAAyB,CAc1F"}