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

Observable Metrics have no attributes #2555

Closed
dufferzafar opened this issue Feb 26, 2024 · 4 comments
Closed

Observable Metrics have no attributes #2555

dufferzafar opened this issue Feb 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@dufferzafar
Copy link

Describe your environment

Doing this on Linux, with only metrics examples, with latest Git branch (v1.14)

Steps to reproduce
Compile metrics_simple example with this patch:

--- a/examples/common/metrics_foo_library/foo_library.cc
+++ b/examples/common/metrics_foo_library/foo_library.cc
@@ -42,7 +42,7 @@ class MeasurementFetcher
       value_ += random_incr;
       nostd::get<nostd::shared_ptr<opentelemetry::metrics::ObserverResultT<double>>>(
           observer_result)
-          ->Observe(value_ /*, labelkv */);
+          ->Observe(value_, {{"key", "value"}});
     }
   }
   static double value_;

What is the expected behavior?
Key Value attributes should be printed to screen.

What is the actual behavior?

No attributes!

{
  scope name    : ostream_metric_example
  schema url    :
  version       : 1.2.0
  start time    : Mon Feb 26 19:14:55 2024
  end time      : Mon Feb 26 19:14:56 2024
  instrument name       : ostream_metric_example_observable_counter
  description   :
  unit          :
  type          : SumPointData
  value         : 4.1
  attributes            :
  resources     :
        service.name: unknown_service
        telemetry.sdk.language: cpp
        telemetry.sdk.name: opentelemetry
        telemetry.sdk.version: 1.14.1
}

Additional context

This is ONLY happening with Observable Counter & Gauge. Not with normal sync counters / histograms.

@dufferzafar dufferzafar added the bug Something isn't working label Feb 26, 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 26, 2024
@dufferzafar
Copy link
Author

I just went through the issue log, and it seems this is dupe of #2548, so I guess this can be closed?

@lalitb
Copy link
Member

lalitb commented Feb 26, 2024

yeah, it's duplicate and can be closed.. I am going to look into the original issue today.

@dufferzafar
Copy link
Author

@lalitb I just went through the commit cf5cdaa to try to see what's breaking, but I'm too new to this 😅

My understanding is that we changed all MetricAttributes to be Filtered now, made a change to the sync_metric_storage, but no corresponding to async_metric_storage I guess?

@marcalff marcalff removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 26, 2024
@lalitb
Copy link
Member

lalitb commented Feb 26, 2024

@dufferzafar Can you reply here #2548 (comment) - as seems I am missing something in repro :)

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

No branches or pull requests

3 participants