add InfluxDB2DataLogger (cli name influxdb2) to log into an InfluxDB 2.x #240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new logger named
influxdb2
.At first I wanted to expand the existing
influxdb
logger, but there are a few differences between 1.x and 2.x:db
parameterorg
andbucket
retention-policy
on write, instead the retention period is configured statically on the bucketThe token could have been added as an optional parameter, but the discrepancy between the single positional parameter
db
and the two parametersorg
/bucket
would have been awkward.I've tested this against a local influxdb running in docker (
docker run --rm -it --name influxdb -p 8086:8086 quay.io/influxdb/influxdb:v2.0.2
) and against the cloud version.The invocation to log it into the cloud would look like this:
Endpoint depends on the backend, for example
https://eu-central-1-1.aws.cloud2.influxdata.com
org
can either be the Organization name or id. It can be copied from the UI url.This is my first PR against glasgow, and I don't do much python, so any feedback is welcome.