Skip to content

Conversation

@JonasKunz
Copy link
Contributor

Part of #136605.
Adds a coerce parameter to the classic histogram field mapper, which is for now hidden behind the exponential-histograms feature flag. When coerce is enabled (which it is by default), histogram fields will also accept exponential_histogram JSON and convert it to T-Digests like we do in both the EDOT collector and in the elasticsearch OTLP-endpoint.

The added tests are randomized, I've ran them locally with 10k iterations with no failures.

@JonasKunz JonasKunz added >non-issue :StorageEngine/Mapping The storage related side of mappings labels Oct 27, 2025
@elasticsearchmachine elasticsearchmachine added external-contributor Pull request authored by a developer outside the Elasticsearch team v9.3.0 labels Oct 27, 2025
@JonasKunz JonasKunz marked this pull request as ready for review October 27, 2025 13:20
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

} catch (IOException e) {
throw new RuntimeException(e);
}
return new HistogramParser.ParsedHistogram(values, counts);
Copy link
Contributor

Choose a reason for hiding this comment

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

So here you're cloning the implementation.. Maybe we should just verify that we get the numbers we're expecting, instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe check that some percentile values are close enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean the fact that we delegate to ParsedHistogramConverter.exponentialToTDigest in the tests?
This is intentional. This unit test is not supposed to verify the correctness of the conversion algorithm, that is done by ParsedHistogramConverterTests. These keeps the tests small, while not loosing out on coverage

@JonasKunz JonasKunz merged commit 292f65b into elastic:main Oct 30, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants