Skip to content

Conversation

Copy link

Copilot AI commented Dec 29, 2025

The codebase was using deprecated InfluxDB client APIs (InfluxDBClientFactory.CreateV1() and WriteOptions.Builder()) that have been obsolete since v4.x.

Changes

InfluxDbOutput.cs

  • Replaced factory method with direct constructor: new InfluxDBClient(url, username, password, database, retentionPolicy)
  • Replaced builder pattern with object initializer: new WriteOptions { BatchSize = ..., FlushInterval = ... }
  • Removed unnecessary password char array conversion
- char[] password = string.IsNullOrWhiteSpace(_settings.Password) ? null : _settings.Password.ToCharArray();
- _client = InfluxDBClientFactory.CreateV1(_settings.Url, _settings.Username, password, _settings.Database, _settings.RetentionPolicy);
+ _client = new InfluxDBClient(_settings.Url, _settings.Username, _settings.Password, _settings.Database, _settings.RetentionPolicy);

- _writeApi = _client.GetWriteApi(new WriteOptions.Builder().BatchSize(_settings.WriteBatchSize).FlushInterval(_settings.WriteFlushIntervalMillis).Build());
+ _writeApi = _client.GetWriteApi(new WriteOptions
+ {
+     BatchSize = _settings.WriteBatchSize,
+     FlushInterval = _settings.WriteFlushIntervalMillis
+ });

Eliminates CS0618 deprecation warnings while maintaining identical runtime behavior.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/influxdata/influxdb-client-csharp/contents/Client/Writes/WriteOptions.cs
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/repos/influxdata/influxdb-client-csharp/releases
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>update influx client</issue_title>
<issue_description>https://github.com/influxdata/influxdb-client-csharp/releases
there are some performance imprufements
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: bqstony <10487253+bqstony@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Influx client for performance improvements Migrate InfluxDB client from deprecated APIs to object initializers Dec 29, 2025
Copilot AI requested a review from bqstony December 29, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update influx client

2 participants