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

[receiver/prometheus] dns-sd-configs not adding instance name/job #30394

Closed
owenhaynes opened this issue Jan 10, 2024 · 1 comment
Closed

[receiver/prometheus] dns-sd-configs not adding instance name/job #30394

owenhaynes opened this issue Jan 10, 2024 · 1 comment
Labels
bug Something isn't working needs triage New item requiring triage

Comments

@owenhaynes
Copy link

owenhaynes commented Jan 10, 2024

Component(s)

receiver/prometheus

What happened?

Description

When using dns-sd-configs to discover prometheus targets job and instance names are not populated causing the following error

2024-01-10T10:10:32.257Z        debug   scrape/scrape.go:1696   Unexpected error        {"kind": "receiver", "name": "prometheus", "data_type": "metrics", "scrape_pool": "kafka", "target": "https://127.0.0.1:9273/metrics", "series": "kafka_consumer_group_offset{host=\"kafka\",name=\"foo\",partition=\"0\",topic=\"foo\"}", "error": "job or instance cannot be found from labels"}

I have tried using replace_labels to inject them, but the pipeline never gets that far before the error. But these should have been added at scrape time.

Steps to Reproduce

run otel-collector-contrib scrape dns-target

Expected Result

Being able to scrape using dns-sd-config

Actual Result

get metrics

Collector version

0.91.0

Environment information

Environment

OS: Ubuntu 22.04.2 LTS

OpenTelemetry Collector configuration

receivers:
  prometheus:
    config:
      scrape_configs:
      - job_name: 'kafka'
        scrape_timeout: 60s
        scrape_interval: 60s
        scheme: https
        metrics_path: "/metrics"
        honor_labels: false
        dns_sd_configs:
          - names:
              - kafaka
            type: A
            port: 9273
        tls_config:
          insecure_skip_verify: true

processors:
  batch:

extensions:
  health_check:
  pprof:
  zpages:

exporters:
  prometheus:
    endpoint: :9100
    add_metric_suffixes: false
    enable_open_metrics: false

service:
  extensions: [health_check, pprof, zpages]
  telemetry:
    logs:
      level: "debug"
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [prometheus]

Log output

2024-01-10T10:10:32.257Z        debug   scrape/scrape.go:1696   Unexpected error        {"kind": "receiver", "name": "prometheus", "data_type": "metrics", "scrape_pool": "kafka", "target": "https://127.0.0.1:9273/metrics", "series": "kafka_consumer_group_offset{host=\"kafka\",name=\"foo\",partition=\"0\",topic=\"foo\"}", "error": "job or instance cannot be found from labels"}

Additional context

It would be useful for this error to be none debug as it actually a issue

@owenhaynes owenhaynes added bug Something isn't working needs triage New item requiring triage labels Jan 10, 2024
@owenhaynes owenhaynes changed the title Prometheus Receiver dns-sd-configs not adding instance name/job [receiver/prometheus] dns-sd-configs not adding instance name/job Jan 10, 2024
@owenhaynes
Copy link
Author

had rewrite rule to drop job & instance 🤕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

1 participant