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

Add DownsampleMetrics #106632

Merged

Conversation

kkrik-es
Copy link
Contributor

@kkrik-es kkrik-es commented Mar 21, 2024

A single instance gets created by the Downsample plugin and injected to related actions.

@kkrik-es kkrik-es added >non-issue :StorageEngine/Downsampling Downsampling (replacement for rollups) - Turn fine-grained time-based data into coarser-grained data Team:StorageEngine labels Mar 21, 2024
@kkrik-es kkrik-es self-assigned this Mar 21, 2024
@kkrik-es kkrik-es requested review from martijnvg March 22, 2024 09:43
@kkrik-es kkrik-es marked this pull request as ready for review March 22, 2024 09:43
@elasticsearchmachine
Copy link
Collaborator

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

@kkrik-es
Copy link
Contributor Author

Another option is to return (inject) the DownsampleMetrics object in Downsample::createComponents, so that it can be retrieved in actions. This lifts the need for a singleton but will still require updating a number of intermediate classes until we get to the code that records a metric value.

Copy link
Member

@martijnvg martijnvg 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 thought we have some sort of a unit test infrastructure that we can use for metrics. @salvatore-campagna do you remember?

@kkrik-es
Copy link
Contributor Author

LGTM - I thought we have some sort of a unit test infrastructure that we can use for metrics. @salvatore-campagna do you remember?

https://github.com/elastic/elasticsearch/blob/main/modules/apm/METERING.md#testing says we use TestTelemetryPlugin, not sure if there's a better way..

@martijnvg
Copy link
Member

says we use TestTelemetryPlugin, not sure if there's a better way..

Ok, I see. And this is already tested in the changes to the unit test in this pr.

@kkrik-es kkrik-es added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 22, 2024
@elasticsearchmachine elasticsearchmachine merged commit cc96a8b into elastic:main Mar 22, 2024
14 checks passed
@kkrik-es kkrik-es deleted the metrics/downsample-latency branch March 22, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :StorageEngine/Downsampling Downsampling (replacement for rollups) - Turn fine-grained time-based data into coarser-grained data Team:StorageEngine v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants