Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

How to pass Auth Details? #82

Open
juliopereirab opened this issue Feb 14, 2020 · 1 comment
Open

How to pass Auth Details? #82

juliopereirab opened this issue Feb 14, 2020 · 1 comment
Labels

Comments

@juliopereirab
Copy link

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,

@russorat
Copy link
Contributor

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants