Skip to content
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

Prometheus exporter writes boolean values as "True" and "False" #4822

Closed
JamesNK opened this issue Sep 4, 2023 · 1 comment · Fixed by #4823
Closed

Prometheus exporter writes boolean values as "True" and "False" #4822

JamesNK opened this issue Sep 4, 2023 · 1 comment · Fixed by #4823
Labels
bug Something isn't working

Comments

@JamesNK
Copy link
Contributor

JamesNK commented Sep 4, 2023

Bug Report

List of all OpenTelemetry NuGet
packages
and version that you are
using (e.g. OpenTelemetry 1.0.2):

<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.6.0-rc.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.6.0-rc.1" />

Runtime version (e.g. net462, net48, netcoreapp3.1, net6.0 etc. You can
find this information from the *.csproj file):

net7.0

Symptom

Prometheus exporter writes boolean values as "True" and "False":

image

What is the expected behavior?

I see the go exporter writes lower case values, e.g. "true" at https://github.com/open-telemetry/opentelemetry-go/blob/02616a25c68e674a04df01a1b7ba185a2db8cd5a/exporters/prometheus/testdata/counter.txt#L3 that is generated from https://github.com/open-telemetry/opentelemetry-go/blob/02616a25c68e674a04df01a1b7ba185a2db8cd5a/exporters/prometheus/exporter_test.go#L51. That seems like a more idiomatic behavior.

What is the actual behavior?

The written value appears to be bool.TrueString and bool.FalseString. Are these the right values?

Reproduce

Create a self-contained project using the template of your choice, apply the
minimum required code to result in the issue you're observing.

We will close this issue if:

  • The repro project you share with us is complex. We can't investigate custom
    projects, so don't point us to such, please.
  • If we can not reproduce the behavior you're reporting.

Additional Context

Add any other context about the problem here.

@JamesNK JamesNK added the bug Something isn't working label Sep 4, 2023
@reyang
Copy link
Member

reyang commented Sep 5, 2023

The written value appears to be bool.TrueString and bool.FalseString. Are these the right values?

  1. They should be "true" and "false".
  2. Note that the spec is Experimental and could have breaking changes.

More info:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants