• Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major Major
    • influxdb-plugin
    • None
    • 2.1

      I want to customize the tags and keys in the collected data. As of now only the project name is the tag in influxdb. But i want add some more fields as tags in influxdb.

      Example

      I want to filter the data build wise. So that i want to add the build number as tag in the influxdb.

       

       

      And also i could not get the pipeline data such as stage duration, failed at which stage.

       

          [JENKINS-54445] Add more common tags for all measurements

          Aleksi Simell added a comment -

          Custom tags were added in PR 32 (https://github.com/jenkinsci/influxdb-plugin/pull/32). Does this already address your issue? You can add build number tag to your build with adding a jenkins-env-parameter tag build_number=${BUILD_NUMBER}.

          Aleksi Simell added a comment - Custom tags were added in PR 32 ( https://github.com/jenkinsci/influxdb-plugin/pull/32 ). Does this already address your issue? You can add build number tag to your build with adding a jenkins-env-parameter tag build_number=${BUILD_NUMBER}.

          Thanks for replying. The pull request 32 will solve our one requirement. But we have one more requirement blocking our progress. Which is already created as ticket by someone else. The ticket is https://issues.jenkins-ci.org/browse/JENKINS-53360

           

          We are publishing data as step configuration of InfluxDb as below 

          step([$class: 'InfluxDbPublisher', customData: myDataMap, customDataMap: myCustomDataMap, customPrefix: null, target: 'Influxtarget'])

          But we do not know how to configure the  jenkins-env-parameter tag build_number=${BUILD_NUMBER}. And also we could not find the UI to configure the same. 

          Our Jenkins version is Jenkins ver. 2.107.3 and InfluxDb Plugin version is 1.20

           

           

          Mohamed Nazeer Mohamed Ibrahim added a comment - Thanks for replying. The pull request 32 will solve our one requirement. But we have one more requirement blocking our progress. Which is already created as ticket by someone else. The ticket is https://issues.jenkins-ci.org/browse/JENKINS-53360 .    We are publishing data as step configuration of InfluxDb as below  step( [$class: 'InfluxDbPublisher', customData: myDataMap, customDataMap: myCustomDataMap, customPrefix: null, target: 'Influxtarget'] ) But we do not know how to configure the  jenkins-env-parameter tag build_number=${BUILD_NUMBER}. And also we could not find the UI to configure the same.  Our Jenkins version is  Jenkins ver. 2.107.3  and InfluxDb Plugin version is 1.20    

          Aleksi Simell added a comment - - edited

          mohamednazeer You can add build number tag in your pipeline by adding for example

          jenkinsEnvParameterTag: 'build_number=' + env.BUILD_NUMBER
          

          to your step.

          Aleksi Simell added a comment - - edited mohamednazeer You can add build number tag in your pipeline by adding for example jenkinsEnvParameterTag: 'build_number=' + env.BUILD_NUMBER to your step.

          Thank you very much its working.

          could you please give some update for https://issues.jenkins-ci.org/browse/JENKINS-53360 

           

          Thanks in advance

          Mohamed Nazeer Mohamed Ibrahim added a comment - Thank you very much its working. could you please give some update for https://issues.jenkins-ci.org/browse/JENKINS-53360     Thanks in advance

          Aleksi Simell added a comment -

          My current project has kept me busy for a very long time, so I haven't had time to do any work on any ticket for quite some time. However, now my project is coming to an end so in the near future I might have more time to work on new features for the plugin (instead of just bug fixes and pull requests).

          In short: Nothing done whatsoever.

          Aleksi Simell added a comment - My current project has kept me busy for a very long time, so I haven't had time to do any work on any ticket for quite some time. However, now my project is coming to an end so in the near future I might have more time to work on new features for the plugin (instead of just bug fixes and pull requests). In short: Nothing done whatsoever.

          Aleksi Simell added a comment -

          Tags already implemented.

          Other issue continued in https://issues.jenkins-ci.org/browse/JENKINS-53360.

          Aleksi Simell added a comment - Tags already implemented. Other issue continued in https://issues.jenkins-ci.org/browse/JENKINS-53360 .

          Thank you so much

          Mohamed Nazeer Mohamed Ibrahim added a comment - Thank you so much

          Sorry to reopen this issue.

          The given solution is effect only for jenkins_data measurement. But the same is not reflect in other measurements which are collected by the same plugin such as "jacaco_data, suite_results, rf_results...etc"

           

          Thanks in advance

          Mohamed Nazeer Mohamed Ibrahim added a comment - Sorry to reopen this issue. The given solution is effect only for jenkins_data measurement. But the same is not reflect in other measurements which are collected by the same plugin such as "jacaco_data, suite_results, rf_results...etc"   Thanks in advance

          We have implemented the given solution but it seems the tags are not present in the databases.

          The influx version is : 1.5.4

          jenkins Configuration is :

          step([$class: 'InfluxDbPublisher', customData: myDataMap, customDataMap: null, customPrefix: null, target: 'Jenkins Build Status', jenkinsEnvParameterTag: 'build_number=' + env.BUILD_NUMBER])

           

          When we execute the below query in influxdb it shows nothing.

          SHOW TAG KEYS FROM "testcase_point"

           

           

           

          Mohamed Nazeer Mohamed Ibrahim added a comment - We have implemented the given solution but it seems the tags are not present in the databases. The influx version is : 1.5.4 jenkins Configuration is : step( [$class: 'InfluxDbPublisher', customData: myDataMap, customDataMap: null, customPrefix: null, target: 'Jenkins Build Status', jenkinsEnvParameterTag: 'build_number=' + env.BUILD_NUMBER] )   When we execute the below query in influxdb it shows nothing. SHOW TAG KEYS FROM "testcase_point"      

          Aleksi Simell added a comment - - edited

          That is because with the current configuration the jenkinsEnvParameterTag adds the tags only to the measurement "jenkins_data", as documented. I will try to add those tags to all measurements once I find time.

          Aleksi Simell added a comment - - edited That is because with the current configuration the jenkinsEnvParameterTag adds the tags only to the measurement "jenkins_data", as documented. I will try to add those tags to all measurements once I find time.

          Thanks for reply!!

          If i want to add some more tag keys then what should i do?

          Any specific format for this?

           

           

          Mohamed Nazeer Mohamed Ibrahim added a comment - Thanks for reply!! If i want to add some more tag keys then what should i do? Any specific format for this?    

          _peedus added a comment - - edited

          Hi aleksisimell,

          > the current configuration the jenkinsEnvParameterTag adds the tags only to the measurement "jenkins_data", as documented. I will try to add those tags to all measurements once I find time.

          Is there any tentative time when this will be available? Hope the same could be also done for 
          jenkinsEnvParameterField ?

          Thanks!

          _peedus added a comment - - edited Hi aleksisimell , > the current configuration the jenkinsEnvParameterTag adds the tags only to the measurement " jenkins_data ", as documented. I will try to add those tags to all measurements once I find time. Is there any tentative time when this will be available? Hope the same could be also done for  jenkinsEnvParameterField  ? Thanks!

          Aleksi Simell added a comment -

          Hi _peedus,

          I had completely forgotten this one. I made a note for myself to have this in my own "backlog". I will try to make this ASAP, but might not make it for the next release (I try to make releases ~once a month or so).

          Aleksi Simell added a comment - Hi _peedus , I had completely forgotten this one. I made a note for myself to have this in my own "backlog". I will try to make this ASAP, but might not make it for the next release (I try to make releases ~once a month or so).

          Aleksi Simell added a comment -

          I created https://github.com/jenkinsci/influxdb-plugin/pull/92 for myself today. It's mergeable, but will check a previous PR before merging that and then make necessary corrections to my PR after that.

          Aleksi Simell added a comment - I created  https://github.com/jenkinsci/influxdb-plugin/pull/92  for myself today. It's mergeable, but will check a previous PR before merging that and then make necessary corrections to my PR after that.

          Aleksi Simell added a comment -

          PR 92 merged. Will be available in the next release.

          Aleksi Simell added a comment - PR 92 merged. Will be available in the next release.

          bose boban added a comment -

          aleksisimell is there any way for enabling new fields along with global  Listener? while I am using publish it's pulling the middle of the job and missing build status message and pulling last build details instead of current. Its making confusing while reading data.

          So can I get it to know is there any way for proceed this

           

          bose boban added a comment - aleksisimell  is there any way for enabling new fields along with global  Listener? while I am using publish it's pulling the middle of the job and missing build status message and pulling last build details instead of current. Its making confusing while reading data. So can I get it to know is there any way for proceed this  

            aleksisimell Aleksi Simell
            mohamednazeer Mohamed Nazeer Mohamed Ibrahim
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: