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

Cumulative Metric Exam #1585

Closed
tauseef-ah opened this issue Aug 30, 2022 · 0 comments · Fixed by #1586
Closed

Cumulative Metric Exam #1585

tauseef-ah opened this issue Aug 30, 2022 · 0 comments · Fixed by #1586
Assignees
Labels
bug Something isn't working

Comments

@tauseef-ah
Copy link

Describe your environment
https://github.com/open-telemetry/opentelemetry-cpp; main branch

Steps to reproduce
Modify https://github.com/open-telemetry/opentelemetry-cpp/blob/main/examples/common/metrics_foo_library/foo_library.cc:62 to increase sleep to 2seconds
To run:
./metrics_ostream_example counter
What is the expected behavior?
What did you expect to see?
Metric Counter should accumulate values, when aggregation is Cumulative.
So even if for some interval there are no samples, then sum should be total sum and not 0

What is the actual behavior?
What did you see instead?
When there are no samples in some collecting intervals, the value resets

Additional context
Current Output:
{
scope name : ostream_metric_example
schema url :
version : 1.2.0
start time : Tue Aug 30 14:35:15 2022
end time : Tue Aug 30 14:35:16 2022
instrument name : ostream_metric_example_counter
description :
unit :
type : SumPointData
value : 5
attributes :
resources :
service.name: unknown_service
telemetry.sdk.language: cpp
telemetry.sdk.name: opentelemetry
telemetry.sdk.version: 1.6.0
}
{
scope name : ostream_metric_example
schema url :
version : 1.2.0
start time : Tue Aug 30 14:35:16 2022
end time : Tue Aug 30 14:35:17 2022
instrument name : ostream_metric_example_counter
description :
unit :
type : SumPointData
value : 10
attributes :
resources :
service.name: unknown_service
telemetry.sdk.language: cpp
telemetry.sdk.name: opentelemetry
telemetry.sdk.version: 1.6.0
}
{
scope name : ostream_metric_example
schema url :
version : 1.2.0
start time : Tue Aug 30 14:35:17 2022
end time : Tue Aug 30 14:35:18 2022
instrument name : ostream_metric_example_counter
description :
unit :
type : SumPointData
value : 0
attributes :
resources :
service.name: unknown_service
telemetry.sdk.language: cpp
telemetry.sdk.name: opentelemetry
telemetry.sdk.version: 1.6.0
}
{
scope name : ostream_metric_example
schema url :
version : 1.2.0
start time : Tue Aug 30 14:35:18 2022
end time : Tue Aug 30 14:35:19 2022
instrument name : ostream_metric_example_counter
description :
unit :
type : SumPointData
value : 5
attributes :
resources :
service.name: unknown_service
telemetry.sdk.language: cpp
telemetry.sdk.name: opentelemetry
telemetry.sdk.version: 1.6.0
}

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
2 participants