Skip to content

Enable optional OpenMetrics exposition format and _created metrics #1252

@eriksywu

Description

@eriksywu

Is your feature request related to a problem? Please describe.
Like all cumulative counters, nginx counters can exhibit the uninitialized counter problem whereby the rate/increase contribution of the first scraped sample is dropped. CreatedTimestamp is an additional field supported by prometheus Counters/Summaries/Histograms to propagate additional information to infer a zero datapoint for a newly initialized counter.
There's active development in various prometheus-conformant tsdb projects (i.e prometheus/proposals#60) to support the ingest of CT values.

Describe the solution you'd like
The current nginx exporter's Collector implementations (NginxCollector and NginxPlusCollector) do not send prometheus.Metric objects created with CTs. The change is quite trivial to do so - i.e call promethues.MustNewConstMetricWithCreatedTimestamp. This behaviour will be entirely opt-in via some cmd-line arg or envvar.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
The changeset for the proposed feature may also include the support of OpenMetricsText exposition format but OM support is not a dependency

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityIssues or PRs opened by an external contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions