-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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] Emit _doc_count for metric documents in OTel mode when data point attribute _doc_count is true #35348
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a4e8bd1
Add _doc_count
carsonip 039721b
Merge branch 'main' into doc-count
carsonip 2dde8e5
Only emit _doc_count if attribute _doc_count is true
carsonip e6650e1
Move doc count out of hash
carsonip 0be1bd8
Fix compile error
carsonip 00ec605
Add test
carsonip 6badbba
Remove FIXME
carsonip 37309b6
Add changelog
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
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.
Do we need
docCount
as a hashing key? Maybe we could add the doc counts for existing hashes and not considerdocCount
as a hashing key.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 think we'll need it. If 2 metrics with the same dimension have different doc counts, they cannot share the same document, as there is only 1 doc count in 1 document.
Could you elaborate?
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.
Having a hard time imagining how this could practically happen. Doesn't this mean that we would drop the metric anyway since they are duplicates w.r.t dimensions?
I was thinking that if all attributes are same then merging them would be the way to go (merging histograms + doc count values) but honestly, I can't imagine a case when this could happen in practical scenarios.
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.
Good point, that appears to be the case for TSDB. @felixbarny did mention something about hashing doc count, not sure if this case was considered.
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.
Because of that issue, I think it would be easier to map metrics named
_doc_count
to the top-level_doc_count
field. We don't need a_doc_count
for all metrics, and it makes it harder to group as many metrics to the same document as possible, because these metrics may differ just by their_doc_count
.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.
With the new implementation that is based on the
_doc_count: true
attribute, I'm also wondering whether we can remove the doc count from the hash. If there are multiple doc counts for a given doc, I think it's fine to chose one of them (for example the first, last, or max value).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.
Right, I forgot to make that change.