grafonnet icon indicating copy to clipboard operation
grafonnet copied to clipboard

Support Influxdb

Open lohrm-stabl opened this issue 1 year ago • 4 comments

Currently, there are no query target helpers/functions (not sure what the correct terminology is) for InfluxDB InfluxQL nor InfluxDB Flux. It would be great to have them at least for InfluxQL, as this data source is quite popular.

The way it has to be done right now:

+ g.panel.timeSeries.queryOptions.withTargets([
        time.queryOptions.withDatasource('influxdb', influxFluxDataSource)
        + {
          alias: 'Frequency',
          groupBy: [
            {
              params: [
                '$__interval',
              ],
              type: 'time',
            },
            {
              params: [
                'none',
              ],
              type: 'fill',
            },
          ],
          measurement: 'telemetry_v2',
          orderByTime: 'ASC',
          policy: 'default',
          query: '',
          refId: 'A',
          resultFormat: 'time_series',
          select: [
            [
              {
                params: [
                  'system_frequency_freq_hz',
                ],
                type: 'field',
              },
              {
                params: [],
                type: 'mean',
              },
            ],
          ],
          tags: [
            {
              key: 'device_id',
              operator: '=~',
              value: '/^$device$/',
            },
          ],
        },
      ])

lohrm-stabl avatar Nov 08 '23 16:11 lohrm-stabl

This would be a nice library but currently we haven't figured out the flow to create libraries for plugins, we'll keep this open as we're looking for possible solutions.

Duologic avatar Nov 21 '23 08:11 Duologic

Any updates on this? Also, have you checked out this file for making libraries for InfluxDB in this repo?

hnfNaufal avatar Dec 02 '24 07:12 hnfNaufal

Any updates on this?

Iotnet avatar Jan 08 '25 01:01 Iotnet

Nothing planned yet, sorry.

Duologic avatar Jan 13 '25 09:01 Duologic