Description
Several metric instruments across the plugin are registered with unit strings that use "${description}" (Groovy GString interpolation syntax) instead of the correct "{description}" form required by the OTel Semantic Conventions — Instrument Units.
The OpenTelemetry Metrics API specifies that dimensionless, countable quantities must use UCUM annotation syntax: curly braces {...} wrapping a free-text description. The $ prefix has no meaning in this context — it is Groovy GString interpolation syntax accidentally applied to Java string literals where it has no effect on the value at the call site, but produces an invalid unit string in the emitted telemetry.
Affected Instruments
| File |
Metric |
Current (wrong) |
Expected (correct) |
| MonitoringQueueListener.java |
jenkins.queue.count |
"${tasks}" |
"{tasks}" |
| JenkinsExecutorMonitoringInitializer.java |
jenkins.executor.queue |
"${items}" |
"{items}" |
| JenkinsExecutorMonitoringInitializer.java |
jenkins.executor.total, jenkins.executor.count, jenkins.executor.available, jenkins.executor.busy, jenkins.executor.idle, jenkins.executor.online, jenkins.executor.connecting, jenkins.executor.defined |
"${executors}" |
"{executors}" |
| JenkinsExecutorMonitoringInitializer.java |
jenkins.node |
"${nodes}" |
"{nodes}" |
| PluginMonitoringInitializer.java |
jenkins.plugins.count, jenkins.plugins.updates |
"${plugins}" |
"{plugins}" |
| AuditingSecurityListener.java |
login, login_success, login_failure |
"${logins}" |
"{logins}" |
Impact
Observability backends that interpret UCUM units (e.g. Prometheus via the OTel→Prometheus unit mapping, Grafana) will receive malformed unit labels and may reject, ignore, or misformat them. Other instruments in this codebase — SCMEventMonitoringInitializer.java and MonitoringCloudListener.java — already use the correct {...} form, confirming the intended convention.
References
Description
Several metric instruments across the plugin are registered with unit strings that use
"${description}"(Groovy GString interpolation syntax) instead of the correct"{description}"form required by the OTel Semantic Conventions — Instrument Units.The OpenTelemetry Metrics API specifies that dimensionless, countable quantities must use UCUM annotation syntax: curly braces
{...}wrapping a free-text description. The$prefix has no meaning in this context — it is Groovy GString interpolation syntax accidentally applied to Java string literals where it has no effect on the value at the call site, but produces an invalid unit string in the emitted telemetry.Affected Instruments
jenkins.queue.count"${tasks}""{tasks}"jenkins.executor.queue"${items}""{items}"jenkins.executor.total,jenkins.executor.count,jenkins.executor.available,jenkins.executor.busy,jenkins.executor.idle,jenkins.executor.online,jenkins.executor.connecting,jenkins.executor.defined"${executors}""{executors}"jenkins.node"${nodes}""{nodes}"jenkins.plugins.count,jenkins.plugins.updates"${plugins}""{plugins}"login,login_success,login_failure"${logins}""{logins}"Impact
Observability backends that interpret UCUM units (e.g. Prometheus via the OTel→Prometheus unit mapping, Grafana) will receive malformed unit labels and may reject, ignore, or misformat them. Other instruments in this codebase — SCMEventMonitoringInitializer.java and MonitoringCloudListener.java — already use the correct
{...}form, confirming the intended convention.References