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

[chore] [exporter/elasticsearch] Extract datapoints into their own internal package #37237

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dmathieu
Copy link
Member

Description

This PR is part of the splitting of the elasticsearch exporter for a better separation of concerns.
It follows (and is currently based after) #37235.

This introduces a new datapoints package, so multiple mapping type packages can rely on them.

@dmathieu dmathieu marked this pull request as ready for review January 22, 2025 19:00
@dmathieu dmathieu requested a review from a team as a code owner January 22, 2025 19:00
@dmathieu dmathieu requested a review from songy23 January 22, 2025 19:00

func histogramToValue(dp pmetric.HistogramDataPoint) (pcommon.Value, error) {
// Histogram conversion function is from
// https://github.com/elastic/apm-data/blob/3b28495c3cbdc0902983134276eb114231730249/input/otlp/metrics.go#L277
Copy link
Member

Choose a reason for hiding this comment

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

Is there no alternative to duplicating the logic here? Is there any way to make the original functionality public? Would it be helpful to at least add a link in the histogramSample method that's being duplicated to update this method whenever it changes?

I see this method is simply being copied, no need to block this PR, just thought I'd call it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly. I'm improving the overall readability and separation of the module, and it's already causing frequent conflicts with other changes. So'id rather avoid mixing refactorings into it.

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.

2 participants