-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[exporter/elasticsearch] Add exponential histogram support #34818
Merged
andrzej-stencel
merged 20 commits into
open-telemetry:main
from
carsonip:exponential-histogram
Sep 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
587e05a
WIP exponential histogram
carsonip 4e53421
Merge branch 'main' into exponential-histogram
carsonip b64e216
Update readme
carsonip 5d8d61f
Fix code, add tests
carsonip 0b23f75
Merge branch 'main' into exponential-histogram
carsonip 8c60997
Hardcode 0 as midpoint for zero count
carsonip e0f83f3
Add MapToIndex
carsonip cca3ca7
Adding tests
carsonip 04bac53
Add LowerBoundaryNegativeScale
carsonip 0ab8c00
Add TestToTDigest
carsonip 296a99f
Add test cases
carsonip b8b477b
Remove MapToIndex
carsonip 7879ae0
Comments
carsonip c2e97cf
Add changelog
carsonip abb6f0b
Make linter happy
carsonip 0af68df
Fix CI check
carsonip 656197d
Add package comment
carsonip 5eeeb3e
Remove incorrect comment
carsonip 3514357
Merge branch 'main' into exponential-histogram
carsonip af390cd
Fix test after dynamic mapping fix
carsonip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
8 changes: 8 additions & 0 deletions
8
exporter/elasticsearchexporter/internal/exphistogram/exphistogram.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package exphistogram | ||
|
||
func LowerBoundary(index, scale int) float64 { | ||
// Use this form in case the equation above computes +Inf | ||
// as the lower boundary of a valid bucket. | ||
inverseFactor := math.Ldexp(math.Ln2, -scale) | ||
Check failure on line 6 in exporter/elasticsearchexporter/internal/exphistogram/exphistogram.go GitHub Actions / govulncheck (exporter-1)
|
||
return 2.0 * math.Exp((index-(1<<scale))*inverseFactor) | ||
} |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect us to be able to just use
0
. If the offsets if the positive and negative scale are the same, the midpoint is always zero. If the offsets are different, I don't think the midpoint value is meaningful. As the zero count is the count of values that are zero (or within thezero_threshold
), I think we should just use0
as the value.