Skip to content

[Prometheus]: Improve Prometheus integration observability/debuggability #15693

@lucabelluccini

Description

@lucabelluccini

Integration Name

Prometheus [prometheus]

Dataset Name

No response

Integration Version

1.24.2

Agent Version

9.1.5

OS Version and Architecture

MacOS

User Goal

Improving observability of Prometheus Health.

  1. If Prometheus integration cannot connect to Prometheus with:
{"log.level":"error","@timestamp":"2025-10-20T12:00:51.996Z","message":"Error fetching data for metricset prometheus.collector: unable to decode response from prometheus endpoint: error making http request: Get \"http://localhost:9090/metrics\": dial tcp 127.0.0.1:9090: connect: connection refused","component":{"binary":"metricbeat","dataset":"elastic_agent.metricbeat","id":"prometheus/metrics-default","type":"prometheus/metrics"},"log":{"source":"prometheus/metrics-default"},"service.name":"metricbeat","id":"prometheus/metrics-prometheus.collector-7ad257bb-59ab-42e8-9ef3-7d93849a9318","ecs.version":"1.6.0","log.logger":"prometheus.collector","log.origin":{"file.line":335,"file.name":"module/wrapper.go","function":"github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).handleFetchError"},"ecs.version":"1.6.0"}

The input reports configuring instead of degraded.

  1. Queries sent to Prometheus should be logged in debug as at the moment there's no feedback anywhere.

  2. We should log also in debug or info if a response from Prometheus query was empty.

Existing Features

At the moment we do not have a lot of feedback if a query is not returning data.

What did you see?

Only the succesful queries have traces in debug.

Anything else?

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions