fix(influx2otel): accept integer count, sum, and bucket values for histograms and summaries#346
Open
skartikey wants to merge 1 commit into
Open
Conversation
…stograms and summaries Influx line protocol integer fields (for example count=1i) decode as int64, but the V1 histogram and summary converters only accepted float64 and rejected them with "unsupported histogram count value type int64", dropping the metric. Add toFloat64/toUint64 helpers that also accept int64 and uint64 (matching the gauge and sum converters) and use them for the count, sum, and bucket/quantile values in convertHistogramV1 and convertSummaryV1. Related to influxdata/telegraf#14371
363d813 to
9cb2cfa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Telegraf/Prometheus V1 histogram and summary converters only accepted float64 field values. Influx line protocol integer fields (for example count=1i) are decoded as int64, so any untyped metric that was inferred as a histogram or summary and carried integer count/sum/bucket values was rejected with "unsupported histogram count value type int64" and dropped.
This adds small toFloat64/toUint64 helpers that accept the same numeric field types as the gauge and sum converters (float64, int64, uint64) and uses them in convertHistogramV1 and convertSummaryV1 for the count, sum, and bucket/quantile values.
The V2 converters (convertHistogramV2/convertSummaryV2) have the same integer-field limitation and will be addressed in a separate PR.
Related to influxdata/telegraf#14371