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

Statsdreceiver outputs cumulative temporality (incorrectly) for Sums w/o start timestamp #5667

Closed
jmacd opened this issue Oct 6, 2021 · 2 comments · Fixed by #5714
Closed
Assignees
Labels
bug Something isn't working

Comments

@jmacd
Copy link
Contributor

jmacd commented Oct 6, 2021

Describe the bug
The statsdreceiver has these lines:

	nm.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityDelta)
	if isMonotonicCounter {
		nm.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
	}

	nm.Sum().SetIsMonotonic(true)

and

	dp.SetTimestamp(pdata.NewTimestampFromTime(timeNow))

What did you expect to see?
This receiver always outputs delta temporality, so:

	nm.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityDelta)
	if isMonotonicCounter {
	    nm.Sum().SetIsMonotonic(true)
        }

and

	dp.SetStartTimestamp(pdata.NewTimestampFromTime(lastIIntervalTime))
	dp.SetTimestamp(pdata.NewTimestampFromTime(timeNow))

where lastIIntervalTime is computed from the containing StatsDParser.

What did you see instead?
This outputs cumulative temporality when it should output delta temporality.
This receiver should set start timestamp to the beginning of each report window.

Note also
The Summary points output for histogram and timing events also is missing its start timestamp,
however that field is underspecified in OpenTelemetry and while it may be OK to fill in the "beginning of each report window" as the start time, it is not how a Prometheus server would fill out that field. We end up in the case of "degenerate cumulative" which is a cumulative series that resets on every data point as a delta series would do.
This remark is meant to help understand a data model problem with Summary points, which will come to light as this issue is fixed. This issue is meant to apply only to the problem with Sum points.

@mwear
Copy link
Member

mwear commented Oct 11, 2021

I opened a PR that attempts to fix the counter portion of this ticket. Feel free to assign this issue to me, at least, responsibility for the counter part of it.

@jmacd
Copy link
Contributor Author

jmacd commented Oct 12, 2021

Thank you @mwear! For the Summary portion, we have a solution here: open-telemetry/opentelemetry-specification#2002

The result is that the statsdreceiver behavior is off-spec. My plan is to insert a new exponential histogram to address that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants