@intentius/chant-lexicon-otel 0.124.45 → 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.
Files changed (211) hide show
  1. package/README.md +2 -2
  2. package/dist/build/capability-plugin.d.ts +10 -0
  3. package/dist/build/capability-plugin.d.ts.map +1 -0
  4. package/dist/build/capability-plugin.js +19 -0
  5. package/dist/build/ocb-build.d.ts +38 -0
  6. package/dist/build/ocb-build.d.ts.map +1 -0
  7. package/dist/build/ocb-build.js +49 -0
  8. package/dist/clickhouse-tables.d.ts +73 -0
  9. package/dist/clickhouse-tables.d.ts.map +1 -0
  10. package/dist/clickhouse-tables.js +199 -0
  11. package/dist/codegen/docs.d.ts.map +1 -1
  12. package/dist/codegen/docs.js +4 -2
  13. package/dist/codegen/generate.d.ts +29 -10
  14. package/dist/codegen/generate.d.ts.map +1 -1
  15. package/dist/codegen/generate.js +82 -17
  16. package/dist/components/common.d.ts +3 -1
  17. package/dist/components/common.d.ts.map +1 -1
  18. package/dist/components/common.js +2 -0
  19. package/dist/components/connectors.d.ts +25 -90
  20. package/dist/components/connectors.d.ts.map +1 -1
  21. package/dist/components/connectors.js +3 -0
  22. package/dist/components/exporters.d.ts +78 -34
  23. package/dist/components/exporters.d.ts.map +1 -1
  24. package/dist/components/exporters.js +26 -1
  25. package/dist/components/extensions.d.ts +16 -33
  26. package/dist/components/extensions.d.ts.map +1 -1
  27. package/dist/components/filtering.d.ts +13 -60
  28. package/dist/components/filtering.d.ts.map +1 -1
  29. package/dist/components/k8s-receivers.d.ts +5 -53
  30. package/dist/components/k8s-receivers.d.ts.map +1 -1
  31. package/dist/components/overlay.d.ts +25 -0
  32. package/dist/components/overlay.d.ts.map +1 -0
  33. package/dist/components/overlay.js +19 -0
  34. package/dist/components/processors.d.ts +18 -79
  35. package/dist/components/processors.d.ts.map +1 -1
  36. package/dist/components/receivers.d.ts +17 -71
  37. package/dist/components/receivers.d.ts.map +1 -1
  38. package/dist/components/receivers.js +3 -1
  39. package/dist/components/sampling.d.ts +19 -35
  40. package/dist/components/sampling.d.ts.map +1 -1
  41. package/dist/config-hygiene.d.ts +10 -8
  42. package/dist/config-hygiene.d.ts.map +1 -1
  43. package/dist/config-hygiene.js +36 -13
  44. package/dist/coverage.d.ts +50 -0
  45. package/dist/coverage.d.ts.map +1 -0
  46. package/dist/coverage.js +92 -0
  47. package/dist/define.d.ts +8 -5
  48. package/dist/define.d.ts.map +1 -1
  49. package/dist/define.js +10 -6
  50. package/dist/distribution.d.ts +125 -0
  51. package/dist/distribution.d.ts.map +1 -0
  52. package/dist/distribution.js +227 -0
  53. package/dist/generated/index.d.ts +4234 -0
  54. package/dist/generated/index.d.ts.map +1 -0
  55. package/dist/generated/index.js +23 -0
  56. package/dist/index.d.ts +7 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +9 -1
  59. package/dist/init-templates.js +2 -2
  60. package/dist/integrity.json +11 -9
  61. package/dist/lint/audit-catalog.d.ts +3 -0
  62. package/dist/lint/audit-catalog.d.ts.map +1 -1
  63. package/dist/lint/audit-catalog.js +5 -0
  64. package/dist/lint/post-synth/index.d.ts.map +1 -1
  65. package/dist/lint/post-synth/index.js +4 -0
  66. package/dist/lint/post-synth/otel-helpers.d.ts +2 -1
  67. package/dist/lint/post-synth/otel-helpers.d.ts.map +1 -1
  68. package/dist/lint/post-synth/otel-helpers.js +1 -1
  69. package/dist/lint/post-synth/otel119.d.ts +1 -1
  70. package/dist/lint/post-synth/otel119.js +1 -1
  71. package/dist/lint/post-synth/otel125.d.ts +1 -1
  72. package/dist/lint/post-synth/otel125.js +1 -1
  73. package/dist/lint/post-synth/otel126.d.ts +1 -1
  74. package/dist/lint/post-synth/otel126.js +1 -1
  75. package/dist/lint/post-synth/otel127.d.ts +1 -1
  76. package/dist/lint/post-synth/otel127.js +1 -1
  77. package/dist/lint/post-synth/otel128.d.ts +8 -0
  78. package/dist/lint/post-synth/otel128.d.ts.map +1 -0
  79. package/dist/lint/post-synth/otel128.js +17 -0
  80. package/dist/lint/post-synth/otel129.d.ts +15 -0
  81. package/dist/lint/post-synth/otel129.d.ts.map +1 -0
  82. package/dist/lint/post-synth/otel129.js +92 -0
  83. package/dist/lsp/completions.d.ts +10 -1
  84. package/dist/lsp/completions.d.ts.map +1 -1
  85. package/dist/lsp/completions.js +29 -1
  86. package/dist/lsp/hover.d.ts +5 -1
  87. package/dist/lsp/hover.d.ts.map +1 -1
  88. package/dist/lsp/hover.js +16 -3
  89. package/dist/lsp/properties.d.ts +34 -0
  90. package/dist/lsp/properties.d.ts.map +1 -0
  91. package/dist/lsp/properties.js +135 -0
  92. package/dist/manifest.json +1 -1
  93. package/dist/meta.json +5 -0
  94. package/dist/metric-names.d.ts +36 -8
  95. package/dist/metric-names.d.ts.map +1 -1
  96. package/dist/metric-names.js +42 -9
  97. package/dist/model.d.ts +1 -1
  98. package/dist/model.js +1 -1
  99. package/dist/okf/index.md +3 -0
  100. package/dist/okf/rules/OTEL128.md +11 -0
  101. package/dist/okf/rules/OTEL129.md +11 -0
  102. package/dist/okf/types/ClickHouseExporter.md +9 -0
  103. package/dist/op/activities/collector-audit.d.ts +18 -6
  104. package/dist/op/activities/collector-audit.d.ts.map +1 -1
  105. package/dist/op/activities/collector-audit.js +37 -21
  106. package/dist/plugin.d.ts.map +1 -1
  107. package/dist/plugin.js +51 -8
  108. package/dist/rules/otel-helpers.ts +1 -1
  109. package/dist/rules/otel119.ts +1 -1
  110. package/dist/rules/otel125.ts +1 -1
  111. package/dist/rules/otel126.ts +1 -1
  112. package/dist/rules/otel127.ts +1 -1
  113. package/dist/rules/otel128.ts +22 -0
  114. package/dist/rules/otel129.ts +99 -0
  115. package/dist/serializer.d.ts +3 -0
  116. package/dist/serializer.d.ts.map +1 -1
  117. package/dist/serializer.js +12 -2
  118. package/dist/spec/builtins.d.ts +17 -0
  119. package/dist/spec/builtins.d.ts.map +1 -0
  120. package/dist/spec/builtins.js +45 -0
  121. package/dist/spec/fetch.d.ts +120 -0
  122. package/dist/spec/fetch.d.ts.map +1 -0
  123. package/dist/spec/fetch.js +282 -0
  124. package/dist/spec/parse.d.ts +77 -0
  125. package/dist/spec/parse.d.ts.map +1 -0
  126. package/dist/spec/parse.js +337 -0
  127. package/dist/spec/pin.d.ts +82 -0
  128. package/dist/spec/pin.d.ts.map +1 -0
  129. package/dist/spec/pin.js +126 -0
  130. package/dist/spec/snapshot-cli.d.ts +13 -0
  131. package/dist/spec/snapshot-cli.d.ts.map +1 -0
  132. package/dist/spec/snapshot-cli.js +31 -0
  133. package/dist/spec/snapshot.d.ts +9 -0
  134. package/dist/spec/snapshot.d.ts.map +1 -0
  135. package/dist/spec/snapshot.js +14 -0
  136. package/dist/types/index.d.ts +3 -2
  137. package/dist/validate-config.d.ts +1 -1
  138. package/dist/validate-config.d.ts.map +1 -1
  139. package/dist/validate.d.ts.map +1 -1
  140. package/dist/validate.js +1 -0
  141. package/dist/workspace-links.d.ts +25 -0
  142. package/dist/workspace-links.d.ts.map +1 -0
  143. package/dist/workspace-links.js +49 -0
  144. package/package.json +3 -2
  145. package/src/build/capability-plugin.ts +30 -0
  146. package/src/build/ocb-build.ts +73 -0
  147. package/src/clickhouse-exporter.e2e.test.ts +208 -0
  148. package/src/clickhouse-tables.test.ts +216 -0
  149. package/src/clickhouse-tables.ts +223 -0
  150. package/src/codegen/docs.ts +4 -2
  151. package/src/codegen/generate.ts +95 -19
  152. package/src/components/common.ts +4 -2
  153. package/src/components/connectors.ts +30 -77
  154. package/src/components/exporters.ts +128 -61
  155. package/src/components/extensions.ts +22 -36
  156. package/src/components/filtering.ts +17 -58
  157. package/src/components/k8s-receivers.test.ts +1 -1
  158. package/src/components/k8s-receivers.ts +3 -45
  159. package/src/components/overlay.ts +24 -0
  160. package/src/components/processors.ts +18 -63
  161. package/src/components/receivers.ts +20 -60
  162. package/src/components/sampling.ts +24 -37
  163. package/src/config-hygiene.ts +36 -13
  164. package/src/coverage.test.ts +37 -0
  165. package/src/coverage.ts +121 -0
  166. package/src/define.test.ts +2 -0
  167. package/src/define.ts +10 -6
  168. package/src/distribution.test.ts +250 -0
  169. package/src/distribution.ts +305 -0
  170. package/src/generated/index.ts +4576 -0
  171. package/src/generated/lexicon-otel.json +5 -0
  172. package/src/generated/properties.json +1 -0
  173. package/src/import/roundtrip.test.ts +16 -0
  174. package/src/import/testdata/clickhouse.yaml +37 -0
  175. package/src/import/testdata/fixtures.ts +17 -2
  176. package/src/import/testdata/upstream/clickhouse-exporter.yaml +60 -0
  177. package/src/index.ts +69 -0
  178. package/src/init-templates.ts +2 -2
  179. package/src/lint/audit-catalog.ts +15 -0
  180. package/src/lint/post-synth/index.ts +4 -0
  181. package/src/lint/post-synth/otel-helpers.ts +1 -1
  182. package/src/lint/post-synth/otel119.ts +1 -1
  183. package/src/lint/post-synth/otel125.ts +1 -1
  184. package/src/lint/post-synth/otel126.ts +1 -1
  185. package/src/lint/post-synth/otel127.ts +1 -1
  186. package/src/lint/post-synth/otel128.ts +22 -0
  187. package/src/lint/post-synth/otel129.ts +99 -0
  188. package/src/lsp/completions.ts +30 -1
  189. package/src/lsp/hover.ts +14 -3
  190. package/src/lsp/properties.test.ts +72 -0
  191. package/src/lsp/properties.ts +141 -0
  192. package/src/metric-names.test.ts +11 -0
  193. package/src/metric-names.ts +64 -16
  194. package/src/model.ts +1 -1
  195. package/src/op/activities/collector-audit.test.ts +29 -22
  196. package/src/op/activities/collector-audit.ts +38 -18
  197. package/src/plugin.test.ts +2 -0
  198. package/src/plugin.ts +57 -6
  199. package/src/serializer.ts +11 -2
  200. package/src/spec/builtins.ts +56 -0
  201. package/src/spec/fetch.ts +332 -0
  202. package/src/spec/otel-schemas.snapshot.json +13932 -0
  203. package/src/spec/parse.ts +364 -0
  204. package/src/spec/pin.ts +155 -0
  205. package/src/spec/snapshot-cli.ts +32 -0
  206. package/src/spec/snapshot.ts +19 -0
  207. package/src/spec/spec.test.ts +144 -0
  208. package/src/validate-config.ts +4 -3
  209. package/src/validate.ts +1 -0
  210. package/src/workspace-links.e2e.test.ts +91 -0
  211. package/src/workspace-links.ts +50 -0
