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

Pick up data streams in disk-usage-stats telemetry #1455

Merged
merged 2 commits into from
Mar 22, 2022

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 9, 2022

Some of our tracks just declare data streams.

Some of our tracks just declare data streams.
@@ -4150,24 +4150,31 @@ def test_logs_warning_on_missing_stats(self, metrics_put_value_cluster_level, me

class TestDiskUsageStats:
@mock.patch("elasticsearch.Elasticsearch")
def test_uses_indices_param_by_default(self, es):
def test_uses_indices_and_data_streams_by_default(self, es):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you split this case, please? Per the docs, we can only use one or the other

The indices section contains a list of all indices that are used by this track. Cannot be used if the data-streams section is specified.


@mock.patch("elasticsearch.Elasticsearch")
def test_uses_indices_param_if_specified(self, es):
cfg = create_config()
metrics_store = metrics.EsMetricsStore(cfg)
tc = TransportClient(response={"_shards": {"failed": 0}})
es = Client(transport_client=tc)
device = telemetry.DiskUsageStats({"disk-usage-stats-indices": "foo,bar"}, es, metrics_store, ["baz"])
device = telemetry.DiskUsageStats(
{"disk-usage-stats-indices": "foo,bar"}, es, metrics_store, index_names=["baz"], data_stream_names=["not_this"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise would be good here to only use index_names or data_stream_names

@DJRickyB DJRickyB added bug Something's wrong :Telemetry Telemetry Devices that gather additional metrics labels Mar 21, 2022
@DJRickyB DJRickyB added this to the 2.4.0 milestone Mar 21, 2022
@nik9000 nik9000 requested a review from DJRickyB March 21, 2022 20:22
Copy link
Contributor

@DJRickyB DJRickyB left a comment

Choose a reason for hiding this comment

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

Looks good. Excited to get this for our data stream-based benchmarks also

@nik9000 nik9000 merged commit 45e43e2 into elastic:master Mar 22, 2022
@nik9000
Copy link
Member Author

nik9000 commented Mar 22, 2022

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :Telemetry Telemetry Devices that gather additional metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants