otel-collector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenTelemetry Collector

OpenTelemetry Collector

This skill covers the configuration surface of individual OpenTelemetry Collector components. It targets opentelemetry-collector and opentelemetry-collector-contrib.
It does not cover OTTL expressions (see
otel-ottl
), declarative SDK configuration (
otel-declarative-config
), or end-to-end pipeline design choices. Reach for those skills when the question is about transformation language, SDK setup, or pipeline composition.
本技能涵盖单个OpenTelemetry Collector组件的配置内容,针对opentelemetry-collectoropentelemetry-collector-contrib项目。
本技能覆盖OTTL表达式(详见
otel-ottl
技能)、声明式SDK配置(
otel-declarative-config
)或端到端管线设计选择。若问题涉及转换语言、SDK设置或管线组合,请使用对应技能。

Workflow

工作流程

  1. Identify the component. Find the
    type
    in the user's config or question (
    log_dedup
    ,
    interval
    ,
    otlp
    , …). Note that several components were renamed to snake_case across v0.146.0–v0.154.0 with deprecated aliases preserved — see Recent renames.
  2. Load the component page before answering. If the component is in the Component index, always read
    components/<type>/README.md
    first — the top-level index is only a routing aid, not enough evidence for an answer. Follow its Details index to the smallest relevant file: read
    configuration.md
    for versioned keys, defaults, or validation;
    quirks.md
    for stability, availability, failure behavior, or migration traps; and the other detail files only as the question requires. Do not infer exact configuration or status from the summary row or memory.
  3. If the component is not indexed, say so explicitly and fall back to the upstream README under
    processor/<name>/
    ,
    receiver/<name>/
    ,
    exporter/<name>/
    ,
    connector/<name>/
    , or
    extension/<name>/
    in opentelemetry-collector-contrib. Don't invent config keys from memory — Collector components evolve quickly.
  4. Apply Collector-wide conventions. Named instances (
    type/name
    ), stability levels, and pipeline placement rules in Collector-wide conventions apply to every component.
  5. Verify. Run the component page's Verification recipe —
    telemetrygen
    (see the
    otel-telemetrygen
    skill) plus a
    debug
    or
    file
    exporter — to confirm the component behaves as the docs claim. Alpha- and Development-stability components are common here, and behavior changes between releases. See Verification harness for how to run a recipe end-to-end.
  1. 识别组件:从用户的配置或问题中找到
    type
    字段(如
    log_dedup
    interval
    otlp
    等)。注意在v0.146.0–v0.154.0版本期间,多个组件被重命名为蛇形命名(snake_case),同时保留了旧名称作为已弃用的别名——详见近期重命名
  2. 加载组件页面后再作答:若组件在组件索引中,务必先阅读
    components/<type>/README.md
    ——顶层索引仅作为导航辅助,不足以作为回答依据。按照其详情索引找到最相关的细分文件:查看
    configuration.md
    获取版本化配置键、默认值或验证规则;查看
    quirks.md
    获取稳定性、可用性、故障行为或迁移陷阱信息;其他详情文件仅在问题需要时查阅。不要从摘要行或记忆中推断准确的配置或状态。
  3. 若组件未被索引:明确告知用户,并参考opentelemetry-collector-contrib
    processor/<name>/
    receiver/<name>/
    exporter/<name>/
    connector/<name>/
    extension/<name>/
    下的上游README文档。不要凭记忆编造配置键——Collector组件迭代速度很快。
  4. 应用Collector全局约定:命名实例(
    type/name
    )、稳定性级别和管线放置规则等Collector全局约定适用于所有组件。
  5. 验证:运行组件页面的验证方案——使用
    telemetrygen
    (详见
    otel-telemetrygen
    技能)搭配
    debug
    file
    导出器——确认组件行为与文档描述一致。Alpha和Development稳定性级别的组件很常见,且不同版本间行为可能变化。详见验证工具了解如何端到端运行方案。

Component index

组件索引

