influxdb-csharp
influxdb-csharp copied to clipboard
How to pass Auth Details?
I have just started working with the library passing points to a local instance. If I switch to an influx instance that requires auth, I simply don't find in the README file how to pass those details to a collector instance. Here's a sample of my code:
Metrics.Collector = new CollectorConfiguration()
.Tag.With("host", Environment.MachineName)
.Batch.AtInterval(TimeSpan.FromSeconds(5))
.WriteTo.InfluxDB(
Environment.GetEnvironmentVariable("InfluxDBServer"),
Environment.GetEnvironmentVariable("InfluxDBDatabase")
)
.CreateCollector();
Any suggestions on how to pass auth bearer and password?.
Many thanks,
@juliopereirab thanks for the issue. Here's the definition of InfluxDB which shows how to pass username and password: https://github.com/influxdata/influxdb-csharp/blob/master/src/InfluxDB.Collector/Configuration/CollectorEmitConfiguration.cs#L8