3.3. Resource Detection Processor


Resource Detection Processor 识别主机资源详情与 OpenTelemetry 的资源语义标准保持一致。使用检测到的信息,此处理器可以在遥测数据中添加或替换资源值。这个处理器支持 trace 和 metrics。您可以将这个处理器与多个检测器一起使用,如 Docket 元数据检测器或 OTEL_RESOURCE_ATTRIBUTES 环境变量检测器。

重要

Resource Detection Processor 只是一个技术预览功能。技术预览功能不受红帽产品服务等级协议(SLA)支持,且功能可能并不完整。红帽不推荐在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。

有关红帽技术预览功能支持范围的更多信息,请参阅技术预览功能支持范围

Resource Detection Processor 所需的 OpenShift Container Platform 权限

kind: ClusterRole
metadata:
  name: otel-collector
rules:
- apiGroups: ["config.openshift.io"]
  resources: ["infrastructures", "infrastructures/status"]
  verbs: ["get", "watch", "list"]
# ...
Copy to Clipboard Toggle word wrap

使用 Resource Detection Processor 的 OpenTelemetry Collector

# ...
  config:
    processors:
      resourcedetection:
        detectors: [openshift]
        override: true
    service:
      pipelines:
        traces:
          processors: [resourcedetection]
        metrics:
          processors: [resourcedetection]
# ...
Copy to Clipboard Toggle word wrap

OpenTelemetry Collector 使用带有环境变量检测器的资源检测器

# ...
  config:
    processors:
      resourcedetection/env:
        detectors: [env] 
1

        timeout: 2s
        override: false
# ...
Copy to Clipboard Toggle word wrap

1
指定要使用的检测器。在本例中,指定了环境检测器。
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部