Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: Info metric #490

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
Loading
from

Conversation

jetelain
Copy link

Adds Info Metric:
https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#info

Info metrics are used to expose textual information which SHOULD NOT change during process lifetime. Common examples are an application's version, revision control commit, and the version of a compiler.
A MetricPoint of an Info Metric contains a LabelSet. An Info MetricPoint's LabelSet MUST NOT have a label name which is the same as the name of a label of the LabelSet of its Metric.
Info MAY be used to encode ENUMs whose values do not change over time, such as the type of a network interface.
MetricFamilies of type Info MUST have an empty Unit string.

According to Java library:

Info metrics are used to expose textual information which should not change during process lifetime. The value of an Info metric is always 1.

Usage:

Metrics
  .CreateInfo("application_info", "Application Version", new[] { "version", "commit" })
  .WithLabels("1.2.3", "60e9106a83ff1274fec0022c37366f04822b1d1b");

Also adds a default Info Metric for dotnet runtime informations:

# HELP dotnet_info .NET runtime
# TYPE dotnet_info info
dotnet_info{version="6.0.36",framework=".NET 6.0.36",runtime="win10-x64"} 1

Can be disabled with Metrics.SuppressDefaultMetrics(new SuppressDefaultMetricOptions() { SuppressRuntimeInfoMetrics = true } );.

@jetelain jetelain changed the title feat:Info metric feat: Info metric Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.