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

cumulativetodelta: initial data points are included for monotonic counters #18053

Closed
lincolnmantracer opened this issue Jan 26, 2023 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed priority:p2 Medium processor/cumulativetodelta Cumulative To Delta processor Stale

Comments

@lincolnmantracer
Copy link

Component(s)

processor/cumulativetodelta

What happened?

The cumulative-to-delta processor includes the initial delta from zero to the current value as a data point:

if !ok {
if metricID.MetricIsMonotonic {
out = DeltaValue{
StartTimestamp: metricPoint.ObservedTimestamp,
FloatValue: metricPoint.FloatValue,
IntValue: metricPoint.IntValue,
HistogramValue: metricPoint.HistogramValue,
}
valid = true
}
return
}
valid = true

Even for monotonic counters, this is counterintuitive and noisy. For example, here is what that looks like in real production data when the collector is restarted:

Screen Shot 2023-01-26 at 1 03 13 PM

The processor should drop the first data point regardless of whether the dataset is monotonic or not, because the first data point can not be guaranteed to be a delta.

Collector version

0.70.0

Environment information

Environment

OS: Ubuntu 22.04

OpenTelemetry Collector configuration

<snip>
processors:
  cumulativetodelta:
    include:
      metrics:
        - "bytes_total\\z"
      match_type: regexp
  metricstransform:
    transforms:
      - include: "(.*)_bytes_total\\z"
        action: insert
        new_name: "$${1}_bitrate"
        match_type: regexp
        operations:
          - action: experimental_scale_value
            # The starting unit is bytes per 5s. 0.2 * 8 = 1.6
            experimental_scale: 1.6

Log output

No response

Additional context

No response

@lincolnmantracer lincolnmantracer added bug Something isn't working needs triage New item requiring triage labels Jan 26, 2023
@github-actions github-actions bot added the processor/cumulativetodelta Cumulative To Delta processor label Jan 26, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Mar 28, 2023
@TylerHelmuth
Copy link
Member

Closed via #18224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed priority:p2 Medium processor/cumulativetodelta Cumulative To Delta processor Stale
Projects
None yet
Development

No branches or pull requests

2 participants