Skip to content

Commit

Permalink
Simplify ClusterEnvironmentInfo telemetry device (#1779)
Browse files Browse the repository at this point in the history
`ClusterEnvironmentInfo` telemetry device unnecessarily calls nodes
stats API to populate metadata fields in a metric store which duplicates
`ExternalEnvironmentInfo`. This commit removes these calls.

As `ClusterEnvironmentInfo` is not tagged with
serverless.Status.Internal status, the additional bonus of this
simplification is unblocking Rally when ran with public serverless
privileges.
  • Loading branch information
gbanasiak authored Sep 18, 2023
1 parent 6dacea8 commit fd6000f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
13 changes: 0 additions & 13 deletions esrally/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,6 @@ def on_benchmark_start(self):
return
distribution_flavor = client_info["version"].get("build_flavor", "oss")
# serverless returns dummy build hash which gets overridden when running with operator privileges
# TODO: refactor if config object gets included in telemetry base class (ES-6459)
revision = client_info["version"].get("build_hash", distribution_flavor)
if self.revision_override:
revision = self.revision_override
Expand All @@ -1812,18 +1811,6 @@ def on_benchmark_start(self):
self.metrics_store.add_meta_info(metrics.MetaInfoScope.cluster, None, "distribution_version", distribution_version)
self.metrics_store.add_meta_info(metrics.MetaInfoScope.cluster, None, "distribution_flavor", distribution_flavor)

info = self.client.nodes.info(node_id="_all")
nodes_info = info["nodes"].values()
for node in nodes_info:
node_name = node["name"]
# while we could determine this for bare-metal nodes that are provisioned by Rally, there are other cases (Docker, externally
# provisioned clusters) where it's not that easy.
self.metrics_store.add_meta_info(metrics.MetaInfoScope.node, node_name, "jvm_vendor", extract_value(node, ["jvm", "vm_vendor"]))
self.metrics_store.add_meta_info(metrics.MetaInfoScope.node, node_name, "jvm_version", extract_value(node, ["jvm", "version"]))

store_plugin_metadata(self.metrics_store, nodes_info)
store_node_attribute_metadata(self.metrics_store, nodes_info)


def add_metadata_for_node(metrics_store, node_name, host_name):
"""
Expand Down
10 changes: 0 additions & 10 deletions tests/telemetry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3336,16 +3336,6 @@ def test_stores_cluster_level_metrics_on_attach(self, metrics_store_add_meta_inf
mock.call(metrics.MetaInfoScope.cluster, None, "source_revision", "abc123"),
mock.call(metrics.MetaInfoScope.cluster, None, "distribution_version", "6.0.0-alpha1"),
mock.call(metrics.MetaInfoScope.cluster, None, "distribution_flavor", "oss"),
mock.call(metrics.MetaInfoScope.node, "rally0", "jvm_vendor", "Oracle Corporation"),
mock.call(metrics.MetaInfoScope.node, "rally0", "jvm_version", "1.8.0_74"),
mock.call(metrics.MetaInfoScope.node, "rally1", "jvm_vendor", "Oracle Corporation"),
mock.call(metrics.MetaInfoScope.node, "rally1", "jvm_version", "1.8.0_102"),
mock.call(metrics.MetaInfoScope.node, "rally0", "plugins", ["ingest-geoip"]),
mock.call(metrics.MetaInfoScope.node, "rally1", "plugins", ["ingest-geoip"]),
# can push up to cluster level as all nodes have the same plugins installed
mock.call(metrics.MetaInfoScope.cluster, None, "plugins", ["ingest-geoip"]),
mock.call(metrics.MetaInfoScope.node, "rally0", "attribute_group", "cold_nodes"),
mock.call(metrics.MetaInfoScope.node, "rally1", "attribute_group", "hot_nodes"),
]

metrics_store_add_meta_info.assert_has_calls(calls)
Expand Down

0 comments on commit fd6000f

Please sign in to comment.