-
Improvement
-
Resolution: Done
-
Minor
-
None
-
-
2.5
Some very nice work has been done by aleksisimell in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines.
You can see in the code that null is always sent to the PublicationService.
https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56
It would be nice if we could somehow specify that parameter as build environment variable.
pipeline { options { timestamps() skipDefaultCheckout() } parameters { string(name: 'MY_TAG_VALUE', description: 'The value of the tag', defaultValue: 'test') string(name: 'MY_FIELD_VALUE', description: 'The value of the field', defaultValue: '10') } agent { label "master" } stages { stage ("Run") { steps { script { env.INFLUXDB_PLUGIN_CUSTOM_TAGS = 'custom_tag=${MY_TAG_VALUE}' env.INFLUXDB_PLUGIN_CUSTOM_FIELDS = "custom_field=${MY_FIELD_VALUE}" // It can also work with string interpolation } } } } }
- is related to
-
JENKINS-54445 Add more common tags for all measurements
-
- Closed
-
- links to
[JENKINS-62753] Allow common tags to be used by pipelines and global listener
Description |
Original:
Some very nice work has been done by [~aleksisimell] in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines. You can see in the code that null is always sent to the PublicationService. https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56 It would be nice if we could somehow specify that parameter as build environment variable. |
New:
Some very nice work has been done by [~aleksisimell] in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines. You can see in the code that null is always sent to the PublicationService. https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56 It would be nice if we could somehow specify that parameter as build environment variable. [code] pipeline { options { timestamps() skipDefaultCheckout() } parameters { string(name: 'MY_TAG_VALUE', description: 'The value of the tag', defaultValue: 'test') string(name: 'MY_FIELD_VALUE', description: 'The value of the field', defaultValue: '10') } agent { label "ec2-fleet" as String } stages { stage ("Run") { steps { script { env.INFLUXDB_PLUGIN_PARAM_TAG = 'custom_tag=${MY_TAG_VALUE}' env.INFLUXDB_PLUGIN_PARAM_VALUE = "custom_value=${MY_FIELD_VALUE}" // It can also work with string interpolation } } } } } [code] |
Description |
Original:
Some very nice work has been done by [~aleksisimell] in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines. You can see in the code that null is always sent to the PublicationService. https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56 It would be nice if we could somehow specify that parameter as build environment variable. [code] pipeline { options { timestamps() skipDefaultCheckout() } parameters { string(name: 'MY_TAG_VALUE', description: 'The value of the tag', defaultValue: 'test') string(name: 'MY_FIELD_VALUE', description: 'The value of the field', defaultValue: '10') } agent { label "ec2-fleet" as String } stages { stage ("Run") { steps { script { env.INFLUXDB_PLUGIN_PARAM_TAG = 'custom_tag=${MY_TAG_VALUE}' env.INFLUXDB_PLUGIN_PARAM_VALUE = "custom_value=${MY_FIELD_VALUE}" // It can also work with string interpolation } } } } } [code] |
New:
Some very nice work has been done by [~aleksisimell] in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines. You can see in the code that null is always sent to the PublicationService. https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56 It would be nice if we could somehow specify that parameter as build environment variable. {code} pipeline { options { timestamps() skipDefaultCheckout() } parameters { string(name: 'MY_TAG_VALUE', description: 'The value of the tag', defaultValue: 'test') string(name: 'MY_FIELD_VALUE', description: 'The value of the field', defaultValue: '10') } agent { label "ec2-fleet" as String } stages { stage ("Run") { steps { script { env.INFLUXDB_PLUGIN_PARAM_TAG = 'custom_tag=${MY_TAG_VALUE}' env.INFLUXDB_PLUGIN_PARAM_VALUE = "custom_value=${MY_FIELD_VALUE}" // It can also work with string interpolation } } } } } {code} |
Link |
New:
This issue is related to |
Summary | Original: Allow common tags to be used by global listener | New: Allow common tags to be used by pipelines and global listener |
Description |
Original:
Some very nice work has been done by [~aleksisimell] in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines. You can see in the code that null is always sent to the PublicationService. https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56 It would be nice if we could somehow specify that parameter as build environment variable. {code} pipeline { options { timestamps() skipDefaultCheckout() } parameters { string(name: 'MY_TAG_VALUE', description: 'The value of the tag', defaultValue: 'test') string(name: 'MY_FIELD_VALUE', description: 'The value of the field', defaultValue: '10') } agent { label "ec2-fleet" as String } stages { stage ("Run") { steps { script { env.INFLUXDB_PLUGIN_PARAM_TAG = 'custom_tag=${MY_TAG_VALUE}' env.INFLUXDB_PLUGIN_PARAM_VALUE = "custom_value=${MY_FIELD_VALUE}" // It can also work with string interpolation } } } } } {code} |
New:
Some very nice work has been done by [~aleksisimell] in Jenkins-54445 to add tags on every metrics, but we cannot use that feature if we are using a GlobalListener like we are doing with pipelines. You can see in the code that null is always sent to the PublicationService. https://github.com/jenkinsci/influxdb-plugin/blob/development/src/main/java/jenkinsci/plugins/influxdb/global/GlobalRunListener.java#L55-L56 It would be nice if we could somehow specify that parameter as build environment variable. {code} pipeline { options { timestamps() skipDefaultCheckout() } parameters { string(name: 'MY_TAG_VALUE', description: 'The value of the tag', defaultValue: 'test') string(name: 'MY_FIELD_VALUE', description: 'The value of the field', defaultValue: '10') } agent { label "master" } stages { stage ("Run") { steps { script { env.INFLUXDB_PLUGIN_CUSTOM_TAGS = 'custom_tag=${MY_TAG_VALUE}' env.INFLUXDB_PLUGIN_CUSTOM_FIELDS = "custom_field=${MY_FIELD_VALUE}" // It can also work with string interpolation } } } } } {code} |
Remote Link | New: This issue links to "Github Pull Request #105 (Web Link)" [ 25713 ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Review [ 10005 ] | New: Fixed but Unreleased [ 10203 ] |
Released As | New: 2.5 | |
Resolution | Original: Fixed [ 1 ] | New: Done [ 10000 ] |
Status | Original: Fixed but Unreleased [ 10203 ] | New: Resolved [ 5 ] |