Replies: 1 comment 1 reply
-
Unfortunately, no. The OpenTelemetry SDK does not understand UpDownCounters yet. There is no real alternative but to wait for this SDK to start supporting it. It'll be stable released on Nov 2022, with several non-stable ones coming months before that. (You may use Gauge, but not really a workaround....) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a scenario that requires me to post positive and negative deltas in the same counters. I noticed that the
UpDownCounter
was introduced for this reason here:From what I understand, the standard
Counter<T>
is supposed to be monotonically increasing, so it shouldn't be used when there is a need to report both increments and decrements, andUpDownCounter<T>
should be used instead.Since
UpDownCounter<T>
will only come as part of .NET 7, is there a way to temporarily add support for it in a .NET 6 codebase? In the past, it was possible to add support for some newer attributes etc by adding those manually to a codebase using the correct namespaces and they would be picked up automatically as long as you were using the latest compiler. Is something like that feasible regardingUpDownCounter<T>
? Will the counter "just work" if I copy the code from that NET 7 PR into my project and keep the sameSystem
namespaces in place?If that doesn't work, is there an alternative today to allow for a counter that pushes both increments and decrements to be reported to OpenTelemetry as a proper "up/down counter" (i.e. one that is not monotonic)?
Beta Was this translation helpful? Give feedback.
All reactions