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 initial support for metrics #33513

Conversation

andrzej-stencel
Copy link
Member

@andrzej-stencel andrzej-stencel commented Jun 12, 2024

Description:

Adds initial support for metrics. Currently only Sum ang Gauge metric types are supported, other metric types are ignored.

Testing:

Added unit tests.

Documentation:

Added docs in component README.

@andrzej-stencel andrzej-stencel force-pushed the add-metrics-to-elasticsearch-exporter branch from c3bdb47 to 19af1ea Compare June 13, 2024 08:20
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.

Unsolicited review, hope you don't mind :) Looks great, just a few minor comments.

exporter/elasticsearchexporter/exporter.go Outdated Show resolved Hide resolved
exporter/elasticsearchexporter/model.go Outdated Show resolved Hide resolved
exporter/elasticsearchexporter/model.go Outdated Show resolved Hide resolved
exporter/elasticsearchexporter/model.go Outdated Show resolved Hide resolved
exporter/elasticsearchexporter/model.go Outdated Show resolved Hide resolved
We don't want cryptographic hashing, we want fast hashing.
Using hash/fnv as recommended in [contribution docs](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.102.1/CONTRIBUTING.md#recommended-libraries--defaults).

Also changed to hash by uint32 instead of string because I believe that is sufficient.

Also added hashing of attribute keys, which was missing.

Changed BigEndian to LittleEndian for consistency, although it doesn't really matter.
When any of the documents created for a metrics slice cannot be serialized,
reject the whole metrics slice.
@andrzej-stencel
Copy link
Member Author

Unsolicited review, hope you don't mind :) Looks great, just a few minor comments.

Thank you so much @axw for the review, your comments were very helpful! Keep them coming! 🙏

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.

LGTM. I'm mildly concerned about using hash/fnv, particularly 32-bit, without any chaining for handling collisions. There's some existing code we can build on, but I think it would be reasonable to defer that to a followup.

exporter/elasticsearchexporter/model.go Show resolved Hide resolved
@andrzej-stencel andrzej-stencel marked this pull request as ready for review June 24, 2024 09:38
@andrzej-stencel andrzej-stencel requested review from a team and MovieStoreGuy June 24, 2024 09:38
@andrzej-stencel andrzej-stencel merged commit 41a1a20 into open-telemetry:main Jun 25, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 25, 2024
@andrzej-stencel andrzej-stencel deleted the add-metrics-to-elasticsearch-exporter branch November 5, 2024 10:54
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.

6 participants