Each component is a directory under
components/<type>/
. The
File
column points at the lean
README.md
(metadata, description, main use-cases, and a Details index); the full config reference, verification recipe, advanced use-cases, and quirks live in on-demand detail files linked from that README.
Coverage is intentionally selective. If a component is not indexed here, fall back to the upstream component README for the user's Collector version.
TypeFileKindSignalsStabilitySummary
log_dedup
components/log_dedup/README.md
processorlogsAlphaDeduplicates identical log records over a time window; emits one aggregated log with a count. Renamed from
logdedup
in v0.151.0; alias preserved.
interval
components/interval/README.md
processormetricsAlphaBuffers cumulative monotonic metrics (and optionally gauges/summaries) and emits the latest value once per interval. Delta and non-monotonic sums pass through unchanged.
tail_sampling
components/tail_sampling/README.md
processortracesBetaBuffers whole traces and makes a single keep/drop decision after a wait window via policies. Requires a
load_balancing
layer to scale across instances.
drain
components/drain/README.md
processorlogsAlphaClusters log bodies and annotates each record with a template. v0.158 replaced
extract_parameters
/
params_attribute
with
masking_rules
+
parameter_key_prefix
for named values and
emit_wildcards
+
wildcards_attribute
for remaining
<*>
positions.
redaction
components/redaction/README.md
processortraces, logs, metricsBeta (traces), Alpha (logs/metrics)Allow/block-list masking or removal of sensitive attribute keys and values, with hashing and URL/DB sanitizers.
filter
components/filter/README.md
processortraces, metrics, logs, profilesAlpha (traces/metrics/logs), Development (profiles)Drops spans, metric data points, log records, and profiles that match OTTL conditions (or legacy metric-name / severity filters). The most direct telemetry-volume lever.
transform
components/transform/README.md
processortraces, metrics, logs, profilesBeta (traces/metrics/logs), Development (profiles)Applies OTTL statements to mutate spans, metric data points, log records, and profiles in place (rename/redact/convert/aggregate attributes). The OTTL language itself lives in the
otel-ottl
skill.
probabilistic_sampler
components/probabilistic_sampler/README.md
processortraces, logsBeta (traces), Alpha (logs)Head sampling — deterministically keeps a configured percentage of traces/logs by hashing the trace ID (or an attribute). The cheaper, stateless counterpart to
tail_sampling
.
attributes
components/attributes/README.md
processortraces, metrics, logsBetaModifies span/log/datapoint attributes via an ordered action list (insert/update/upsert/delete/hash/extract/convert), scoped by include/exclude matching.
resource
components/resource/README.md
processortraces, metrics, logs, profilesBeta (traces/metrics/logs), Development (profiles)Modifies the resource attributes of telemetry via the same action grammar as
attributes
(e.g. set
service.name
, drop noisy resource keys). No include/exclude matching.
k8s_attributes
components/k8s_attributes/README.md
processortraces, metrics, logs, profilesBeta (traces/metrics/logs), Development (profiles)Enriches telemetry with Kubernetes pod/namespace/node/workload metadata, associating each record to a pod by IP or resource attribute. Renamed from
k8sattributes
in v0.146.0; alias preserved.
routing
components/routing/README.md
connectortraces, metrics, logsAlphaRoutes same-signal telemetry to different pipelines by OTTL
condition
/
statement
per context; ordered table, first match wins,
default_pipelines
fallback. Replaces the deprecated
routingprocessor
.
memory_limiter
components/memory_limiter/README.md
processortraces, metrics, logs, profilesBeta (traces/metrics/logs), Alpha (profiles)Safety valve against OOM: refuses data with backpressure when Go heap exceeds a soft/hard limit. Its receiver-middleware extension reached Beta in v0.158 but is absent from stock distributions; the bundled processor remains the standard form.
load_balancing
components/load_balancing/README.md
exportertraces, logs, metricsBeta (traces/logs), Development (metrics)Distributes telemetry across downstream Collectors via a consistent-hash ring keyed on trace ID /
service.name
(etc.), pinning related records to one backend. The standard way to scale
tail_sampling
/
span_metrics
. Renamed from
loadbalancing
in v0.153.0; alias preserved.
otlp
(receiver)
components/otlp/README.md
receivertraces, metrics, logs, profilesStable (traces/metrics/logs), Alpha (profiles)The canonical OTLP ingress over gRPC (
4317
) and/or HTTP (
4318
, protobuf + JSON).
protocols:
block, at least one required. Default endpoint is
localhost
, not
0.0.0.0
— must be set explicitly to receive containerized traffic.
otlp_grpc
(exporter)
components/otlp_exporter/README.md
exportertraces, metrics, logs, profilesStable (traces/metrics/logs), Alpha (profiles)Sends OTLP over gRPC to a downstream endpoint; gzip by default. Built-in
sending_queue.batch
(flush 200ms / 8192 items) plus
retry_on_failure
; a separate
batch
processor remains supported but may be redundant. Renamed from
otlp
in core v1.50.0; alias preserved.
file_log
(receiver)
components/file_log/README.md
receiverlogsBetaTails log files (glob
include
), turns each line/entry into a log record, and parses it via a stanza
operators
pipeline (json/regex/severity/timestamp/recombine). Fingerprint + offset tracking across rotation;
storage
for durable offsets.
start_at
defaults to
end
(existing files look empty). Renamed from
filelog
in v0.149.0; alias preserved.
resource_detection
components/resource_detection/README.md
processortraces, metrics, logs, profilesBeta (traces/metrics/logs), Development (profiles)Auto-detects resource attributes via an ordered
detectors
list. v0.158 added top-level
fail_on_missing_metadata
; older per-detector forms are deprecated. Renamed from
resourcedetection
in v0.153.0; alias preserved.
file_storage
components/file_storage/README.md
extension— (not pipeline-scoped)BetaPersists component state to local disk (bbolt) so it survives a Collector restart: receiver read offsets (
storage:
), exporter persistent send queues (
sending_queue.storage:
), and stateful-processor decision caches. One bbolt file per consumer;
directory
must exist unless
create_directory: true
. Not placed in a pipeline — listed under
service.extensions:
and referenced by other components.
prometheus
(receiver)
components/prometheus/README.md
receivermetricsBetaScrapes Prometheus-format HTTP endpoints and converts them to OTLP metrics, embedding
prometheus/prometheus
's scrape manager — the
config:
block is the same YAML as
prometheus.yml
(
global
,
scrape_configs
,
scrape_config_files
, service discovery, relabeling). Extra keys:
trim_metric_suffixes
,
target_allocator
(sharded targets from the OTel Operator),
api_server
(debug API). Scrape-only: rejects
remote_write
/
remote_read
/
rule_files
/alerting. Stateful, does not auto-shard across replicas.
prometheus
(exporter)
components/prometheus_exporter/README.md
exportermetricsBetaExposes pipeline metrics in Prometheus exposition format on a
/metrics
HTTP endpoint for a Prometheus server to scrape (pull, not push — contrast
prometheus_remote_write
). Embeds
confighttp.ServerConfig
;
endpoint
required (no default). In-memory accumulator keeps the latest value per series, dropping it after
metric_expiration
(5m).
namespace
,
const_labels
,
send_timestamps
,
resource_to_telemetry_conversion
,
enable_open_metrics
(exemplars),
without_scope_info
;
add_metric_suffixes
deprecated in favor of
translation_strategy
. Same
prometheus
type string as the receiver, different class.
prometheus_remote_write
(exporter)
components/prometheus_remote_write/README.md
exportermetricsBetaPushes OTLP metrics as Prometheus Remote Write. v0.158 added
include_metadata_keys
(reserved protocol headers are rejected case-insensitively),
convert_explicit_histograms_to_nhcb
, and dependent
keep_classic_histograms
. Uses TLS and snappy by default plus
remote_write_queue
(not
sending_queue
); RW2 remains gated and in development.
每个组件对应
components/<type>/
下的一个目录。
File
列指向精简版
README.md
(包含元数据、描述、主要用例和详情索引);完整的配置参考、验证方案、高级用例和注意事项存放在该README链接的按需加载详情文件中。
覆盖范围为选择性收录。若组件未在此索引中,请根据用户使用的Collector版本参考上游组件README。
类型文件类别信号稳定性摘要
log_dedup
components/log_dedup/README.md
processorlogsAlpha在时间窗口内对重复的日志记录进行去重;生成一条包含计数的聚合日志。在v0.151.0版本中从
logdedup
重命名而来,保留旧别名。
interval
components/interval/README.md
processormetricsAlpha缓冲累积单调指标(可选包含仪表盘/摘要),并按指定间隔输出最新值。增量和非单调求和数据直接通过。
tail_sampling
components/tail_sampling/README.md
processortracesBeta缓冲完整链路,并在等待窗口后通过策略做出保留/丢弃的单一决策。需要
load_balancing
层实现跨实例扩展。
drain
components/drain/README.md
processorlogsAlpha聚类日志内容,并为每条记录添加模板注释。v0.158版本用
masking_rules
+
parameter_key_prefix
(命名值)和
emit_wildcards
+
wildcards_attribute
(剩余
<*>
位置)替代了
extract_parameters
/
params_attribute
redaction
components/redaction/README.md
processortraces, logs, metricsBeta(traces), Alpha(logs/metrics)通过允许/阻止列表屏蔽或移除敏感属性键和值,支持哈希、URL/DB清理功能。
filter
components/filter/README.md
processortraces, metrics, logs, profilesAlpha(traces/metrics/logs), Development(profiles)丢弃符合OTTL条件(或旧版指标名称/严重度过滤器)的链路、指标数据点、日志记录和性能剖析数据。是最直接的遥测流量控制工具。
transform
components/transform/README.md
processortraces, metrics, logs, profilesBeta(traces/metrics/logs), Development(profiles)应用OTTL语句原地修改链路、指标数据点、日志记录和性能剖析数据(重命名/脱敏/转换/聚合属性)。OTTL语言本身属于
otel-ottl
技能范畴。
probabilistic_sampler
components/probabilistic_sampler/README.md
processortraces, logsBeta(traces), Alpha(logs)头部采样——通过哈希链路ID(或属性)确定性地保留指定比例的链路/日志。是
tail_sampling
更廉价、无状态的替代方案。
attributes
components/attributes/README.md
processortraces, metrics, logsBeta通过有序动作列表(插入/更新/插入更新/删除/哈希/提取/转换)修改链路/日志/数据点的属性,可通过包含/排除规则限定范围。
resource
components/resource/README.md
processortraces, metrics, logs, profilesBeta(traces/metrics/logs), Development(profiles)通过与
attributes
相同的动作语法修改遥测的资源属性(如设置
service.name
、移除冗余资源键)。无包含/排除匹配规则。
k8s_attributes
components/k8s_attributes/README.md
processortraces, metrics, logs, profilesBeta(traces/metrics/logs), Development(profiles)为遥测补充Kubernetes Pod/命名空间/节点/工作负载元数据,通过IP或资源属性将每条记录关联到对应的Pod。在v0.146.0版本中从
k8sattributes
重命名而来,保留旧别名。
routing
components/routing/README.md
connectortraces, metrics, logsAlpha通过每个上下文的OTTL
condition
/
statement
将同信号遥测路由到不同管线;按表顺序匹配,首个匹配项生效,
default_pipelines
作为回退。替代已弃用的
routingprocessor
memory_limiter
components/memory_limiter/README.md
processortraces, metrics, logs, profilesBeta(traces/metrics/logs), Alpha(profiles)防止内存溢出的安全阀门:当Go堆内存超过软/硬限制时,通过背压拒绝接收数据。其接收器中间件扩展在v0.158版本达到Beta级别,但未包含在标准发行版中;捆绑的processor仍是标准形式。
load_balancing
components/load_balancing/README.md
exportertraces, logs, metricsBeta(traces/logs), Development(metrics)通过基于链路ID/
service.name
等的一致性哈希环,将遥测分发到下游Collector,将相关记录固定到一个后端。是
tail_sampling
/
span_metrics
扩展的标准方式。在v0.153.0版本中从
loadbalancing
重命名而来,保留旧别名。
otlp
(receiver)
components/otlp/README.md
receivertraces, metrics, logs, profilesStable(traces/metrics/logs), Alpha(profiles)标准的OTLP入口,支持gRPC(
4317
)和/或HTTP(
4318
,protobuf + JSON)协议。必须配置
protocols:
块,至少包含一种协议。默认端点为
localhost
而非
0.0.0.0
——若要接收容器化流量需显式设置。
otlp_grpc
(exporter)
components/otlp_exporter/README.md
exportertraces, metrics, logs, profilesStable(traces/metrics/logs), Alpha(profiles)通过gRPC将OTLP数据发送到下游端点;默认启用gzip压缩。内置
sending_queue.batch
(刷新间隔200ms / 8192条数据)和
retry_on_failure
;单独的
batch
processor仍受支持,但可能冗余。在核心v1.50.0版本中从
otlp
重命名而来,保留旧别名。
file_log
(receiver)
components/file_log/README.md
receiverlogsBeta追踪日志文件(支持通配符
include
),将每行/每条条目转换为日志记录,并通过stanza
operators
管线解析(json/regex/严重度/时间戳/合并)。支持跨文件轮转的指纹+偏移量跟踪;
storage
用于持久化偏移量。
start_at
默认值为
end
(现有文件视为空)。在v0.149.0版本中从
filelog
重命名而来,保留旧别名。
resource_detection
components/resource_detection/README.md
processortraces, metrics, logs, profilesBeta(traces/metrics/logs), Development(profiles)通过有序的
detectors
列表自动检测资源属性。v0.158版本新增顶层
fail_on_missing_metadata
;旧版的每个检测器配置形式已被弃用。在v0.153.0版本中从
resourcedetection
重命名而来,保留旧别名。
file_storage
components/file_storage/README.md
extension—(不属于管线范围)Beta将组件状态持久化到本地磁盘(bbolt),使其在Collector重启后仍保留:接收器读取偏移量(
storage:
)、导出器持久化发送队列(
sending_queue.storage:
)和有状态processor的决策缓存。每个消费者对应一个bbolt文件;
directory
必须存在,除非设置
create_directory: true
。无需放置在管线中——在
service.extensions:
下列出,并被其他组件引用。
prometheus
(receiver)
components/prometheus/README.md
receivermetricsBeta抓取Prometheus格式的HTTP端点并转换为OTLP指标,嵌入
prometheus/prometheus
的抓取管理器——
config:
块的YAML格式与
prometheus.yml
相同(
global
scrape_configs
scrape_config_files
、服务发现、重新标记)。额外配置键:
trim_metric_suffixes
target_allocator
(来自OTel Operator的分片目标)、
api_server
(调试API)。仅支持抓取:拒绝
remote_write
/
remote_read
/
rule_files
/告警功能。有状态,不支持跨副本自动分片。
prometheus
(exporter)
components/prometheus_exporter/README.md
exportermetricsBeta
/metrics
HTTP端点以Prometheus暴露格式提供管线指标,供Prometheus服务器抓取(拉取,而非推送——与
prometheus_remote_write
对比)。嵌入
confighttp.ServerConfig
;必须配置
endpoint
(无默认值)。内存累加器保留每个指标系列的最新值,在
metric_expiration
(5分钟)后丢弃。支持
namespace
const_labels
send_timestamps
resource_to_telemetry_conversion
enable_open_metrics
(示例)、
without_scope_info
add_metric_suffixes
已被弃用,改用
translation_strategy
。与接收器使用相同的
prometheus
类型字符串,但属于不同类别。
prometheus_remote_write
(exporter)
components/prometheus_remote_write/README.md
exportermetricsBeta将OTLP指标以Prometheus Remote Write格式推送。v0.158版本新增
include_metadata_keys
(保留的协议头会被大小写不敏感地拒绝)、
convert_explicit_histograms_to_nhcb
及依赖的
keep_classic_histograms
。默认使用TLS和snappy压缩,搭配
remote_write_queue
(而非
sending_queue
);RW2仍处于开发阶段并受限制。

Collector-wide conventions

Collector全局约定

Named instances

命名实例

Every component type supports the
type/name
pattern so the same type can be configured more than once. The pipeline references the named form:
yaml
processors:
  log_dedup/health-checks:
    interval: 30s
    conditions:
      - 'log.attributes["log.type"] == "health_check"'
  log_dedup/access-logs:
    interval: 10s

service:
  pipelines:
    logs/health:
      processors: [log_dedup/health-checks]
    logs/access:
      processors: [log_dedup/access-logs]
所有组件类型都支持
type/name
模式,以便同一类型可配置多个实例。管线中引用命名形式:
yaml
processors:
  log_dedup/health-checks:
    interval: 30s
    conditions:
      - 'log.attributes["log.type"] == "health_check"'
  log_dedup/access-logs:
    interval: 10s

service:
  pipelines:
    logs/health:
      processors: [log_dedup/health-checks]
    logs/access:
      processors: [log_dedup/access-logs]

Stability levels

稳定性级别

Components publish a stability level per signal. Treat these as load-bearing when recommending production use:
LevelUse in
DevelopmentTests and prototypes only — breaking changes expected.
AlphaLimited, non-critical workloads — config keys can still change.
BetaProduction viable — breaking changes rare.
StableProduction — backward compatibility guaranteed.
Stability now varies per component — and per signal for multi-signal components (e.g.
redaction
is Beta for traces but Alpha for logs/metrics). Don't assume a single level for the indexed set: check each component's README header metadata table for the authoritative stability and surface it when the user asks about production readiness.
组件按信号发布稳定性级别。建议在推荐生产使用时严格遵循:
级别使用场景
Development仅用于测试和原型——可能存在破坏性变更。
Alpha有限的非关键工作负载——配置键仍可能变更。
Beta适用于生产环境——破坏性变更极少。
Stable生产环境——保证向后兼容性。
稳定性现在因组件而异——多信号组件的稳定性还因信号不同而不同(例如
redaction
对traces是Beta级别,对logs/metrics是Alpha级别)。不要假设所有索引组件的稳定性级别一致:当用户询问生产就绪性时,需查看每个组件README头部的元数据表获取权威的稳定性信息并告知用户。

Recent renames

近期重命名

Many components were renamed to snake_case across v0.146.0–v0.154.0. The legacy names remain as deprecated aliases — old configs keep working but new configs should use the new names. Check the upstream component README for the exact rename version before flagging a config as broken.
Examples:
logdedup
log_dedup
,
hostmetrics
host_metrics
,
spanmetrics
span_metrics
,
servicegraph
service_graph
,
k8sattributes
k8s_attributes
, plus several
_log
and
_check
receivers.
在v0.146.0–v0.154.0版本期间,许多组件被重命名为蛇形命名(snake_case)。旧名称仍作为已弃用的别名保留——旧配置仍可正常工作,但新配置应使用新名称。在标记配置为无效前,请先查看上游组件README确认具体的重命名版本。
示例:
logdedup
log_dedup
hostmetrics
host_metrics
spanmetrics
span_metrics
servicegraph
service_graph
k8sattributes
k8s_attributes
,以及多个
_log
_check
接收器。

Pipeline placement

管线放置

Two rules of thumb that apply across components:
  • memory_limiter
    belongs first in any processor list, before anything that allocates buffers (
    log_dedup
    ,
    transform
    ,
    tail_sampling
    , …).
  • The
    otlp_grpc
    exporter's
    sending_queue.batch
    is enabled by default. The separate
    batch
    processor remains Beta and supported; use it when pipeline-level batching is needed, place it after data-dropping processors, and avoid unintentional double batching when an exporter already batches.
适用于所有组件的两条经验法则:
  • memory_limiter
    应放在processor列表的首位,在任何会分配缓冲区的组件(如
    log_dedup
    transform
    tail_sampling
    等)之前。
  • otlp_grpc
    导出器的
    sending_queue.batch
    默认启用。单独的
    batch
    processor仍为Beta级别且受支持;当需要管线级批处理时使用它,将其放在数据丢弃类processor之后,当导出器已支持批处理时避免无意的双重批处理。

Verification harness

验证工具

Each component page's Verification section gives a config, a
telemetrygen
command, and the expected output. To run any of them:
  1. Save the YAML to a file and start a collector that bundles the component — for components in the
    contrib
    /
    k8s
    distributions,
    otelcol-contrib --config <file>.yaml
    ; for components not in any distribution, build a custom collector with the OpenTelemetry Collector Builder (OCB) first.
  2. Send telemetry with
    telemetrygen
    (see the
    otel-telemetrygen
    skill).
  3. Watch the
    debug
    exporter's stdout (or the
    file
    exporter's output) for the expected result.
The Verification configs are minimal repros: they omit
memory_limiter
and other production scaffolding on purpose, to isolate the component under test. Don't copy them verbatim into production.
每个组件页面的验证部分提供了配置、
telemetrygen
命令和预期输出。运行任意方案的步骤:
  1. 将YAML保存到文件并启动包含该组件的Collector——对于
    contrib
    /
    k8s
    发行版中的组件,使用
    otelcol-contrib --config <file>.yaml
    ;对于未包含在任何发行版中的组件,先使用OpenTelemetry Collector Builder (OCB)构建自定义Collector。
  2. 使用
    telemetrygen
    发送遥测数据(详见
    otel-telemetrygen
    技能)。
  3. 查看
    debug
    导出器的标准输出(或
    file
    导出器的输出)确认预期结果。
验证配置是最小复现示例:为了隔离测试组件,刻意省略了
memory_limiter
和其他生产环境脚手架。不要直接复制到生产环境中使用。

Adding a new component to this skill

向本技能添加新组件

When extending coverage:
  1. Create the directory
    components/<type>/
    .
    Files carry no frontmatter — only
    SKILL.md
    has frontmatter.
  2. Write a lean
    README.md
    — always loaded, kept small:
    • Header metadata table — kind,
      type
      name, signals, per-signal stability, distributions, Go module, upstream README link, and a rename note if the component was renamed.
    • Description — what the component does and the mechanism, in 1–2 tight paragraphs (push detailed mechanism/reference into
      configuration.md
      ).
    • Main use-cases — "Use when" / "Avoid when".
    • Related components — cross-links.
    • Details index — a bullet list where each item links a detail file followed by an em dash and a short description of its contents (e.g.
      - [Configuration](configuration.md) — config keys, defaults, validation
      ), so the reader loads only what a question needs.
  3. Split the rest into on-demand detail files under the same directory:
    • configuration.md
      — full config-reference table (key, type, default, validation) plus any mechanism/reference tables.
    • verification.md
      — a
      telemetrygen
      +
      debug
      /
      file
      exporter recipe that proves the documented behavior; cross-reference the
      otel-telemetrygen
      skill. Verify every
      telemetrygen
      flag against that skill — never assert a flag that doesn't exist.
      If
      telemetrygen
      can't produce the input the component needs, say so and point to an alternative (OTTL/
      transform
      , a custom emitter). Keep the config a minimal repro (see Verification harness).
    • advanced.md
      — named instances, multi-pipeline setups, combinations, and edge configs.
    • quirks.md
      — gotchas, stability caveats, memory model, a validation-error→fix table, anti-patterns, and troubleshooting.
    • Split a heavy section into its own file when it's large (e.g.
      policies.md
      for a big policy catalog); merge trivial sections into a sibling rather than create a stub. Repoint any in-page anchor links that now cross files.
  4. Use
    components/log_dedup/
    and
    components/interval/
    as reference implementations
    of this structure.
  5. Add a row to the Component index above (the
    File
    column points at
    components/<type>/README.md
    ).
  6. Update the description trigger phrases in this file's frontmatter if the new component introduces a clearly distinct user-facing keyword.
扩展覆盖范围时:
  1. 创建目录
    components/<type>/
    。文件无需前置内容——仅
    SKILL.md
    包含前置内容。
  2. 编写精简版
    README.md
    ——始终加载,保持内容简洁:
    • 头部元数据表——类别、
      type
      名称、信号、按信号划分的稳定性、发行版、Go模块、上游README链接,以及组件重命名说明(若有)。
    • 描述——组件功能和机制,1-2段简洁文字(将详细机制/参考内容放到
      configuration.md
      中)。
    • 主要用例——"适用场景" / "避免场景"。
    • 相关组件——交叉链接。
    • 详情索引——项目符号列表,每个条目链接到详情文件,后跟短横线和内容描述(例如
      - [配置](configuration.md) — 配置键、默认值、验证规则
      ),以便读者仅加载问题所需内容。
  3. 将剩余内容拆分为按需加载的详情文件,放在同一目录下:
    • configuration.md
      ——完整的配置参考表(键、类型、默认值、验证规则)及任何机制/参考表。
    • verification.md
      ——
      telemetrygen
      +
      debug
      /
      file
      导出器的验证方案,用于验证文档描述的行为;交叉引用
      otel-telemetrygen
      技能。**务必对照该技能验证每个
      telemetrygen
      参数——切勿断言不存在的参数。**若
      telemetrygen
      无法生成组件所需的输入,请明确说明并指向替代方案(OTTL/
      transform
      、自定义发射器)。保持配置为最小复现示例(详见验证工具)。
    • advanced.md
      ——命名实例、多管线设置、组合方式和边缘配置。
    • quirks.md
      ——注意事项、稳定性警告、内存模型、验证错误→修复表、反模式和故障排除。
    • 当某部分内容较多时,将其拆分为独立文件(例如大型策略目录的
      policies.md
      );将琐碎内容合并到相邻文件中,避免创建空文件。更新所有现在跨文件的页内锚点链接。
  4. components/log_dedup/
    components/interval/
    作为结构参考实现
  5. 在上方的组件索引中添加一行
    File
    列指向
    components/<type>/README.md
    )。
  6. 若新组件引入了明显独特的用户可见关键词,请更新本文件前置内容中的描述触发短语。",