Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62441

InfluxDB plugin does not create custom measurement in the DB

      Hello Team ,

      I have configured InfluxDB plugin version 2.3 with a groovy pipeline.

      I am using InfluxDbPublisher to create custom data map with fields and tags. Though the job build with message 

      "Custom data map found. Writing to InfluxDB...

      Publishing data to target 'jenkins' (url='http://localhost:8086', database='apiresults')

      Completed."

       The custom measurement doesn't exist in the influx DB

      My config step is as below 

       

      def testField = [:]
      def testTag = [:]
      def testDataMeasurementFields = [:]
      def testDataMeasurementTags = [:]
      testField['total'] = results.getTotalCount()
      testField['passed'] = results.getPassCount()
      testTag['infra'] = 'aws'
      testTag['space'] = 'dev'
      testDataMeasurementFields['apitest'] = testField
      testDataMeasurementTags['apitest'] = testTag

      step([$class: 'InfluxDbPublisher', selectedTarget: 'jenkins', customDataMap: testDataMeasurementFields,
      customDataMapTags: testDataMeasurementTags, measurementName: 'apitest'])

       

       

          [JENKINS-62441] InfluxDB plugin does not create custom measurement in the DB

          Aleksi Simell added a comment -

          karthik_hg You're specifying a measurementName in your InfluxDbPublisher step. Your custom measurementName is the same as your custom measurement "apitest".

          From the documentation (https://plugins.jenkins.io/influxdb/)

          • measurementName (String) - custom measurement name (replaces default "jenkins_data" and "jenkins_custom_data")

          So, you're defining your custom data with the name "apitest", but you're also overwriting the default "jenkins_data" with the same name and thus, our custom measurement is overwritten.

          Try one of these solutions:

          • Don't give "measurementName" separately when you call "InfluxDbPublisher"
          • Give your custom measurement a different name
          • Give your "measurementName" a different name

          Any of those should resolve your issue.

           

          Aleksi Simell added a comment - karthik_hg You're specifying a measurementName in your InfluxDbPublisher step. Your custom measurementName is the same as your custom measurement "apitest". From the documentation ( https://plugins.jenkins.io/influxdb/ ) measurementName  (String) - custom measurement name (replaces default "jenkins_data" and "jenkins_custom_data") So, you're defining your custom data with the name "apitest", but you're also overwriting the default "jenkins_data" with the same name and thus, our custom measurement is overwritten. Try one of these solutions: Don't give "measurementName" separately when you call "InfluxDbPublisher" Give your custom measurement a different name Give your "measurementName" a different name Any of those should resolve your issue.  

          Aleksi Simell added a comment -

          Closing issue as this is not a defect. Please reopen if issue persists.

          Aleksi Simell added a comment - Closing issue as this is not a defect. Please reopen if issue persists.

            aleksisimell Aleksi Simell
            karthik_hg Karthik HG
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: