-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cardinality limiting to the metric SDK as an experimental feature (…
…#4457) * Add agg limiting func * Add unit test for limitAttr * Add limiting to aggregate types * Add internal x pkg for experimental feature-flagging * Connect cardinality limit to metric SDK * Replace limitAttr fn with limiter type The Attribute method is still inlinable. * Use x.CardinalityLimit directly * Simplify limiter test * Add limiter benchmark * Document the AggregationLimit field * Test sum limits * Test limit for last value * Test histogram limit * Refactor expo hist test to use existing fixtures The tests for the exponential histogram create their own testing fixtures. There is nothing these new fixtures do that cannot already be done with the existing testing fixtures used by all the other aggregate functions. Unify the exponential histogram testing to use the existing fixtures. * Test the ExponentialHistogram limit * Fix lint * Add docs * Rename aggregation field to aggLimit --------- Co-authored-by: Robert Pająk <[email protected]>
- Loading branch information
Showing
16 changed files
with
570 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Experimental Features | ||
|
||
The metric SDK contains features that have not yet stabilized in the OpenTelemetry specification. | ||
These features are added to the OpenTelemetry Go metric SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback. | ||
|
||
These feature may change in backwards incompatible ways as feedback is applied. | ||
See the [Compatibility and Stability](#compatibility-and-stability) section for more information. | ||
|
||
## Features | ||
|
||
- [Cardinality Limit](#cardinality-limit) | ||
|
||
### Cardinality Limit | ||
|
||
The cardinality limit is the hard limit on the number of metric streams that can be collected for a single instrument. | ||
|
||
This experimental feature can be enabled by setting the `OTEL_GO_X_CARDINALITY_LIMIT` environment value. | ||
The value must be an integer value. | ||
All other values are ignored. | ||
|
||
If the value set is less than or equal to `0`, no limit will be applied. | ||
|
||
#### Examples | ||
|
||
Set the cardinality limit to 2000. | ||
|
||
```console | ||
export OTEL_GO_X_CARDINALITY_LIMIT=2000 | ||
``` | ||
|
||
Set an infinite cardinality limit (functionally equivalent to disabling the feature). | ||
|
||
```console | ||
export OTEL_GO_X_CARDINALITY_LIMIT=-1 | ||
``` | ||
|
||
Disable the cardinality limit. | ||
|
||
```console | ||
unset OTEL_GO_X_CARDINALITY_LIMIT | ||
``` | ||
|
||
## Compatibility and Stability | ||
|
||
Experimental features do not fall within the scope of the OpenTelemetry Go versioning and stability [policy](../../VERSIONING.md). | ||
These features may be removed or modified in successive version releases, including patch versions. | ||
|
||
When an experimental feature is promoted to a stable feature, a migration path will be included in the changelog entry of the release. | ||
There is no guarantee that any environment variable feature flags that enabled the experimental feature will be supported by the stable version. | ||
If they are supported, they may be accompanied with a deprecation notice stating a timeline for the removal of that support. |
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.