• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • influxdb-plugin
    • None

      This feature may already exist. I am using the following code, as per the documentation.

      def myFields1 = [:]
      def myFields2 = [:]
      def myCustomMeasurementFields = [:]
      myFields1['field_a'] = 11
      myFields1['field_b'] = 12
      myFields2['field_c'] = 21
      myFields2['field_d'] = 22
      myCustomMeasurementFields['series_1'] = myFields1
      myCustomMeasurementFields['series_2'] = myFields2
      myTags = ['series_1':['tag_a':'a','tag_b':'b'],'series_2':['tag_c':'c','tag_d':'d']]
      influxDbPublisher(selectedTarget: 'my-target', customDataMap: myCustomMeasurementFields, customDataMapTags: myTags)

      Beyond this, It is not stated how I can replace field values in existing influxdb tables. Running the original code a second time only duplicates existing fields.

          [JENKINS-66350] Can't overwrite existing tables

          Aleksi Simell added a comment -

          Hi, sorry for the long delay!

          The duplication happens because time is a primary key in InfluxDB. Essentially you're just writing a new measurement to a metric with a new timestamp. InfluxDB handles adding the timestamp on it's own and it's not manipulated by the plugin. In order to replace data in your InfluxDB you would need to overwrite the `time` data.

          You can of course also change the data retention policy to reduce the amount of data you keep stored.

          Aleksi Simell added a comment - Hi, sorry for the long delay! The duplication happens because time is a primary key in InfluxDB. Essentially you're just writing a new measurement to a metric with a new timestamp. InfluxDB handles adding the timestamp on it's own and it's not manipulated by the plugin. In order to replace data in your InfluxDB you would need to overwrite the `time` data. You can of course also change the data retention policy to reduce the amount of data you keep stored.

            aleksisimell Aleksi Simell
            haploid45 Daniel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: