-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add capability to have configurable aggregation temporality for OTLP …
…Registry (#3625) OTLP format supports delta and cumulative temporality. This adds the capability to export meters with delta temporality. Below are some behaviours this PR includes * capability to configure aggregation Temporality via property `otlp.aggregationTemporality` * Delta Temporality is supported by using StepMeters wherever applicable * Capability to export max as part of the HistogramDataPoint for Delta Temporality There are some remaining issues with using delta temporality. Fixes for these will be made as follow-ups. * max value in histogram is not right * histogram counts are not right * partial steps may not publish correct values Closes gh-3145 Co-authored-by: Jonatan Ivanov <[email protected]>
- Loading branch information
1 parent
3c6e834
commit b828fe3
Showing
14 changed files
with
752 additions
and
88 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...meter-registry-otlp/src/main/java/io/micrometer/registry/otlp/AggregationTemporality.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2023 VMware, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micrometer.registry.otlp; | ||
|
||
/** | ||
* AggregationTemporality defines the way additive values are expressed. | ||
* | ||
* @see <a href= | ||
* "https://opentelemetry.io/docs/reference/specification/metrics/data-model/#temporality">OTLP | ||
* Temporality</a> | ||
* @author Lenin Jaganathan | ||
* @since 1.11.0 | ||
*/ | ||
public enum AggregationTemporality { | ||
|
||
/** | ||
* Reported values do not incorporate previous measurements. | ||
*/ | ||
DELTA, | ||
|
||
/** | ||
* Reported values incorporate previous measurements. | ||
*/ | ||
CUMULATIVE; | ||
|
||
public static io.opentelemetry.proto.metrics.v1.AggregationTemporality toOtlpAggregationTemporality( | ||
AggregationTemporality aggregationTemporality) { | ||
switch (aggregationTemporality) { | ||
case DELTA: | ||
return io.opentelemetry.proto.metrics.v1.AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; | ||
case CUMULATIVE: | ||
return io.opentelemetry.proto.metrics.v1.AggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE; | ||
default: | ||
return io.opentelemetry.proto.metrics.v1.AggregationTemporality.UNRECOGNIZED; | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.