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

feat(core): OTel Exponential Histograms #1879

Merged
merged 24 commits into from
Nov 13, 2024

Conversation

vishramachandran
Copy link
Member

@vishramachandran vishramachandran commented Nov 4, 2024

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?
  • Tests for the changes have been added (for bug fixes / features) ?
  • Docs have been added / updated (for bug fixes / features) ?

Open Telemetry Exponential Histograms Part 1 includes:

  • Bucket definitions, ser/deser of buckets, along with storage in histogram vectors
  • Summing exponential histograms of different schemas
  • Delta exponential histograms - rate, sum and histogram_quantile functions tested
  • Test downsampling of exponential histograms
  • Dev ingestion of synthetic data
  • JMH benchmark for exponential histograms
  • PromQL function histogram_fraction

Benchmarks show that increasing the number of buckets does not significantly impact performance. Increasing buckets by 700% (8x) reduced throughput by just 11.6% (0.116x).

320 buckets
[info] Base2ExponentialHistogramQueryBenchmark.histQuantileQueries  thrpt    3  610.592 ± 276.750  ops/s

160 buckets
[info] Base2ExponentialHistogramQueryBenchmark.histQuantileQueries  thrpt    3  614.028 ± 20.870  ops/s

80 buckets
[info] Base2ExponentialHistogramQueryBenchmark.histQuantileQueries  thrpt    3  657.512 ± 476.477  ops/s

40 buckets
[info] Base2ExponentialHistogramQueryBenchmark.histQuantileQueries  thrpt    3  690.086 ± 96.426  ops/s

Coming in later PRs

  • New PromQL functions
  • rate calculation with counter correction for cumulative exponential histograms

@vishramachandran vishramachandran changed the title feat(core): OTel Exponential Histograms (Part 1) feat(core): OTel Exponential Histograms Nov 7, 2024
val b = it.next()
val zeroBucket = (b == 0)
val bucketUpper = bucketTop(b)
val bucketLower = if (b == 0) 0.0 else bucketTop(b - 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick - if (zeroBucket) 0.0 else bucketTop(b - 1)

same for prevBucketVal

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix in my next PR :)

@@ -160,6 +262,9 @@ final case class LongHistogram(buckets: HistogramBuckets, values: Array[Long]) e
s"Expected: ${buckets}, Found: ${other.buckets}"
)
}
// TODO if otel histogram, the need to add values in a different way
// see if we can refactor since MutableHistogram also has this logic
assert(other.buckets == buckets)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: wondering if this check is redundant, since the previous if check does the same thing ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes - this is from a merge conflict that I needed to resolve. I'll remove in my next PR

@vishramachandran vishramachandran merged commit 6afeb38 into filodb:develop Nov 13, 2024
1 check passed
@vishramachandran vishramachandran deleted the otel-exp-histograms branch November 13, 2024 22:34
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.

2 participants