Skip to content

Prometheus gauge #154

@ghost

Description

Hi!

I'm trying to add a gauge with a constant value in order to see what helm configuration is deployed.
It's an idea that's similar to #40 but just related to my current config release.

After seeing the code https://github.com/fluent/fluent-plugin-prometheus/blob/master/lib/fluent/plugin/prometheus.rb#L197-L207

I think it should be possible to do something like this:

# Add constant key in order to be able to use a gauge
<filter *>
  @type record_transformer
  <record>
    helm_release {{ .Release.Revision }}
  </record>
</filter>
<filter app*>
  @type prometheus
  <metric>
    name fluentd_last_sent
    type gauge
    key "helm_release"
    desc Use for debugging purposes
    <labels>
      helm_release_name {{ .Release.Name }}
      helm_release_version {{ .Release.Revision }}
    </labels>
  </metric>
</filter>

If I output the record, I can see that the helm_release key is present, but right now if i query the metrics endpoint. I'm not seeing anything:

image

Am I missing something on the config?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions