Skip to content

test(smoke): Test boolean metrics #690

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

Merged
merged 2 commits into from
Jun 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/templates/kuttl/smoke/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def check_metrics(
assert response.ok, "Requesting metrics failed"

for metric in expected_metrics:
assert (
re.search(f"^{metric}", response.text, re.MULTILINE) is not None
), f"Metric '{metric}' not found for {role}"
assert re.search(f"^{metric}", response.text, re.MULTILINE) is not None, (
f"Metric '{metric}' not found for {role}"
)


def check_namenode_metrics(
Expand All @@ -35,6 +35,8 @@ def check_namenode_metrics(
'hadoop_namenode_files_total{kind="FSNamesystem",role="NameNode",service="HDFS"}',
# Metric suffixed with "_created"
'hadoop_namenode_files_created_{kind="NameNodeActivity",role="NameNode",service="HDFS"}',
# Boolean metric
'hadoop_namenode_security_enabled{kind="NameNodeStatus",role="NameNode",service="HDFS"}',
# Non-special metric
'hadoop_namenode_files_deleted{kind="NameNodeActivity",role="NameNode",service="HDFS"}',
]
Expand Down Expand Up @@ -68,6 +70,8 @@ def check_datanode_metrics(
'hadoop_datanode_blocks_read{host="hdfs-datanode-default-0\\.hdfs-datanode-default\\..+\\.svc\\.cluster\\.local",kind="DataNodeActivity",port="9866",role="DataNode",service="HDFS"}',
# Counter suffixed with "_total"
'hadoop_datanode_estimated_capacity_lost_total{kind="FSDatasetState",role="DataNode",service="HDFS"}',
# Boolean metric
'hadoop_datanode_security_enabled{kind="DataNodeInfo",role="DataNode",service="HDFS"}',
# Non-special metric
'hadoop_datanode_gc_count{kind="JvmMetrics",role="DataNode",service="HDFS"}',
]
Expand All @@ -93,6 +97,7 @@ def check_journalnode_metrics(
'hadoop_journalnode_num_active_sources{kind="MetricsSystem",role="JournalNode",service="HDFS",sub="Stats"}',
# Non-special metric
'hadoop_journalnode_bytes_written{kind="Journal-hdfs",role="JournalNode",service="HDFS"}',
# There is no boolean metric in JournalNode.
]

if product_version in ["3.3.4", "3.3.6"]:
Expand Down