@@ -0,0 +1,227 @@
1
+ /**
2
+ * `Distribution`, the builder manifest `ocb` (the OpenTelemetry Collector
3
+ * Builder) builds a custom collector from (#3374).
4
+ *
5
+ * The fields are the builder's `Config` as read at v0.130.0
6
+ * (`cmd/builder/internal/builder/config.go` in opentelemetry-collector):
7
+ * `dist`, a module list per component kind, `providers`,
8
+ * `converters`, `replaces`, `excludes` and `conf_resolver`. `telemetry`
9
+ * (v0.146.0) is not in it, and `otelcol_version`, removed in v0.113.0, is
10
+ * not either.
11
+ *
12
+ * A component list takes a module (`{ gomod, import?, name?, path? }`) or a
13
+ * component class. A built-in class writes its module at `COLLECTOR_PIN`
14
+ * (`OtlpReceiver` is `go.opentelemetry.io/collector/receiver/otlpreceiver
15
+ * v0.162.0`), and a `defineComponent` class writes its own pin's source and
16
+ * version, so the manifest names the same versions the config was typed
17
+ * against.
18
+ *
19
+ * The serializer writes the manifest as `builder-config.yaml` beside the
20
+ * collector config when a project declares a `Distribution`. OTEL128 then
21
+ * checks that the collector config uses only components the distribution
22
+ * builds. A project without one sees no change.
23
+ */
24
+ import { createResource } from "@intentius/chant/runtime";
25
+ import { dump } from "js-yaml";
26
+ import { COLLECTOR_PIN, isUsablePin } from "./define.js";
27
+ import { canonicalComponentType, canonicalTypeOf, COMPONENT_KINDS, SECTION_OF } from "./model.js";
28
+ export const DISTRIBUTION_TYPE = "OTel::Distribution";
29
+ /** Where the serializer writes the builder manifest, beside the collector config. */
30
+ export const DISTRIBUTION_MANIFEST_FILE = "builder-config.yaml";
31
+ /** A custom collector's builder manifest. Declare at most one per project. */
32
+ export const Distribution = createResource(DISTRIBUTION_TYPE, "otel", {});
33
+ export function isDistributionEntity(value) {
34
+ return typeof value === "object" && value !== null && value.entityType === DISTRIBUTION_TYPE;
35
+ }
36
+ const CORE = "go.opentelemetry.io/collector";
37
+ const CONTRIB = "github.com/open-telemetry/opentelemetry-collector-contrib";
38
+ /**
39
+ * The Go module of every built-in, by `kind:type`. The core collector's
40
+ * components are in opentelemetry-collector, the rest in contrib; both are
41
+ * released at `COLLECTOR_PIN`'s version. A built-in added to `./components`
42
+ * needs a row here (distribution.test.ts checks).
43
+ */
44
+ export const BUILTIN_MODULES = Object.freeze({
45
+ "receiver:otlp": `${CORE}/receiver/otlpreceiver`,
46
+ "receiver:filelog": `${CONTRIB}/receiver/filelogreceiver`,
47
+ "receiver:hostmetrics": `${CONTRIB}/receiver/hostmetricsreceiver`,
48
+ "receiver:prometheus": `${CONTRIB}/receiver/prometheusreceiver`,
49
+ "receiver:k8s_cluster": `${CONTRIB}/receiver/k8sclusterreceiver`,
50
+ "receiver:kubeletstats": `${CONTRIB}/receiver/kubeletstatsreceiver`,
51
+ "processor:batch": `${CORE}/processor/batchprocessor`,
52
+ "processor:memory_limiter": `${CORE}/processor/memorylimiterprocessor`,
53
+ "processor:attributes": `${CONTRIB}/processor/attributesprocessor`,
54
+ "processor:deltatocumulative": `${CONTRIB}/processor/deltatocumulativeprocessor`,
55
+ "processor:k8sattributes": `${CONTRIB}/processor/k8sattributesprocessor`,
56
+ "processor:resourcedetection": `${CONTRIB}/processor/resourcedetectionprocessor`,
57
+ "processor:resource": `${CONTRIB}/processor/resourceprocessor`,
58
+ "processor:filter": `${CONTRIB}/processor/filterprocessor`,
59
+ "processor:redaction": `${CONTRIB}/processor/redactionprocessor`,
60
+ "processor:transform": `${CONTRIB}/processor/transformprocessor`,
61
+ "processor:probabilistic_sampler": `${CONTRIB}/processor/probabilisticsamplerprocessor`,
62
+ "processor:tail_sampling": `${CONTRIB}/processor/tailsamplingprocessor`,
63
+ "exporter:debug": `${CORE}/exporter/debugexporter`,
64
+ "exporter:otlp": `${CORE}/exporter/otlpexporter`,
65
+ "exporter:otlphttp": `${CORE}/exporter/otlphttpexporter`,
66
+ "exporter:googlecloud": `${CONTRIB}/exporter/googlecloudexporter`,
67
+ "exporter:prometheus": `${CONTRIB}/exporter/prometheusexporter`,
68
+ "exporter:loadbalancing": `${CONTRIB}/exporter/loadbalancingexporter`,
69
+ "exporter:clickhouse": `${CONTRIB}/exporter/clickhouseexporter`,
70
+ "connector:forward": `${CORE}/connector/forwardconnector`,
71
+ "connector:count": `${CONTRIB}/connector/countconnector`,
72
+ "connector:routing": `${CONTRIB}/connector/routingconnector`,
73
+ "connector:servicegraph": `${CONTRIB}/connector/servicegraphconnector`,
74
+ "connector:signaltometrics": `${CONTRIB}/connector/signaltometricsconnector`,
75
+ "connector:spanmetrics": `${CONTRIB}/connector/spanmetricsconnector`,
76
+ "connector:sum": `${CONTRIB}/connector/sumconnector`,
77
+ "extension:zpages": `${CORE}/extension/zpagesextension`,
78
+ "extension:health_check": `${CONTRIB}/extension/healthcheckextension`,
79
+ "extension:k8s_leader_elector": `${CONTRIB}/extension/k8sleaderelector`,
80
+ "extension:pprof": `${CONTRIB}/extension/pprofextension`,
81
+ });
82
+ const KIND_OF_LIST = {
83
+ receivers: "receiver",
84
+ processors: "processor",
85
+ exporters: "exporter",
86
+ connectors: "connector",
87
+ extensions: "extension",
88
+ };
89
+ const COMPONENT_LISTS = Object.keys(KIND_OF_LIST);
90
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
91
+ function isComponentClass(v) {
92
+ return typeof v === "function" && typeof v.definition === "object";
93
+ }
94
+ /** The module a component class is built from, at the version its config type follows. */
95
+ export function componentModule(def) {
96
+ if (def.builtin) {
97
+ const path = BUILTIN_MODULES[`${def.kind}:${def.type}`];
98
+ if (!path)
99
+ throw new Error(`otel: no Go module is recorded for the built-in ${def.kind} "${def.type}"`);
100
+ return { gomod: `${path} ${COLLECTOR_PIN.version}` };
101
+ }
102
+ if (!isUsablePin(def.pin)) {
103
+ throw new Error(`otel: the custom ${def.kind} "${def.type}" has no pin, so its Go module is unknown; list it as { gomod } instead`);
104
+ }
105
+ return { gomod: `${def.pin.source} ${def.pin.version}` };
106
+ }
107
+ function copyModule(entry) {
108
+ const out = { gomod: entry.gomod };
109
+ if (entry.import !== undefined)
110
+ out.import = entry.import;
111
+ if (entry.name !== undefined)
112
+ out.name = entry.name;
113
+ if (entry.path !== undefined)
114
+ out.path = entry.path;
115
+ return out;
116
+ }
117
+ function moduleOf(entry, list) {
118
+ if (isComponentClass(entry)) {
119
+ const def = entry.definition;
120
+ if (def.kind !== KIND_OF_LIST[list]) {
121
+ throw new Error(`otel: ${def.type} is a ${def.kind}, listed under the distribution's ${list}`);
122
+ }
123
+ return componentModule(def);
124
+ }
125
+ return copyModule(entry);
126
+ }
127
+ /** The builder manifest a distribution writes, as the object `ocb --config` reads. */
128
+ export function distributionManifest(dist) {
129
+ const p = isDistributionEntity(dist) ? dist.props : dist;
130
+ const out = {};
131
+ const d = {};
132
+ for (const [k, v] of Object.entries(p.dist ?? {}))
133
+ if (v !== undefined)
134
+ d[k] = v;
135
+ out.dist = d;
136
+ for (const list of COMPONENT_LISTS) {
137
+ const entries = p[list];
138
+ if (entries && entries.length > 0)
139
+ out[list] = entries.map((e) => moduleOf(e, list));
140
+ }
141
+ if (p.providers && p.providers.length > 0)
142
+ out.providers = p.providers.map(copyModule);
143
+ if (p.converters && p.converters.length > 0)
144
+ out.converters = p.converters.map(copyModule);
145
+ if (p.replaces && p.replaces.length > 0)
146
+ out.replaces = [...p.replaces];
147
+ if (p.excludes && p.excludes.length > 0)
148
+ out.excludes = [...p.excludes];
149
+ if (p.conf_resolver && p.conf_resolver.default_uri_scheme !== undefined) {
150
+ out.conf_resolver = { default_uri_scheme: p.conf_resolver.default_uri_scheme };
151
+ }
152
+ return out;
153
+ }
154
+ /** The builder manifest as the YAML `ocb --config` reads. */
155
+ export function distributionYaml(dist) {
156
+ return dump(distributionManifest(dist), { lineWidth: -1, noRefs: true });
157
+ }
158
+ /** The module path of a `gomod` line: everything before the version. */
159
+ function modulePath(gomod) {
160
+ return gomod.trim().split(/\s+/)[0];
161
+ }
162
+ const BUILTIN_BY_PATH = new Map(Object.entries(BUILTIN_MODULES).map(([key, path]) => [path, key.split(":")[1]]));
163
+ /**
164
+ * The component type a module builds, when it can be told: a built-in's
165
+ * module, or a module path ending `<type><kind>` as contrib's do
166
+ * (`.../exporter/datadogexporter` is `datadog`). Undefined otherwise.
167
+ */
168
+ export function moduleComponentType(kind, gomod) {
169
+ const path = modulePath(gomod);
170
+ const builtin = BUILTIN_BY_PATH.get(path);
171
+ if (builtin !== undefined)
172
+ return builtin;
173
+ const last = path.split("/").pop() ?? "";
174
+ return last.endsWith(kind) && last.length > kind.length ? last.slice(0, -kind.length) : undefined;
175
+ }
176
+ export function distributionComponents(dist) {
177
+ const p = isDistributionEntity(dist) ? dist.props : dist;
178
+ const types = { receiver: new Set(), processor: new Set(), exporter: new Set(), connector: new Set(), extension: new Set() };
179
+ const unknown = { receiver: [], processor: [], exporter: [], connector: [], extension: [] };
180
+ for (const list of COMPONENT_LISTS) {
181
+ const kind = KIND_OF_LIST[list];
182
+ for (const entry of p[list] ?? []) {
183
+ if (isComponentClass(entry)) {
184
+ types[kind].add(canonicalComponentType(kind, entry.definition.type));
185
+ continue;
186
+ }
187
+ const type = moduleComponentType(kind, entry.gomod);
188
+ if (type === undefined)
189
+ unknown[kind].push(entry.gomod);
190
+ else
191
+ types[kind].add(canonicalComponentType(kind, type));
192
+ }
193
+ }
194
+ return { types, unknown };
195
+ }
196
+ /**
197
+ * OTEL128: the components `config` declares that `dist` does not build. A
198
+ * collector built from the distribution refuses such a config at start with
199
+ * "unknown type". When a kind lists a module whose type can't be told from
200
+ * its path, a missing component may be that module, so it is a warning
201
+ * naming the module rather than an error.
202
+ */
203
+ export function distributionIssues(config, dist) {
204
+ const { types, unknown } = distributionComponents(dist);
205
+ const issues = [];
206
+ for (const kind of COMPONENT_KINDS) {
207
+ const section = config[SECTION_OF[kind]];
208
+ if (typeof section !== "object" || section === null)
209
+ continue;
210
+ for (const id of Object.keys(section)) {
211
+ const type = canonicalTypeOf(kind, id);
212
+ if (types[kind].has(type))
213
+ continue;
214
+ const unsure = unknown[kind];
215
+ issues.push({
216
+ code: "OTEL128",
217
+ severity: unsure.length > 0 ? "warning" : "error",
218
+ component: id,
219
+ message: `${kind} "${id}" is not in the Distribution, so a collector built from it does not know the type "${type}"` +
220
+ (unsure.length > 0
221
+ ? `, unless it is built by ${unsure.map((m) => `"${modulePath(m)}"`).join(", ")}, whose type can't be read from its path`
222
+ : `. Add it to the Distribution's ${SECTION_OF[kind]}, or remove it from the config`),
223
+ });
224
+ }
225
+ }
226
+ return issues;
227
+ }