-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Description
We can select an MBean with string and numeric attributes and define a config section attributesAsLabels for all string attributes, but jmx_prometheus_javaagent will ignore all string attributes
See also:
- Support for exposing attributes as labels #996
- metricCustomizers / extraMetrics skips MBeans with string-only attributes #1147
Environment
- Java 21
- jmx-exporter (main) commit f024c74
- youtrack docker container jetbrains/youtrack:2025.1.62967
Config
jmx_exporter.yml
startDelaySeconds: 10
lowercaseOutputName: false
lowercaseOutputLabelNames: false
includeObjectNames: ["jetbrains.youtrack:type=Hub,name=HubIntegration"]
metricCustomizers:
- mbeanFilter:
domain: jetbrains.youtrack
properties:
type: Hub
name: HubIntegration
attributesAsLabels:
- HubIntegrationStatus
- PermissionCacheStatus
- PermissionCacheStatus
- RunningJob
- EventSyncStatusStatusyoutrack.jvmoptions
-XX:NativeMemoryTracking=summary
-XX:+PrintFlagsFinal
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.rmi.port=9011
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=127.0.0.1
-javaagent:/opt/app/jmx_prometheus_javaagent-1.1.0-post.jar=youtrack:9404:/opt/app/jmx_exporter.ymldocker-compose
services:
youtrack:
image: jetbrains/youtrack:2025.1.62967
hostname: youtrack
restart: "no"
ports:
- '9404:9404'
- '9010:9010'
- '9011:9011'
- "8080:8080"
tmpfs:
/tmp
volumes:
- ./volumes/youtrack_data:/opt/youtrack/data
- ./volumes/youtrack_conf:/opt/youtrack/conf
- ./volumes/youtrack_logs:/opt/youtrack/logs
- ./volumes/youtrack_backups:/opt/youtrack/backups
- ./volumes/youtrack_temp:/opt/youtrack/temp
- "./configs/youtrack/youtrack.jvmoptions:/opt/youtrack/conf/youtrack.jvmoptions:ro"
- "./configs/prometheus_jmx_exporter/jmx_exporter.yml:/opt/app/jmx_exporter.yml:ro"
- "./tools/jmx_prometheus_javaagent-1.1.0-post.jar:/opt/app/jmx_prometheus_javaagent-1.1.0-post.jar:ro"Steps
- Start a docker-compose
- Copy a wizard_token from the docker logs
- Open http://127.0.0.1:8080/
- Add the wizard_token from the logs: http://127.0.0.1:8080/?wizard_token=pk191NZmHm8GGTOfpdVy
- Start creating a new instance
- Set a domain:
- Set a password and tokens
- admin
- admin
- Wait a few seconds
- Install visualVM https://visualvm.github.io/
- Install a visualVM plugin: Menu / Tools / Plugins / Available Plugins / VisualVM MBean
- Connect from the VisualVM tool to the remote host: 127.0.0.1:9010
- Open an MBean with numeric and String attributes, for example jetbrains.youtrack:type=Hub,name=HubIntegration
Actual result
The output doesn't have any new labels, it has only numeric attributes and one label 'name':
# HELP jetbrains_youtrack_Hub_HubEventsFailed hubEventsFailed jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsFailed
# TYPE jetbrains_youtrack_Hub_HubEventsFailed untyped
jetbrains_youtrack_Hub_HubEventsFailed{name="HubIntegration"} 0.0
# HELP jetbrains_youtrack_Hub_HubEventsIgnored hubEventsIgnored jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsIgnored
# TYPE jetbrains_youtrack_Hub_HubEventsIgnored untyped
jetbrains_youtrack_Hub_HubEventsIgnored{name="HubIntegration"} 1.0
# HELP jetbrains_youtrack_Hub_HubEventsPending hubEventsPending jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsPending
# TYPE jetbrains_youtrack_Hub_HubEventsPending untyped
jetbrains_youtrack_Hub_HubEventsPending{name="HubIntegration"} 0.0
# HELP jetbrains_youtrack_Hub_HubEventsProcessed hubEventsProcessed jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsProcessed
# TYPE jetbrains_youtrack_Hub_HubEventsProcessed untyped
jetbrains_youtrack_Hub_HubEventsProcessed{name="HubIntegration"} 0.0
# HELP jetbrains_youtrack_Hub_HubEventsReceived hubEventsReceived jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsReceived
# TYPE jetbrains_youtrack_Hub_HubEventsReceived untyped
jetbrains_youtrack_Hub_HubEventsReceived{name="HubIntegration"} 1.0
Expected result
String attributes:
- HubIntegrationStatus
- PermissionCacheStatus
- PermissionCacheStatus
- RunningJob
- EventSyncStatusStatus
will be converted to labels
Reactions are currently unavailable

