Skip to content

Commit 7e34d80

Browse files
fix(hadoop): Fix the JMX exporter configuration (#962)
* fix(hadoop): Fix the JMX exporter configuration * chore(hadoop): Move copy step of the JMX configuration files from the builder image to the final image
1 parent 77a6239 commit 7e34d80

File tree

5 files changed

+115
-11
lines changed

5 files changed

+115
-11
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ All notable changes to this project will be documented in this file.
2323

2424
- kafka: Remove `kubectl`, as we are now using listener-op ([#884]).
2525

26+
### Fixed
27+
28+
- hadoop: Fix the JMX exporter configuration for metrics suffixed with
29+
`_total`, `_info` and `_created` ([#962]).
30+
2631
[#884]: https://github.com/stackabletech/docker-images/pull/884
2732
[#928]: https://github.com/stackabletech/docker-images/pull/928
2833
[#943]: https://github.com/stackabletech/docker-images/pull/943
@@ -31,6 +36,7 @@ All notable changes to this project will be documented in this file.
3136
[#955]: https://github.com/stackabletech/docker-images/pull/955
3237
[#958]: https://github.com/stackabletech/docker-images/pull/958
3338
[#959]: https://github.com/stackabletech/docker-images/pull/959
39+
[#962]: https://github.com/stackabletech/docker-images/pull/962
3440

3541
## [24.11.0] - 2024-11-18
3642

hadoop/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ ARG TARGETARCH
1111
ARG TARGETOS
1212
ARG STACKABLE_USER_UID
1313

14-
WORKDIR /stackable
15-
16-
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/jmx /stackable/jmx
17-
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/fuse_dfs_wrapper /stackable/fuse_dfs_wrapper
14+
WORKDIR /stackable/jmx
1815

1916
# The symlink from JMX Exporter 0.16.1 to the versionless link exists because old HDFS Operators (up until and including 23.7) used to hardcode
2017
# the version of JMX Exporter like this: "-javaagent:/stackable/jmx/jmx_prometheus_javaagent-0.16.1.jar"
@@ -27,6 +24,8 @@ RUN curl "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prome
2724
ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar && \
2825
ln -s /stackable/jmx/jmx_prometheus_javaagent.jar /stackable/jmx/jmx_prometheus_javaagent-0.16.1.jar
2926

27+
WORKDIR /stackable
28+
3029
RUN ARCH="${TARGETARCH/amd64/x64}" && \
3130
curl "https://repo.stackable.tech/repository/packages/async-profiler/async-profiler-${ASYNC_PROFILER}-${TARGETOS}-${ARCH}.tar.gz" | tar -xzC . && \
3231
ln -s "/stackable/async-profiler-${ASYNC_PROFILER}-${TARGETOS}-${ARCH}" /stackable/async-profiler
@@ -141,6 +140,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/jmx /stack
141140
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/async-profiler /stackable/async-profiler/
142141
COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar
143142
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/fuse_dfs_wrapper /stackable/
143+
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/jmx /stackable/jmx
144144

145145

146146
# fuse is required for fusermount (called by fuse_dfs)

hadoop/stackable/jmx/datanode.yaml

+48-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ rules:
2222
kind: 'MetricsSystem'
2323
sub: $2
2424
type: GAUGE
25+
# FSDatasetState with _total suffix (also extracts the FSDataset ID),
26+
# e.g. Hadoop:name=FSDatasetState,attribute=EstimatedCapacityLostTotal
27+
- pattern: 'Hadoop<service=(.*), name=FSDatasetState-(.*)><>(.*_total): (\d+)'
28+
attrNameSnakeCase: true
29+
name: hadoop_$1_$3
30+
value: $4
31+
labels:
32+
service: HDFS
33+
role: $1
34+
fsdatasetid: $2
35+
kind: 'FSDatasetState'
36+
type: COUNTER
2537
# FSDatasetState (also extracts the FSDataset ID)
2638
- pattern: 'Hadoop<service=(.*), name=FSDatasetState-(.*)><>(.*): (\d+)'
2739
attrNameSnakeCase: true
@@ -33,7 +45,19 @@ rules:
3345
fsdatasetid: $2
3446
kind: 'FSDatasetState'
3547
type: GAUGE
36-
# DataNodeActivity (also extracts hostname and port)
48+
# DataNodeActivity with _info suffix (also extracts hostname and port),
49+
# e.g. Hadoop:name=DataNodeActivity-hdfs-datanode-default-0-9866,attribute=BlocksGetLocalPathInfo
50+
- pattern: 'Hadoop<service=(.*), name=DataNodeActivity-(.*)-(\d+)><>(.*_info): (\d+)'
51+
attrNameSnakeCase: true
52+
name: hadoop_$1_$4_
53+
value: $5
54+
labels:
55+
service: HDFS
56+
role: $1
57+
host: $2
58+
port: $3
59+
kind: 'DataNodeActivity'
60+
type: GAUGE
3761
- pattern: 'Hadoop<service=(.*), name=DataNodeActivity-(.*)-(\d+)><>(.*): (\d+)'
3862
attrNameSnakeCase: true
3963
name: hadoop_$1_$4
@@ -45,8 +69,29 @@ rules:
4569
port: $3
4670
kind: 'DataNodeActivity'
4771
type: GAUGE
48-
# All other services
49-
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (\d+)'
72+
# Generic counter, e.g. Hadoop:name=FSDatasetState,attribute=EstimatedCapacityLostTotal
73+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*_total): (\d+)'
74+
attrNameSnakeCase: true
75+
name: hadoop_$1_$3
76+
value: $4
77+
labels:
78+
service: HDFS
79+
role: $1
80+
kind: $2
81+
type: COUNTER
82+
# Metrics suffixed with _info, e.g. Hadoop:name=JvmMetrics,attribute=LogInfo
83+
# The suffix _info is reserved for static information, therefore an underscore is appended.
84+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*_info): (.*)'
85+
attrNameSnakeCase: true
86+
name: hadoop_$1_$3_
87+
value: $4
88+
labels:
89+
service: HDFS
90+
role: $1
91+
kind: $2
92+
type: GAUGE
93+
# All other Hadoop metrics
94+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (.*)'
5095
attrNameSnakeCase: true
5196
name: hadoop_$1_$3
5297
value: $4

hadoop/stackable/jmx/journalnode.yaml

+13-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,19 @@ rules:
2323
kind: 'MetricsSystem'
2424
sub: $2
2525
type: GAUGE
26-
# All JournalNode infos
27-
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (\d+)'
26+
# Metrics suffixed with _info, e.g. Hadoop:name=JvmMetrics,attribute=LogInfo
27+
# The suffix _info is reserved for static information, therefore an underscore is appended.
28+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*_info): (.*)'
29+
attrNameSnakeCase: true
30+
name: hadoop_$1_$3_
31+
value: $4
32+
labels:
33+
service: HDFS
34+
role: $1
35+
kind: $2
36+
type: GAUGE
37+
# All other Hadoop metrics
38+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (.*)'
2839
attrNameSnakeCase: true
2940
name: hadoop_$1_$3
3041
value: $4

hadoop/stackable/jmx/namenode.yaml

+44-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,50 @@ rules:
2323
kind: 'MetricsSystem'
2424
sub: $2
2525
type: GAUGE
26-
# All NameNode infos
27-
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (\d+)'
26+
# Total raw capacity in bytes, e.g. Hadoop:name=NameNodeInfo,attribute=Total
27+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(total): (\d+)'
28+
attrNameSnakeCase: true
29+
name: hadoop_$1_$3
30+
value: $4
31+
labels:
32+
service: HDFS
33+
role: $1
34+
kind: $2
35+
type: COUNTER
36+
# Generic counter, e.g. Hadoop:name=FSNamesystem,attribute=FilesTotal
37+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*_total): (\d+)'
38+
attrNameSnakeCase: true
39+
name: hadoop_$1_$3
40+
value: $4
41+
labels:
42+
service: HDFS
43+
role: $1
44+
kind: $2
45+
type: COUNTER
46+
# Metrics suffixed with _created, e.g. Hadoop:name=NameNodeActivity,attribute=FilesCreated
47+
# The suffix _created is reserved for timestamps, therefore an underscore is appended.
48+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*_created): (.*)'
49+
attrNameSnakeCase: true
50+
name: hadoop_$1_$3_
51+
value: $4
52+
labels:
53+
service: HDFS
54+
role: $1
55+
kind: $2
56+
type: GAUGE
57+
# Metrics suffixed with _info, e.g. Hadoop:name=JvmMetrics,attribute=LogInfo
58+
# The suffix _info is reserved for static information, therefore an underscore is appended.
59+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*_info): (.*)'
60+
attrNameSnakeCase: true
61+
name: hadoop_$1_$3_
62+
value: $4
63+
labels:
64+
service: HDFS
65+
role: $1
66+
kind: $2
67+
type: GAUGE
68+
# All other Hadoop metrics
69+
- pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (.*)'
2870
attrNameSnakeCase: true
2971
name: hadoop_$1_$3
3072
value: $4

0 commit comments

Comments
 (0)