-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support configurable AggregationTemporality in exporters; add OTLP missing sum point temporality/monotonic fields #1296
Conversation
…nd; add StatelessExportKindSelector()
Codecov Report
@@ Coverage Diff @@
## master #1296 +/- ##
======================================
Coverage 77.2% 77.3%
======================================
Files 122 122
Lines 5967 5978 +11
======================================
+ Hits 4612 4622 +10
- Misses 1106 1107 +1
Partials 249 249
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Someone privately asked if this PR should be split into smaller parts, as there are several things happening. I see these as all part of one bug fix, so I'm inclined to leave it the way it is, but just for the sake of discussion: This could be sequenced as: (1) remove the PassThrough ExportKind, (2) change OTLP exporter to pass ExportKindSelector to where it's needed, (3) add the missing fields. Note that (1) and (2) are independent, and that (3) depends on both. However, this assumes an approach that is not the only way forward. Instead of passing the ExportKindSelector into the Exporter where it re-calculates the export record's temporality (which requires it to be consistent), we could just add a field in the export record to say whether the record with its two timestamps is notionally DELTA or CUMULATIVE, for that's what we lack. We know the timestamps of the interval but we don't know whether to call the interval a DELTA or a CUMULATIVE. I have another way to reason about this change of behavior. The last release uses OTLP v0.3, which lacked temporality fields. Although the existing code says that "passthrough" is the default export kind for OTLP, there were no fields in OTLP v0.3 to reflect temporality. We've renamed that concept "stateless" in this PR, and it's a critical concept IMO, but for months we've stated that the default would change to CUMULATIVE for OTLP and we couldn't do that until v0.5 support, so I see this "fix" as just part of finishing v0.5 support, not some elaborate new behavior about configurable aggregation temporality. (Aggregation temporality was always configurable, just not in a way the exporter can see.) Therefore, @open-telemetry/go-approvers I'd like to review this as-is in the interest of a speedy release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I think this is ready to merge. |
…ssing sum point temporality/monotonic fields (open-telemetry#1296) * Restructure ExportKindSelector helpers; eliminate PassThroughExportKind; add StatelessExportKindSelector() * WithExportKindSelector(); Additional testing * Changelog update * Test the new selectors * From review feedback Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
The metric export API has a type
ExportKind
that describes which aggregation temporality to use, Delta or Cumulative. There was a special value,PassThroughExporter
, indicating the intent to use the natural aggregation temporality for sums, since that leads to a stateless configuration. The associated typeExportKindSelector
is used to choose an export kind, and there was confusion over actual export kinds (Delta or Cumualtive) and selectors, which are policies that decide the export kind.This PR removes
PassThroughExporter
, replacing it withStatelessExportKindSelector()
. This makes it so thatExportKind
does not implementExportKindSelector
, which was being used for constant ExportKindSelector policies (and made the code difficult to read). Constant policies are now available asDeltaExportKindSelector()
andCumulativeExportKindSelector()
.Updates the OTLP exporter to use
CumulativeExportKindSelector()
by default, as stated in open-telemetry/opentelemetry-specification#731. AddsWithExportKindSelector()
option to the OTLP exporter to configure alternate policies. UsingWithExportKindSelector(StatelessExportKindSelector())
results in the formerPassThroughExporter
behavior.Add AggregationTemporality and IsMonotonic fields in OTLP exporter. Fixes #1288.