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

[exporter/elasticsearch] Add explicit bounds histogram support to metrics #34045

Merged
merged 13 commits into from
Jul 22, 2024

Conversation

carsonip
Copy link
Contributor

@carsonip carsonip commented Jul 11, 2024

Description:

Add explicit bounds histogram support to metrics

Link to tracking Issue:

Testing:
Added test in exporter_test

Documentation:

@carsonip carsonip changed the title [exporter/elasticsearch] Add metric histogram support [exporter/elasticsearch] Add histogram support to metrics Jul 12, 2024
Comment on lines +716 to +718
err := exporter.ConsumeMetrics(context.Background(), metrics)
require.ErrorContains(t, err, "invalid histogram data point")
require.ErrorContains(t, err, "invalid number data point")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[to reviewer] ConsumeMetrics will return an error, I don't think we can return a partial error here. The valid metric data points will be published, and invalid ones will be dropped.

Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if you can elaborate on this. Is there a reason why you cannot use a PartialSuccess and indicate the number of points rejected?

Copy link
Member

Choose a reason for hiding this comment

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

It looks like it handles errors the same for histograms as it does for other metric types, so, this is probably irrelevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushMetrics returns an error, but PartialSuccess is not an error. I am not aware of a way to meaningfully return to caller to indicate a partial success in an exporter. Even in otelarrowexporter it returns a nil error if partial success happens.

The handling in this PR takes a different route. If it drops any data points, it returns an explicit error. We may revisit in the future whether this is desirable.

@carsonip carsonip marked this pull request as ready for review July 12, 2024 10:59
@carsonip carsonip requested a review from a team as a code owner July 12, 2024 10:59
@carsonip carsonip requested a review from mwear July 12, 2024 10:59
Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

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

Are you planning to follow up with more changes to pass the dynamic template name to Elasticsearch for histogram fields?

Added e2e test

Where is that?

@carsonip
Copy link
Contributor Author

Are you planning to follow up with more changes to pass the dynamic template name to Elasticsearch for histogram fields?

Thanks for the reminder about dynamic template in bulk request. Yes, we'll need it, but the scope is a bit larger / different to this PR. I'll do it in a follow up.

Added e2e test
Where is that?

It is the test in exporter_test, which works e2e from an exporter PoV, not exactly e2e collector test. I've updated the PR description to reflect that.

@carsonip carsonip changed the title [exporter/elasticsearch] Add histogram support to metrics [exporter/elasticsearch] Add explicit bounds histogram support to metrics Jul 16, 2024
@djaglowski djaglowski merged commit 1fd6851 into open-telemetry:main Jul 22, 2024
156 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants