Skip to content

Conversation

@DefinitelyADev
Copy link

This PR resolves #2800

It adds a new exporter according to the OpenMetrics spec.

@DefinitelyADev
Copy link
Author

@dotnet-policy-service agree

@DefinitelyADev DefinitelyADev force-pushed the feat-openmetrics-exporter branch 2 times, most recently from 6c1597f to 91375df Compare July 3, 2025 07:55
@DefinitelyADev DefinitelyADev force-pushed the feat-openmetrics-exporter branch 2 times, most recently from 49ddc1d to 464bed2 Compare July 4, 2025 15:13
string labelStr = labels.Count > 0
? $"{{{string.Join(", ", labels.Select(kvp => $"{kvp.Key}=\"{kvp.Value}\""))}}}"
: string.Empty;
return $"{Name}{labelStr} {value}";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converting value to string this way will create a invalid metrics file if the current CultureInfo is set to a country that uses comma instead of a period as a decimal separator.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ok now. I also added a test case.

@DefinitelyADev DefinitelyADev force-pushed the feat-openmetrics-exporter branch from 464bed2 to 37e75fe Compare November 18, 2025 09:28
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.

Feature Request: Add OpenMetrics Exporter for GitLab CI Metrics Integration

3 participants