You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
The text was updated successfully, but these errors were encountered:
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
}
The text was updated successfully, but these errors were encountered: