opentelemetry-collector-k8s Docker 镜像下载 - 轩辕镜像
opentelemetry-collector-k8s 镜像详细信息和使用指南
opentelemetry-collector-k8s 镜像标签列表和版本信息
opentelemetry-collector-k8s 镜像拉取命令和加速下载
opentelemetry-collector-k8s 镜像使用说明和配置指南
Docker 镜像加速服务 - 轩辕镜像平台
国内开发者首选的 Docker 镜像加速平台
极速拉取 Docker 镜像服务
相关 Docker 镜像推荐
热门 Docker 镜像下载
opentelemetry-collector-k8s 镜像详细信息
opentelemetry-collector-k8s 镜像标签列表
opentelemetry-collector-k8s 镜像使用说明
opentelemetry-collector-k8s 镜像拉取命令
Docker 镜像加速服务
轩辕镜像平台优势
镜像下载指南
相关 Docker 镜像推荐
opentelemetry-collector-k8s 镜像详细说明
opentelemetry-collector-k8s 使用指南
opentelemetry-collector-k8s 配置说明
opentelemetry-collector-k8s 官方文档
OpenTelemetry Collector (k8s) 镜像文档
镜像概述和主要用途
OpenTelemetry Collector (k8s) 镜像为 Kubernetes 环境定制,是 OpenTelemetry 可观测性数据处理管道的核心组件。该镜像整合了 open-telemetry/opentelemetry-collector 仓库的核心组件及contrib 扩展组件,专为在 Kubernetes 集群中运行设计,提供可观测性数据(traces、metrics、logs)的统一收集、处理、转换与导出能力。
核心功能和特性
- 组件完整性:集成核心组件(基础接收器、处理器、导出器)与 contrib 组件(Kubernetes 特定扩展、第三方集成插件),满足复杂场景需求。
- Kubernetes 原生适配:支持从 Kubernetes 资源(Pod、Service、Node 等)自动发现目标、附加元数据,适配集群网络与调度机制。
- 全链路数据处理:支持 traces、metrics、logs 三类可观测性数据的收集、过滤、转换、聚合、采样等处理操作。
- 多后端兼容性:可导出数据至主流可观测性平台(如 Prometheus、Jaeger、Grafana、AWS CloudWatch、Azure Monitor 等)。
- 可扩展架构:通过插件化接收器(Receiver)、处理器(Processor)、导出器(Exporter)扩展功能,支持自定义组件集成。
- 轻量高效:优化资源占用,支持动态配置更新,适配 Kubernetes 资源限制与请求机制。
使用场景和适用范围
适用环境
- Kubernetes 集群(包括自建集群、云厂商托管集群如 EKS、GKE、AKS 等)。
典型场景
- 微服务可观测性:收集分布式微服务的 traces、metrics、logs,统一处理后导出至后端平台。
- 集群级监控:采集 Kubernetes 节点、Pod、容器的系统指标与日志,实现集群健康状态监控。
- 多源数据聚合:整合应用埋点数据、基础设施监控数据、第三方服务日志,统一数据格式与标准。
- 数据治理与合规:对敏感数据脱敏、按规则过滤无效数据、添加统一标签(如环境、集群名称),满足合规需求。
适用用户
- Kubernetes 管理员、DevOps 工程师、SRE 团队、可观测性平台维护人员。
使用方法和配置说明
基本部署方式
1. Docker 运行(单机测试)
bashdocker run -d \ --name otel-collector-k8s \ -p 4317:4317 # OTLP gRPC 接收器端口 \ -p 4318:4318 # OTLP HTTP 接收器端口 \ -p 8888:8888 # 指标暴露端口(用于自身监控) \ -v /path/to/otel-collector-config.yaml:/etc/otelcol/config.yaml \ otel/opentelemetry-collector-k8s:latest
注:
otel/opentelemetry-collector-k8s为***镜像名称,实际使用时需替换为具体版本标签(如0.91.0)。
2. Docker Compose 配置(本地测试)
yamlversion: '3' services: otel-collector: image: otel/opentelemetry-collector-k8s:latest container_name: otel-collector-k8s ports: - "4317:4317" # OTLP gRPC - "4318:4318" # OTLP HTTP - "8888:8888" # 自身指标暴露 volumes: - ./otel-collector-config.yaml:/etc/otelcol/config.yaml environment: - OTEL_LOG_LEVEL=info # 日志级别:debug/info/warn/error restart: unless-stopped
3. Kubernetes 部署(生产环境)
推荐通过 Deployment 或 DaemonSet 部署(根据数据收集范围选择),以下为 Deployment 示例:
1. 创建配置文件 ConfigMap
otel-collector-config.yaml:
yamlapiVersion: v1 kind: ConfigMap metadata: name: otel-collector-config namespace: observability data: config.yaml: | receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 prometheus: config: scrape_configs: - job_name: 'otel-collector' static_configs: - targets: ['localhost:8888'] processors: batch: # 批量处理以减少导出请求数 resourcedetection: # 自动添加 Kubernetes 资源元数据 detectors: [k8s] timeout: 10s override: false exporters: logging: # 控制台输出(调试用) loglevel: info prometheusremotewrite: # 导出至 Prometheus endpoint: "[***]" service: pipelines: traces: receivers: [otlp] processors: [batch, resourcedetection] exporters: [logging] metrics: receivers: [otlp, prometheus] processors: [batch, resourcedetection] exporters: [logging, prometheusremotewrite]
2. 创建 Deployment
otel-collector-deployment.yaml:
yamlapiVersion: apps/v1 kind: Deployment metadata: name: otel-collector namespace: observability spec: replicas: 1 selector: matchLabels: app: otel-collector template: metadata: labels: app: otel-collector spec: containers: - name: otel-collector image: otel/opentelemetry-collector-k8s:latest resources: limits: cpu: 1000m memory: 1Gi requests: cpu: 200m memory: 256Mi ports: - containerPort: 4317 # OTLP gRPC - containerPort: 4318 # OTLP HTTP - containerPort: 8888 # 自身指标 volumeMounts: - name: config-volume mountPath: /etc/otelcol/config.yaml subPath: config.yaml env: - name: OTEL_LOG_LEVEL value: "info" - name: K8S_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName volumes: - name: config-volume configMap: name: otel-collector-config
详细配置说明
配置文件结构
Collector 通过配置文件(默认路径 /etc/otelcol/config.yaml)定义数据处理流程,核心配置项包括:
| 配置项 | 说明 |
|---|---|
receivers | 定义数据来源(如 OTLP、Prometheus、Jaeger、Filelog 等),每个接收器含特定配置(端口、协议、采集规则)。 |
processors | 定义数据处理逻辑(如 batch 批量处理、filter 数据过滤、resourcedetection 元数据添加、sampling 采样等)。 |
exporters | 定义数据导出目标(如 logging 控制台、otlp 远程 OTLP 服务、prometheusremotewrite Prometheus 写入接口、jaeger Jaeger 后端等)。 |
service | 定义数据管道(pipelines),将接收器、处理器、导出器关联,按数据类型(traces/metrics/logs)划分。 |
环境变量
Collector 支持通过环境变量调整运行时行为,常用变量:
| 变量名 | 说明 | 默认值 |
|---|---|---|
OTEL_CONFIG_FILE | 配置文件路径 | /etc/otelcol/config.yaml |
OTEL_LOG_LEVEL | 日志级别(debug/info/warn/error) | info |
OTEL_RESOURCE_ATTRIBUTES | 全局资源属性(键值对,如 service.name=my-service,cluster=prod) | 空 |
K8S_NODE_NAME | Kubernetes 节点名称(用于 resourcedetection 处理器,通常通过 downward API 注入) | 自动从节点元数据获取 |
参考链接
- ***仓库:open-telemetry/opentelemetry-collector-releases
- ***文档:OpenTelemetry Collector 文档
- 配置示例:Collector 配置示例库
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务
常见问题
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
轩辕镜像下载加速使用手册
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
登录仓库拉取
通过 Docker 登录认证访问私有仓库
Linux
在 Linux 系统配置镜像加速服务
Windows/Mac
在 Docker Desktop 配置镜像加速
Docker Compose
Docker Compose 项目配置加速
K8s Containerd
Kubernetes 集群配置 Containerd
宝塔面板
在宝塔面板一键配置镜像加速
群晖
Synology 群晖 NAS 配置加速
飞牛
飞牛 fnOS 系统配置镜像加速
极空间
极空间 NAS 系统配置加速服务
爱快路由
爱快 iKuai 路由系统配置加速
绿联
绿联 NAS 系统配置镜像加速
威联通
QNAP 威联通 NAS 配置加速
Podman
Podman 容器引擎配置加速
Singularity/Apptainer
HPC 科学计算容器配置加速
其他仓库配置
ghcr、Quay、nvcr 等镜像仓库
专属域名拉取
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429