Add an attribute to specify unknown type before converting to gauge in prometheusreceiver
#17185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
As Prometheus Receiver currently, all untyped prometheus metrics are converted to OTEL Gauge since the whole reason was not to drop untyped prometheus metrics. However, for some of the backend (such as CloudWatch) using with
awsemf
as an exporter/proxy, they will have limit bound (not supporting +inf or -inf) and combining with some case untyped can be counter, this won't work and will lose metrics. Therefore, there are two options that has been discussed in this issue:After consideration, the latter options would be more straightforward since we can use filterprocessor to filter/drop untyped metrics and also allow more metrics processing with untyped in exchange for more bytes (more than 16 bytes scaling per datapoint)
Another thoughts for improvement would be: if this attribute can also apply to others prometheus metrics type such as StateSet and Info since it has been converted to Otel Counter
Will update the spec after everyone agrees on this approach.
Link to tracking Issue:
Testing:
There are two tests I have done:
go test ./... with prometheus receiver
with update unit testawsemf
along withprometheusreceiver
withprometheus.go
and have following results:
Documentation:
Signed-off-by: Khanh Nguyen [email protected]