Skip to content

feat(hadoop): Enable boolean metrics #1140

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

Conversation

siegfriedweber
Copy link
Member

@siegfriedweber siegfriedweber commented Jun 2, 2025

Description

Allow boolean metrics to be exported for HDFS.

If a value field is provided in the JMX exporter rules, then the value is parsed as Double (see https://github.com/prometheus/jmx_exporter/blob/1.2.0/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L699-L714).
If the value field is "not specified the scraped mBean value will be used." (see http://prometheus.github.io/jmx_exporter/1.2.0/http-mode/rules/). This seems to be the usual case anyway.

If the bean value is used, numbers and booleans are supported (see https://github.com/prometheus/jmx_exporter/blob/1.2.0/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L800-L811).

With this change, e.g. the metric hadoop_namenode_security_enabled is exported:

# HELP hadoop_namenode_security_enabled Hadoop:name=NameNodeStatus,type=null,attribute=SecurityEnabled
# TYPE hadoop_namenode_security_enabled gauge
hadoop_namenode_security_enabled{kind="NameNodeStatus",role="NameNode",service="HDFS"} 0.0

Note

This pull request is just the byproduct of a research task for a customer. Instead of documenting the issue, I just fixed it.

Definition of Done Checklist

Please make sure all these things are done and tick the boxes

TIP: Running integration tests with a new product image

The image can be built and uploaded to the kind cluster with the following commands:

bake --product <product> --image-version <stackable-image-version>
kind load docker-image <image-tagged-with-the-major-version> --name=<name-of-your-test-cluster>

See the output of bake to retrieve the image tag for <image-tagged-with-the-major-version>.

@siegfriedweber siegfriedweber requested a review from a team June 2, 2025 13:16
@siegfriedweber siegfriedweber self-assigned this Jun 2, 2025
@siegfriedweber siegfriedweber moved this to Development: Waiting for Review in Stackable Engineering Jun 2, 2025
@siegfriedweber siegfriedweber added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 2, 2025
@dervoeti dervoeti self-requested a review June 4, 2025 13:42
@dervoeti dervoeti moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Jun 4, 2025
Copy link
Member

@dervoeti dervoeti left a comment

Choose a reason for hiding this comment

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

Built and tested with stackabletech/hdfs-operator#690, changes look good.

@siegfriedweber siegfriedweber added this pull request to the merge queue Jun 4, 2025
@siegfriedweber siegfriedweber moved this from Development: In Review to Development: Done in Stackable Engineering Jun 4, 2025
Merged via the queue into main with commit dbfc7fb Jun 4, 2025
3 checks passed
@siegfriedweber siegfriedweber deleted the feat/hadoop-boolean-metrics branch June 4, 2025 15:53
@siegfriedweber
Copy link
Member Author

Release notes

  • HDFS: Boolean metrics like hadoop_namenode_security_enabled are exported.

@lfrancke lfrancke moved this from Development: Done to Done in Stackable Engineering Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/25.7.0 release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants