fluent / fluent-plugin-prometheus

A fluent plugin that collects metrics and exposes for Prometheus.
Apache License 2.0
257 stars 79 forks source link

[Question] Get /metrics will keep latest data value if source data no longer update #216

Closed yixinin closed 1 year ago

yixinin commented 1 year ago

Configs

source data

@type http port 9880 bind 0.0.0.0 add_remote_addr true

@type copy @type prometheus name rest_request type counter desc request count key request
- prometheus config:
``` conf
- job_name: 'fluentd-test'
    scrape_interval: 10s
    static_configs:
      - targets: ['localhost:24231']

Screenshot

Expect

Get /metrics only return data in x(e.g 10s) seconds. is there have some like time query like GET /metrics?start=1688449048&end=1688449058 or configuration like

<source>
  @type prometheus
  expire 10s
</source>
yixinin commented 1 year ago

duplicated https://github.com/fluent/fluent-plugin-prometheus/issues/20. Closing.