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

Schema URL inconsistently exported #2569

Closed
samin36 opened this issue Feb 29, 2024 · 2 comments · Fixed by #2587
Closed

Schema URL inconsistently exported #2569

samin36 opened this issue Feb 29, 2024 · 2 comments · Fixed by #2587
Labels
bug Something isn't working good first issue Good for newcomers help wanted Good for taking. Extra help will be provided by maintainers

Comments

@samin36
Copy link
Contributor

samin36 commented Feb 29, 2024

Describe your environment
Opentelemetry-cpp v1.12.0 on Ubuntu 18

Steps to reproduce
Specify schema_url to the GetMeter, GetTracer, and Resource::Create functions and set up Tracer/Meter providers to export using the OTLP HTTP exporters.

What is the expected behavior?
The exported metrics and traces should contain the schema_url.

What is the actual behavior?
Only the exported traces contain the schema_url. The exported metric data does not contain the schema_url.

Additional context
I verified this by using the logging exporter in the Opentelemetry-Collector, which prints the metric/tracing data. I also set up a dummy HTTP server to log all incoming data at /v1/metrics and /v1/traces endpoint and only saw the schema_url for the tracing data.

@samin36 samin36 added the bug Something isn't working label Feb 29, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 29, 2024
@lalitb
Copy link
Member

lalitb commented Feb 29, 2024

Thanks for the issue. The schema_url is not getting populated for metrics here: OtlpMetricUtils::PopulateResourceMetrics().

Need to add

resource_metrics->set_schema_url(scope_metrics.scope_->GetSchemaUrl());

in above-mentioned method.

@lalitb lalitb added help wanted Good for taking. Extra help will be provided by maintainers good first issue Good for newcomers and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 29, 2024
Copy link

This issue is available for anyone to work on. Make sure to reference this issue in your pull request.
✨ Thank you for your contribution! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Good for taking. Extra help will be provided by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants