-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement metrics temporality selection
Delta temporality (representing the change in value from the previous report) is a feature of the Metrics SDK, and is useful to generate from the CLI. This commit extends Delta temporality support to all metrics type aside from the "CounterObserverAdvanced" (which reports that "cumulative to delta conversion is not implemented" when I tried, so we skip it). I tested this locally with all other metric types, and noted that the output from the collector indicated delta temporality: ``` 2022-09-30T21:07:21.163Z info MetricsExporter {"kind": "exporter", "data_type": "metrics", "name": "logging", "#metrics": 1} 2022-09-30T21:07:21.163Z info ResourceMetrics #0 Resource SchemaURL: https://opentelemetry.io/schemas/1.12.0 Resource labels: -> service.name: STRING(unknown_service:main) -> telemetry.sdk.language: STRING(go) -> telemetry.sdk.name: STRING(opentelemetry) -> telemetry.sdk.version: STRING(1.9.0) ScopeMetrics #0 ScopeMetrics SchemaURL: InstrumentationScope otelgen Metric #0 Descriptor: -> Name: otelgen.metrics.up_down_counter -> Description: UpDownCounter demonstrates how to measure numbers that can go up and down -> Unit: 1 -> DataType: Sum -> IsMonotonic: false -> AggregationTemporality: AGGREGATION_TEMPORALITY_DELTA NumberDataPoints #0 StartTimestamp: 2022-09-30 21:21:57.049423 +0000 UTC Timestamp: 2022-09-30 21:22:02.050935 +0000 UTC Value: -1 {"kind": "exporter", "data_type": "metrics", "name": "logging"} ``` However, I had some trouble testing the "observer" metrics; they didn't seem to do anything regardless of temporality selected. I'm unclear how to use those with otelgen, so that code may be incorrect for those types.
- Loading branch information
Showing
9 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters