Kubernetes 的 OpenTelemetry Operator

Kubernetes Operator 的一个实现,使用 OpenTelemetry 插桩库管理 Collector 和工作负载的自动插桩。

简介

OpenTelemetry OperatorKubernetes Operator 的一个实现。

Operator 管理以下内容:

入门指南

要在已有集群中安装 Operator,请确保已安装 cert-manager,然后运行:

kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml

一旦 opentelemetry-operator 部署就绪,创建一个 OpenTelemetry Collector(otelcol)实例,如下所示:

$ kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: simplest
spec:
  config:
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
    processors:
      memory_limiter:
        check_interval: 1s
        limit_percentage: 75
        spike_limit_percentage: 15
      batch:
        send_batch_size: 10000
        timeout: 10s

    exporters:
      # 注意:较旧版本中请使用 `logging` 替代 `debug`。
      debug: {}

    service:
      pipelines:
        traces:
          receivers: [otlp]
          processors: [memory_limiter, batch]
          exporters: [debug]
EOF

有关更多配置选项以及如何使用 OpenTelemetry 插桩库注入自动插桩,请参见 Kubernetes 专用的 OpenTelemetry Operator


Injecting Auto-instrumentation

An implementation of auto-instrumentation using the OpenTelemetry Operator.

Horizontal Pod Autoscaling

Configure Horizontal Pod Autoscaling with your OpenTelemetry Collector

Target Allocator

A tool to distribute targets of the PrometheusReceiver on all deployed Collector instances

Troubleshooting the OpenTelemetry Operator for Kubernetes

Contains a collection of tips for troubleshooting various aspects of the OpenTelemetry Kubernetes Operator. For example, what to do when the target allocator is failing to discover scrape targets.