Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[connector/spanmetrics] OpenTelemetry Collector gateway deployment mode cannot parse agent metrics data. #37139

Open
ixiaoyi93 opened this issue Jan 10, 2025 · 1 comment
Labels
connector/spanmetrics needs triage New item requiring triage

Comments

@ixiaoyi93
Copy link

ixiaoyi93 commented Jan 10, 2025

Component(s)

connector/spanmetrics

Describe the issue you're reporting

I used opentelmetry collector operator for opentelmetry collector deployment in a kubernetes cluster, and kubernetes daemonset for opentelmetry collector agent mode deployment, and then the The traces/metrics are forwarded to the collector cluster in gateway deployment mode, which is used to unify the processing of data from virtual hosts other than the kubernetes cluster. The problem encountered is that the collector in the gateway mode cluster is unable to process the metrics data.

OpenTelmetry Collector agent mode configuration in a kubernetes cluster:

apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: test-ack-public-collector
spec:
  mode: daemonset
  hostNetwork: true
  config:
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
    exporters:
      otlp:
        endpoint: "http://192.168.255.155:4317"
        tls:
          insecure: true
      otlphttp:
        endpoint: "http://192.168.255.155:4318"
        tls:
          insecure: true
    service:
      pipelines:
        traces:
          receivers:
            - otlp
          exporters:
            - otlp
            - otlphttp
        metrics:
          receivers:
            - otlp
          exporters:
            - otlp
            - otlphttp
  resources:
    limits:
      cpu: 100m
      memory: 200M

192.168.255.155 is a collector gateway access address. OpenTelmetry Collector gateway mode configuration:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
  prometheus:
    config:
      scrape_configs:
      - job_name: 'otelcol'
        scrape_interval: 10s
        static_configs:
        - targets: ['0.0.0.0:8888']

processors:
  filter:
    error_mode: ignore
    traces:
      span:
        - IsMatch(attributes["http.route"], ".*/health.*")
  transform:
    metric_statements:
      - context: datapoint
        statements:
        - set(attributes["ip"], resource.attributes["host.name"])
  memory_limiter:
    check_interval: 1s
    limit_percentage: 75
    spike_limit_percentage: 15
  batch:
    send_batch_size: 10000
    timeout: 10s

connectors:
  spanmetrics:
    histogram:
      explicit:
        buckets: [100us, 1ms, 2ms, 6ms, 10ms, 100ms, 250ms]

exporters:
  debug:
    verbosity: detailed
  otlp:
    endpoint: tempo:4317
    tls:
      insecure: true
  prometheus:
    endpoint: "0.0.0.0:8889"

extensions:
  health_check:

service:
  extensions: [health_check]
  telemetry:
    logs:
      level: "debug"
    metrics:
      address: "0.0.0.0:8888"
  pipelines:
    traces:
      receivers: [otlp]
      processors: [filter, transform, memory_limiter, batch]
      exporters: [otlp, spanmetrics]
    metrics:
      receivers: [otlp, prometheus, spanmetrics]
      processors: [transform, memory_limiter, batch]
      exporters: [prometheus]

The status quo is that currently there is only trace data and the ServiceGrap. I'm not sure how the metrics metrics are relayed.

@ixiaoyi93 ixiaoyi93 added the needs triage New item requiring triage label Jan 10, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connector/spanmetrics needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

1 participant