Repository navigation
feat(inputs.jenkins): Allow adding build display name and description as tags - #20085
Merged
Merged
Conversation
…ption as tags Add an opt-in build_tags option that adds the build's displayName and/or description as tags on the jenkins_job metric. The default output is unchanged. Resolves influxdata#16514
srebhan
reviewed
Nov 11, 2026
Comment on lines
+466
to
+471
| if j.buildTagDisplayName && b.DisplayName != "" { | ||
| tags["display_name"] = b.DisplayName | ||
| } | ||
| if j.buildTagDescription && b.Description != "" { | ||
| tags["description"] = b.Description | ||
| } |
Member
There was a problem hiding this comment.
How about
Suggested change
| if j.buildTagDisplayName && b.DisplayName != "" { | |
| tags["display_name"] = b.DisplayName | |
| } | |
| if j.buildTagDescription && b.Description != "" { | |
| tags["description"] = b.Description | |
| } | |
| for _, t := range j.BuildTags { | |
| switch t { | |
| case "display_name": | |
| if b.DisplayName != "" { | |
| tags["display_name"] = b.DisplayName | |
| } | |
| case "description": | |
| if b.Description != "" { | |
| tags["description"] = b.Description | |
| } | |
| } |
as this allows us to get rid of the two boolean and stay more extensible in the future.
Contributor
Author
There was a problem hiding this comment.
Applied in 1fe1dd3, thanks. The two booleans are gone; Init() only validates the values now.
Contributor
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
srebhan
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in
build_tagsoption toinputs.jenkinsthat adds the build'sdisplayNameand/ordescriptionas tags onjenkins_job, as discussed inthe issue. Accepted values are
display_nameanddescription; anything elseis rejected in
Init(). The default is empty, so existing output does notchange. Empty values are not emitted as tags. The README notes the
cardinality cost.
There is no
buildingtag: the plugin skips builds that are still running, soit would always be
false.Checklist
Related issues
resolves #16514