Skip to content
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

Remove metric processor Subtract function; rename ExportKind to AggregationTemporality #1415

Closed
wants to merge 21 commits into from

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Dec 20, 2020

The basic Processor has code to convert cumulative values to delta values on the export path. This was exploratory functionality, and has been requested a few times, but is not considered widely useful. This removes it completely.

There are not many known use-cases for this support for it to be included in the basic processor, but for example:

  • Metric backend prefers DELTA to GAUGE data for SumObserver or UpDownSumObserver. For example, monitor change in process.cpu.time as a DELTA not a CUMULATIVE.
  • Metric exporter configures label removal an UpDownSumObserver instrument, with say 2 dimensions input by the observer callback and 1 dimension output (using Histogram type); then configures exemplar output (using RawValue type) with the complete two dimensions; exemplar sampling should be performed using DELTA weights to select the items most responsible for the rise/fall of the sum.

As you can see these are a bit contrived, and I think the exporters that want these things can easily take a DIY approach.

This PR also renames ExportKind to AggregationTemporality, as this terminology was already flagged as confusing in an open spec PR: open-telemetry/opentelemetry-specification#1159 (comment)

@codecov
Copy link

codecov bot commented Dec 20, 2020

Codecov Report

Merging #1415 (e7ab9a2) into main (38efc87) will decrease coverage by 0.0%.
The diff coverage is 84.7%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #1415     +/-   ##
=======================================
- Coverage   79.0%   78.9%   -0.1%     
=======================================
  Files        127     127             
  Lines       6683    6666     -17     
=======================================
- Hits        5280    5262     -18     
  Misses      1148    1148             
- Partials     255     256      +1     
Impacted Files Coverage Δ
exporters/otlp/internal/otlptest/data.go 61.7% <ø> (ø)
exporters/otlp/options.go 100.0% <ø> (ø)
exporters/otlp/otlpgrpc/driver.go 90.1% <ø> (ø)
exporters/otlp/otlphttp/driver.go 93.5% <ø> (ø)
exporters/otlp/protocoldriver.go 100.0% <ø> (ø)
exporters/stdout/metric.go 76.3% <0.0%> (ø)
sdk/export/metric/aggregation/aggregation.go 100.0% <ø> (ø)
sdk/export/metric/metrictest/test.go 19.3% <ø> (ø)
sdk/metric/aggregator/sum/sum.go 89.4% <ø> (+10.9%) ⬆️
sdk/metric/controller/basic/controller.go 93.2% <ø> (ø)
... and 10 more

@jmacd jmacd marked this pull request as ready for review December 20, 2020 09:30
@jmacd
Copy link
Contributor Author

jmacd commented Dec 21, 2020

@open-telemetry/specs-metrics-approvers As I am trying to bring the OTel-Go metrics SDK into line with "Everything we will specify", this is something I'd like to remove. (Note: I'm hoping to relieve the @open-telemetry/go-approvers of this responsibility, it's just code deletion.)

@evantorrie
Copy link
Contributor

What was an example use-case for this functionality? Something like an absolute system counter (# of network packets sent) that the backend system wants exposed as a delta?

I presume this does not affect any synchronous instruments, which will still support being exported as a delta even if they are an absolute count?

@jmacd
Copy link
Contributor Author

jmacd commented Dec 29, 2020

Yes @evantorrie something like that. I updated the PR description to clarify some use-cases, but I think the term confusion has a lot to do with "ExportKind", which I've renamed as we have already discussed in an open spec PR (open-telemetry/opentelemetry-specification#1159 (comment)).

The DeltaExportKind still exists, so there could be a 3rd party Processor that actually supports converting precomputed sums to delta.

@krnowak Yes, but I don't really think there are any of these out there. An exporter could use ConstantExportKindSelector(DeltaExportKind) and a custom processor could implement it, but it's more complexity than the case processor deserves.

@jmacd jmacd changed the title Remove metric processor Subtract function Remove metric processor Subtract function; rename ExportKind to AggregationTemporality Dec 29, 2020
@jmacd
Copy link
Contributor Author

jmacd commented Jan 5, 2021

@bogdandrutu Please review.

Base automatically changed from master to main January 29, 2021 19:39
@jmacd
Copy link
Contributor Author

jmacd commented Feb 4, 2021

PTAL

@jmacd
Copy link
Contributor Author

jmacd commented Feb 14, 2021

@bogdandrutu please take a look.

@MrAlias
Copy link
Contributor

MrAlias commented Apr 6, 2021

Closing as the metrics signal refactor at the specification level might make this work wasted. We can open again if the specification solidifies and it is determined needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants