Skip to content

Fix invalid metric unit strings per OTel UCUM spec#1274

Open
esosaoh wants to merge 1 commit into
jenkinsci:mainfrom
esosaoh:fix/metric-unit-ucum-syntax
Open

Fix invalid metric unit strings per OTel UCUM spec#1274
esosaoh wants to merge 1 commit into
jenkinsci:mainfrom
esosaoh:fix/metric-unit-ucum-syntax

Conversation

@esosaoh

@esosaoh esosaoh commented Mar 31, 2026

Copy link
Copy Markdown

Fixes #1273.

Replaces "${description}" unit strings with "{description}" across four monitoring classes. The $ prefix is invalid in this context — UCUM annotations use plain curly braces. Other instruments in this codebase (SCMEventMonitoringInitializer, MonitoringCloudListener) already use the correct form.

Testing done

String literal changes to metric unit registration. No existing tests assert on instrument unit strings (test suite validates metric names and values, not units). Verified:

  • Build passes: ./mvnw clean install
  • Code formatting compliant: ./mvnw spotless:check
  • Changed lines executed: Build output confirms all four modified classes are compiled and indexed as Jenkins extensions:
    • io.jenkins.plugins.opentelemetry.init.JenkinsExecutorMonitoringInitializer indexed under hudson.Extension
    • io.jenkins.plugins.opentelemetry.init.PluginMonitoringInitializer indexed under hudson.Extension
    • io.jenkins.plugins.opentelemetry.queue.MonitoringQueueListener indexed under hudson.Extension
    • io.jenkins.plugins.opentelemetry.security.AuditingSecurityListener indexed under hudson.Extension
  • Integration tests exercise changed code: Test suite includes JenkinsOtelPluginIntegrationTest and JenkinsOtelPluginFreestyleIntegrationTest which instantiate Jenkins with the plugin loaded, triggering @PostConstruct methods that register these metrics

No new tests added, existing test coverage validates that metrics are registered and emit values correctly. The test suite does not assert on instrument unit strings (only metric names and values), which is appropriate since unit strings are metadata consumed by observability backends, not Jenkins runtime behavior.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@esosaoh esosaoh requested a review from a team as a code owner March 31, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metric unit strings use Groovy GString syntax instead of UCUM annotation syntax

1 participant