• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • influxdb-plugin
    • None
    • Jenkins version: 2.346.1
      InfluxDB Version: 3.3
      Windows Server 2016
      InfluxDB: 2.?

      Hello,

      I am trying to push some customData to influxdb and everything works fine until I try to use an array in my data. To investigate the problem I wrote an small pipeline example with the following code: see attachement PipelineExample.txt

      If I try to push the data to influx I get the response:

      [InfluxDB Plugin] Collecting data...

      http://---/Pipeline-Test/detail/Pipeline-Test/84/pipeline/#step-39-log-2[InfluxDB Plugin] Custom data map found. Writing to InfluxDB...

      http://---/Pipeline-Test/detail/Pipeline-Test/84/pipeline/#step-39-log-3[InfluxDB Plugin] Failed to collect data. Ignoring Exception:java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')

      http://---/Pipeline-Test/detail/Pipeline-Test/84/pipeline/#step-39-log-4[InfluxDB Plugin] Publishing data to target 'InfluxDB' (url='', database='testbucket')

      http://---/Pipeline-Test/detail/Pipeline-Test/84/pipeline/#step-39-log-5[InfluxDB Plugin] Completed.

      I seems so that your plugin has a problem to push array data to influx. Why? Is it forbidden? How can I solve my problem?

          [JENKINS-69021] Error sending array to influx

          Aleksi Simell added a comment -

          Hi,

          What data are you actually trying to push? How does it look like? The snippet you pasted has several syntax errors and unknown macro that it's hard to follow what it's supposed to do.

          Sending custom data is documented in the plugin documentation. To put it simply: your data needs a key and a value, so just an array won't work. If your data looks something like this

          [
            {"key1": "value1"},
            {"key2": "value2"},
            {"key3": "value3"}
          ]
          

          then I have to admit that I haven't even tested that, but from the top of my head, I would say that that is not supported. This could be a nice addition to the plugin, but I think it would require a little bit of refactoring.

          Aleksi Simell added a comment - Hi, What data are you actually trying to push? How does it look like? The snippet you pasted has several syntax errors and unknown macro that it's hard to follow what it's supposed to do. Sending custom data is documented in the plugin documentation . To put it simply: your data needs a key and a value, so just an array won't work. If your data looks something like this [ { "key1" : "value1" }, { "key2" : "value2" }, { "key3" : "value3" } ] then I have to admit that I haven't even tested that, but from the top of my head, I would say that that is not supported. This could be a nice addition to the plugin, but I think it would require a little bit of refactoring.

          Hello,

          sorry but I pasted the correct code in to the description field and something else has been shown. Now I put the sample code into a seperate file and attached the file. I hope this helps.
          I am trying to push the following data to influx:

          {
          "ClangTidy":

          { "Failed": 1, "Succeeded": 2, "ProcessedFiles": 3 }

          ,
          "ClangFormat":

          { "Failed": 4, "Succeeded": 5, "ProcessedFiles": 6 }

          ,
          "Array": [

          {"a": 3}

          ,

          {"b": 4}

          ,

          {"c": 5}

          ]
          }

          Thanks for your help

          Christoph Hero added a comment - Hello, sorry but I pasted the correct code in to the description field and something else has been shown. Now I put the sample code into a seperate file and attached the file. I hope this helps. I am trying to push the following data to influx: { "ClangTidy": { "Failed": 1, "Succeeded": 2, "ProcessedFiles": 3 } , "ClangFormat": { "Failed": 4, "Succeeded": 5, "ProcessedFiles": 6 } , "Array": [ {"a": 3} , {"b": 4} , {"c": 5} ] } Thanks for your help

          Aleksi Simell added a comment -

          There is an open ticket about sending a list of values with the plugin: JENKINS-53360. Closing this as duplicate

          Aleksi Simell added a comment - There is an open ticket about sending a list of values with the plugin: JENKINS-53360 . Closing this as duplicate

            aleksisimell Aleksi Simell
            ckak07 Christoph Hero
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: