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

prometheus exporter seems not work as expected #22594

Open
idrissneumann opened this issue Mar 5, 2025 · 0 comments
Open

prometheus exporter seems not work as expected #22594

idrissneumann opened this issue Mar 5, 2025 · 0 comments
Labels
type: bug A code related bug.

Comments

@idrissneumann
Copy link

idrissneumann commented Mar 5, 2025

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

According to this documentation if we manage to transform data into this kind of JSON payloads:

{
  "metric": {
    "gauge": {
      "value": 1.5
    },
    "kind": "absolute",
    "name": "memory_rss",
    "namespace": "app",
    "tags": {
      "host": "my-host.local"
    }
  }
}

The prometheus exporter should automatically transform this into openmetrics format printed on an http endpoint that can be scrapped by prometheus instances.

However, we tried this configuration of sinks:

sinks:
  out:
    type: "console"
    inputs:
       - remap_nagios_metrics
    encoding:
      codec: "json"
    target: "stdout"
  nagios_metrics:
    type: "prometheus_exporter"
    inputs:
      - remap_nagios_metrics
    address: 0.0.0.0:9598
    default_namespace: "ems"
    buffer:
      type: "memory"

The stdout output seems to comply with the expected payload format:

$ docker-compose up --force-recreate
vector  | {"metric":{"gauge":{"value":3.0},"kind":"absolute","name":"my_alert","tags":{"file":"/data/nagios.log","host":"xxxxxx","kind":"SERVICE ALERT","status":"OK","type":"SOFT","vector_host":"yyyyyyy"}}}
vector  | {"metric":{"gauge":{"value":1.0},"kind":"absolute","name":"my_alert","tags":{"file":"/data/nagios.log","host":"xxxxxx","kind":"SERVICE ALERT","status":"WARNING","type":"HARD","vector_host":"yyyyyyy"}}}
vector  | {"metric":{"gauge":{"value":1.0},"kind":"absolute","name":"my_alert","tags":{"file":"/data/nagios.log","host":"xxxxxx","kind":"SERVICE ALERT","status":"WARNING","type":"SOFT","vector_host":"yyyyyyy"}}}
vector  | {"metric":{"gauge":{"value":2.0},"kind":"absolute","name":"my_alert","tags":{"file":"/data/nagios.log","host":"xxxxxx","kind":"SERVICE ALERT","status":"WARNING","type":"SOFT","vector_host":"yyyyyyy"}}}
vector  | {"metric":{"gauge":{"value":3.0},"kind":"absolute","name":"my_alert","tags":{"file":"/data/nagios.log","host":"xxxxxx","kind":"SERVICE ALERT","status":"OK","type":"SOFT","vector_host":"yyyyyyy"}}}

But when I reach the http://localhost:9598/metrics route, I have an empty response without any metrics.

Thanks for your help

Configuration

sinks:
  out:
    type: "console"
    inputs:
       - remap_nagios_metrics
    encoding:
      codec: "json"
    target: "stdout"
  nagios_metrics:
    type: "prometheus_exporter"
    inputs:
      - remap_nagios_metrics
    address: 0.0.0.0:9598
    default_namespace: "ems"
    buffer:
      type: "memory"

Version

timberio/vector:0.44.0-distroless-libc

@idrissneumann idrissneumann added the type: bug A code related bug. label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

1 participant