Skip to content

InfluxDB ​

InfluxDB is the recommended destination for Butler SOS operational metrics.

Why InfluxDB? ​

  • Purpose-built for metrics - Optimized for time-stamped data.
  • Pairs with Grafana - Create powerful dashboards for real-time monitoring.
  • Data retention policies - Automatically purge old data to manage disk space.
  • Aggregation - Summarize historical data to save space while keeping long-term trends.

Architecture Overview ​

Butler SOS supports three InfluxDB versions, each with a different API style:

VersionQuery languageClient libraryWrite styleTag/field name reuse
InfluxDB 1.xInfluxQLnode-influxPlain objects, batch writes✅ Same name allowed
InfluxDB 2.xFlux@influxdata/influxdb-clientBuilder pattern (Point)✅ Same name allowed
InfluxDB 3.xSQL@influxdata/influxdb3-clientBuilder pattern (Point3), line protocol❌ Same name not allowed

The underlying metrics stored are the same across all three versions — only the write API and query syntax differ.

Configuration ​

Butler SOS uses Butler-SOS.influxdbConfig for storing metrics.

Config BlockPurposeYAML Path
Operational MetricsHealth metrics, user/log eventsButler-SOS.influxdbConfig

Supported versions ​

VersionStatus
InfluxDB 1.x✅ Supported
InfluxDB 2.x✅ Supported
InfluxDB Cloud⚠️ Reported to work, not officially tested
InfluxDB 3.x✅ Supported

InfluxDB v3 Naming Constraints

InfluxDB v3 does not allow a tag and a field to have the same name in the same measurement. Butler SOS ensures this by default, but keep this in mind if you customize the schema.

v3 CPU Precision

InfluxDB v3 stores CPU percentage metrics as integers rather than floats. Values like 45.7% are truncated to 45. If you use CPU percentage thresholds in Grafana alerts, review them after switching to v3.

v2 → v3 Dashboard Migration Required

If you switch from InfluxDB v2 to v3, existing Grafana dashboards and InfluxDB queries may break because several field names change:

Data sourcev2 field namev3 field name
User eventsuserFulluserFull_field
User eventsuserIduserId_field
Scheduler log eventsapp_nameapp_name_field
Scheduler log eventsapp_idapp_id_field

Update all queries and dashboard panels to use the new field names before switching to v3.

Data retention ​

Butler SOS stores data in full detail without aggregation. Consider:

  • Storage growth - More servers + frequent polling + long retention = lots of data.
  • Recommended retention - 10-14 days is usually sufficient for operational monitoring. Audit data retention depends on your organization's compliance requirements.
  • Extended history - Use InfluxDB's aggregation features for longer-term trends.

TIP

The retention policy in the config file only applies when Butler SOS creates a new database/bucket. Existing databases keep their current settings.

Configuration: Operational Metrics ​

This section configures where general health metrics, user events, and log events are stored.

yaml
Butler-SOS:
  influxdbConfig:
    enable: true
    # Items below are mandatory if influxdbConfig.enable=true
    host: influxdb.mycompany.com   # InfluxDB host, hostname, FQDN or IP address
    port: 8086                      # Port where InfluxDB is listening, usually 8086
    version: 3                      # 1, 2 or 3 — which InfluxDB version is being used
    maxBatchSize: 1000              # Max data points per batch. On failure: 1000→500→250→100→10→1. Valid range: 1-10000

    # InfluxDB 3.x settings (used when version: 3)
    v3Config:
      database: mydatabase
      description: Butler SOS metrics
      token: mytoken
      retentionDuration: 10d
      writeTimeout: 10000           # Socket timeout when writing (ms). Default: 10000
      queryTimeout: 60000            # Socket timeout when querying (ms). Default: 60000

    # InfluxDB 2.x settings (used when version: 2)
    v2Config:
      org: myorg
      bucket: mybucket
      description: Butler SOS metrics
      token: mytoken
      retentionDuration: 10d

    # InfluxDB 1.x settings (used when version: 1)
    v1Config:
      auth:
        enable: false               # Does InfluxDB require authentication?
        username: <username>        # Mandatory if auth.enable=true
        password: <password>        # Mandatory if auth.enable=true
      dbName: senseops
      retentionPolicy:
        name: 10d
        duration: 10d                # Duration units: https://docs.influxdata.com/influxdb/v1.8/query_language/spec/#durations

    # Control what data is stored
    includeFields:
      activeDocs: false            # Can generate lots of data
      loadedDocs: false             # Can generate lots of data
      inMemoryDocs: false           # Can generate lots of data

maxBatchSize (default: 1000, range: 1–10000) controls how many data points are sent to InfluxDB in a single write operation. Larger values are more efficient; if a batch fails, Butler SOS writes the failed points again in smaller batches: 500 → 250 → 100 → 10 → 1. When InfluxDB cannot be reached, or is overloaded, it stops instead. See How Butler SOS retries failed writes.

Document lists ​

The includeFields settings in influxdbConfig control whether lists of active, loaded, and in-memory documents are stored:

Caution

Enabling activeDocs, loadedDocs, or inMemoryDocs can generate significant data volume, especially in environments with many apps.

  • activeDocs - Apps where users are currently working.
  • loadedDocs - Apps loaded in memory with active sessions.
  • inMemoryDocs - Apps in memory but without active sessions.

Understanding InfluxDB Write Log Messages ​

When Butler SOS writes data to InfluxDB, you may see log messages like:

2026-05-01T05:07:50.412Z info: INFLUXDB V3 RETRY: Health metrics for 192.168.100.109:4747 (chunk 1/1, points 0-7) - Write succeeded on attempt 2/4
2026-05-01T05:24:46.942Z warn: INFLUXDB V3 RETRY: Health metrics for 192.168.100.109:4747 (chunk 1/1, points 0-7) - Retryable error (r) on attempt 1/4, retrying in 1000ms...

The chunk and points notation applies to all InfluxDB versions (1.x, 2.x, 3.x). The only difference is the log prefix:

InfluxDB VersionLog Prefix
InfluxDB 1.xINFLUXDB V1 BATCH / INFLUXDB V1 RETRY
InfluxDB 2.xINFLUXDB V2 BATCH / INFLUXDB V2 RETRY
InfluxDB 3.xINFLUXDB V3 BATCH / INFLUXDB V3 RETRY

What are "points"? ​

Points are individual data measurements being written to InfluxDB. Each point represents a single metric (e.g., CPU usage, memory, session count, log event).

points 0-7 refers to the array index range within the current chunk — here, 8 data points at indices 0 through 7.

What are "chunks"? ​

Butler SOS batches points for efficient writing. The maxBatchSize setting (default: 1000) controls the maximum points per batch.

When there are more points than maxBatchSize, the array is split into chunks:

  • chunk 1/3 = chunk 1 of 3 total chunks
  • If all points fit in maxBatchSize, you'll see chunk 1/1

Retry Logic ​

The RETRY tag means the initial write failed and Butler SOS is retrying. There are two levels:

  1. Per-request retry: a request that fails with a temporary problem is retried up to three more times, 1, 2 and then 4 seconds apart, or longer when InfluxDB asks for it.
  2. Smaller batches: the points that still failed are written again in smaller batches, 500 → 250 → 100 → 10 → 1. This step is skipped when InfluxDB cannot be reached or is overloaded.

The details are in How Butler SOS retries failed writes.

Example Log Messages ​

Log MessageMeaning
INFLUXDB V3 RETRY: ... (chunk 1/1, points 0-7) - Write succeeded on attempt 2/4Write succeeded on 2nd retry (v3)
INFLUXDB V2 RETRY: ... (chunk 1/3, points 0-999) - Retryable error on attempt 1/4, retrying...First retry after timeout (v2)
INFLUXDB V1 BATCH: ... - Wrote the remaining N point(s) using batch size X (reduced from Y)Batch size reduced and the failed points written (v1)
INFLUXDB V3 RETRY: ... (chunk 1/1, points 0-0) - Write succeeded on attempt 2/4Empty or single-point chunk (v3)

TIP

points 0-0 in logs means the chunk contained either no data points or a single point at index 0. This is normal for event queues (user events, log events) that may have no new events during a polling interval.

WARNING

The retry logic only applies to retryable errors: timeouts and dropped connections (ETIMEDOUT, ECONNRESET), an InfluxDB that cannot be reached (ECONNREFUSED, ENOTFOUND and similar), and overloaded or unavailable answers (HTTP 408, 429, 502, 503, 504). Non-retryable errors (e.g., authentication failures) fail immediately without retries. An InfluxDB 1.x partial write is not retried either; see InfluxDB 1.x partial writes.

How Butler SOS retries failed writes ​

Changed in 15.1.2

Before Butler SOS 15.1.2, a write to an unreachable InfluxDB went through every smaller batch size, a partly failed write stored some points twice, and InfluxDB write errors were counted several times over.

When Butler SOS cannot write metrics to InfluxDB, it retries. Since 15.1.2:

  • When InfluxDB is down, the log stays readable. A failed write produces a handful of log lines instead of hundreds.
  • A partly failed write does not store some data points twice.
  • Error counts for InfluxDB writes are accurate, instead of several times too high.

This applies to InfluxDB v1, v2 and v3 alike.

How Butler SOS writes to InfluxDB ​

Butler SOS sends data points to InfluxDB in batches — at most maxBatchSize points per request (see the setting at the end of this page). If a request fails with a temporary problem — a timeout, a dropped connection, or InfluxDB answering that it is overloaded or briefly unavailable — Butler SOS retries it up to three more times, waiting 1, 2 and then 4 seconds between attempts. When InfluxDB says how long to wait (an HTTP Retry-After header), Butler SOS waits at least that long, up to 60 seconds.

If the batch still fails, Butler SOS tries again with smaller batches: 500, 250, 100, 10 and finally 1 point per request. This is meant for the case where one bad data point makes InfluxDB reject a whole batch. With small enough batches, everything except the bad point gets through.

What was wrong before 15.1.2 ​

Hundreds of log lines when InfluxDB was unreachable ​

When InfluxDB was down, or the address in the config was wrong, Butler SOS still went through every smaller batch size. Smaller batches cannot help when the server cannot be reached at all, so every step failed the same way, each after its own retries:

  • A single data point was attempted 24 times.
  • A batch of 25 points was attempted more than 120 times.
  • Large batches could take hours to give up, one point at a time.

Each failure was also recorded as a separate error event, and each of those was written to InfluxDB, which was down, with the same retries. In practice one lost data point could produce close to 300 log lines, burying whatever else was in the log.

Data points stored twice ​

When part of a batch failed, the next, smaller attempt wrote all the points again, including those that had already been stored. InfluxDB keeps these as separate points, so sums and counts built on them — event counts, for example — came out too high.

Error counts several times too high ​

A failed write was counted once for every batch size tried, plus once more. Daily error counts and the error summary in the log reported InfluxDB write failures up to seven times too often. With InfluxDB v2, failed writes of health metrics, user sessions and user events were counted twice.

What happens now ​

  • Unreachable or overloaded InfluxDB: stop after the normal retries. If InfluxDB cannot be reached at all, or keeps answering that it is overloaded or unavailable, Butler SOS still retries each request (four attempts in about 7 seconds, longer if InfluxDB asks for it), but then gives up on that batch instead of trying smaller ones. The batches after it are not attempted either, as they would fail the same way.
  • Only failed points are written again. Points that were stored successfully are not sent a second time, so they are not duplicated.
  • No pointless retries. Failed parts of a batch are retried in smaller batches only while that actually splits them. A data point that has already failed on its own is not sent again, and a single data point is written once (with its retries), not once per batch size.
  • One error per failed write. Each failed write is counted once, and its error event is written to InfluxDB with a single attempt. If InfluxDB is down, that attempt fails quickly and quietly instead of adding more retries to the log.
  • InfluxDB v2: no hidden extra retries. The InfluxDB v2 client library also retried failed writes in the background, on top of Butler SOS's own retries. That is now turned off for all v2 writes, so a failed write is retried only as described above. Butler SOS's own retries now cover the overloaded and unavailable answers the v2 library used to retry, for all InfluxDB versions.
  • InfluxDB v2: failed full batches are no longer missed. The v2 client library sent a batch on its own once it reached 1,000 points (the default maxBatchSize) and ignored whether that request failed. Butler SOS then treated a failed write as successful: no retry, no error count, and the points were lost without a trace. Every v2 write is now sent and checked by Butler SOS itself.

What counts as "unreachable" or "overloaded" ​

Butler SOS treats these as InfluxDB being unreachable or overloaded, and stops instead of trying smaller batches:

ErrorMeaning
ECONNREFUSEDNothing is listening on the InfluxDB host and port — InfluxDB is stopped, or the port is wrong
ENOTFOUNDThe InfluxDB host name cannot be found — usually a typo in the config, or a DNS problem
EAI_AGAINA temporary DNS failure
EHOSTUNREACH, ENETUNREACHThere is no network route to the InfluxDB host
No host availableInfluxDB v1 only: the client has marked the server as down after earlier failures
HTTP 429Too many requests — InfluxDB, or a service in front of it, is limiting how fast it accepts writes. Still failing after the retries.
HTTP 408, 502, 503, 504InfluxDB, or a proxy or load balancer in front of it, is overloaded, restarting or briefly unavailable. Still failing after the retries.

Timeouts and dropped connections (ETIMEDOUT, ECONNRESET) still go through smaller batches, because a smaller request can succeed where a large one timed out.

What you will see in the log ​

With InfluxDB v3 stopped, a failed write of Butler SOS memory metrics looks like this:

text
warn: INFLUXDB V3 RETRY: Memory usage metrics (chunk 1/1, points 0-0) - Retryable error (Error) on attempt 1/4, retrying in 1000ms...
warn: INFLUXDB V3 RETRY: Memory usage metrics (chunk 1/1, points 0-0) - Retryable error (Error) on attempt 2/4, retrying in 2000ms...
warn: INFLUXDB V3 RETRY: Memory usage metrics (chunk 1/1, points 0-0) - Retryable error (Error) on attempt 3/4, retrying in 4000ms...
error: INFLUXDB V3 RETRY: Memory usage metrics (chunk 1/1, points 0-0) - All 4 attempts failed. Last error: connect ECONNREFUSED 192.168.1.176:8181
error: INFLUXDB V3 BATCH: Memory usage metrics - InfluxDB could not be reached, so 1 of 1 point(s) were not written. Smaller batches are not tried, as they cannot help: connect ECONNREFUSED 192.168.1.176:8181
error: MEMORY USAGE V3: Error saving memory usage data to InfluxDB v3! Failed to write 1 of 1 point(s): connect ECONNREFUSED 192.168.1.176:8181

Several log messages changed in 15.1.2. If you search logs or have alerts on the old wording, these are the replacements:

Old messageNew message
... N chunk(s) failed with batch size X, retrying with smaller batches... Writing N point(s) from failed chunks again, with batch size Y
... Failed to write data even with batch size 1. N point(s) could not be written.... Failed to write N of M point(s), even with batch size X
... Successfully wrote all data using batch size X (reduced from Y)... Wrote the remaining N point(s) using batch size X (reduced from Y)
Failed to write batch after trying all progressive sizesFailed to write N of M point(s): <the reason InfluxDB gave>
(none)... InfluxDB could not be reached, so N of M point(s) were not written. Smaller batches are not tried, as they cannot help: <reason>
(none)... InfluxDB is not accepting writes right now (HTTP 503), so N of M point(s) were not written. Smaller batches are not tried, as they cannot help: <reason>

Error events with no server name are now labelled Error event: INFLUXDB_V3_WRITE instead of Error event: INFLUXDB_V3_WRITE/.

Effect on error counts and dashboards ​

If you track Butler SOS's own errors — the daily error summary in the log, or the butler_sos_errors measurement in InfluxDB — the count of InfluxDB write errors drops after upgrading to 15.1.2. That is the counting being corrected, not fewer problems: each failed write used to be counted several times, and is now counted once.

Each recorded InfluxDB write error now also carries the actual reason in its error_category field — for example connection_refused or host_not_found. Previously the one count that reached your dashboards was often categorised as unknown.

Dashboards built on sums or counts of Butler SOS metrics, such as event counts, may also show slightly lower values after a write problem than before. The old values were inflated by the duplicated points.

What has not changed ​

  • Data written while InfluxDB is down is still lost. Butler SOS does not store metrics on disk to send later. What changed is how quickly and quietly it gives up, not whether the data survives an outage.
  • The retries for each request — four attempts, 1, 2 and 4 seconds apart — are the same, except that overloaded and unavailable answers (HTTP 429, 503 and the like) are now retried too, waiting longer when InfluxDB asks for it.
  • Audit events sent to InfluxDB keep their own batching and their own timestamps; the changes to batches and timestamps above do not apply to them. They do share the retry rules, so they are now also retried on overloaded and unavailable answers, and wait for a Retry-After pause of up to 60 seconds. During such a pause, audit events reach InfluxDB later than they otherwise would.
yaml
Butler-SOS:
    influxdbConfig:
        maxBatchSize: 1000 # Largest number of data points written to InfluxDB in one request.
                           # Valid range 1-10000. Default 1000.
KeyDefaultDescription
Butler-SOS.influxdbConfig.maxBatchSize1000The largest batch Butler SOS sends to InfluxDB in one request. If a batch fails, smaller batches are tried as described above.
Butler-SOS.errorTracking.influxdb.enabletrue in the config templateWhether each error is also written to InfluxDB as an error event, in the measurement named by errorTracking.influxdb.measurementName (butler_sos_errors in the template). See Error Tracking.

InfluxDB 1.x partial writes ​

Changed in 15.4.0

Before Butler SOS 15.4.0, a partial write was treated as a failed write, and retried in smaller and smaller batches.

This applies when Butler SOS writes to InfluxDB 1.x.

What a partial write is ​

InfluxDB 1.x sometimes stores only part of what it is sent. It stores the data points it can, and drops the ones it won't take:

  • Points outside the retention policy. A point stamped further back than the database's retention period, for example older than 10 days when the retention policy is 10d. The retention policy Butler SOS creates by default is set by Butler-SOS.influxdbConfig.v1Config.retentionPolicy.duration.
  • Points with a field type conflict. A field that arrives as a number when the measurement already stores it as text, or the other way round.

InfluxDB then answers with an error that starts with "partial write", and says how many points it dropped.

What happened before ​

Butler SOS took that answer to mean the whole write had failed. It wrote the same points again, in smaller and smaller batches, down to one point at a time. Every attempt got the same answer for the same points, and each one wrote warnings to the log. A single write could produce several hundred warning and error lines in a few seconds, and end with an error like this, although InfluxDB had stored every point it was going to:

INFLUXDB V1 BATCH: <what was written> - Failed to write 101 of 576 point(s), even with batch size 1

What happens now ​

Butler SOS treats a partial write as done, because InfluxDB has stored everything it will store. It doesn't write those points again, and logs one warning per write, saying how many points InfluxDB dropped and why, in InfluxDB's own words:

INFLUXDB V1 BATCH: <what was written> - InfluxDB stored the write but dropped 101 of 576 point(s): points beyond retention policy or outside permissible write window

The reason is worded by InfluxDB, and differs a little between InfluxDB versions.

When InfluxDB doesn't say how many it dropped, the warning says "dropped some of".

Every other kind of failed write is handled as before: InfluxDB not answering, an authentication error, InfluxDB being overloaded or unavailable, and any other rejected write.

What to do ​

If you see this warning regularly:

  • Points beyond the retention policy: something is writing points with old timestamps, or the retention period is shorter than the data you want to keep. Check the retention policy of the Butler SOS database, and whether the warning names a kind of data that is backfilled or delayed.
  • Field type conflict: the same field has been written with two different types. The warning names the field and the measurement. That usually follows a change in what writes to the database. A field's type can't be changed within one InfluxDB 1.x shard, so the conflict ends when a new shard starts, or if the measurement is dropped.

Data point timestamps ​

Changed in 15.1.2

Before Butler SOS 15.1.2, data points were sent without a timestamp, so a retried write could store the same data twice.

Every data point Butler SOS writes to InfluxDB carries a timestamp set by Butler SOS, once, just before the point is first written. A retried write sends exactly the same points again instead of new ones, so a retry can no longer store data twice.

This applies to InfluxDB v1, v2 and v3, and to all metrics: health metrics, user sessions, user events, log events, event counts, queue metrics, Butler SOS memory usage and error events.

What was wrong ​

A data point in InfluxDB is identified by its measurement, its tags and its timestamp. Write the same point twice with the same timestamp, and InfluxDB keeps one. Write it twice with different timestamps, and InfluxDB keeps two.

Before 15.1.2 Butler SOS sent its data points without a timestamp:

  • With InfluxDB v2 and v3, the InfluxDB client library inside Butler SOS stamped each point with the current time every time it tried to write it.
  • With InfluxDB v1, the InfluxDB server stamped each point with the time it received it.

Either way, a retry produced points with a new time. That matters because a write can reach InfluxDB and be stored, yet still look failed to Butler SOS — most often when the reply takes longer than the timeout. Butler SOS then retried, and InfluxDB stored every point in that write a second time.

The result was quietly inflated numbers on dashboards that add things up — event counts, user event counts, session counts — after any period of slow or unstable InfluxDB connections.

How timestamps are set ​

Butler SOS gives every point its timestamp before the first write attempt, and keeps it for every retry. If an earlier attempt did reach InfluxDB, the retry overwrites the same points instead of adding copies.

Each timestamp is the time on the Butler SOS server, to the millisecond, when the write started. The finer digits of the timestamp hold a counter that goes up with every point, so that every point gets a different timestamp. That way two identical events in the same millisecond — one user opening the same app in two browser tabs at once, for example — are still stored as two points, rather than one overwriting the other. The same holds when the server's clock is set back and a millisecond comes round a second time.

What you may notice ​

InfluxDB v1: times come from the Butler SOS server's clock ​

With InfluxDB v1, data points used to get their time from the InfluxDB server's clock. They now get it from the Butler SOS server's clock. With InfluxDB v2 and v3 this was already the case.

If the two servers' clocks agree, nothing changes. If they differ, data written after the upgrade is shifted by the difference — a Butler SOS server running two minutes fast puts new data two minutes ahead of where it used to land, which can look like a small gap or overlap on a dashboard at the moment of the upgrade.

Keep the Butler SOS server's clock synchronised — with NTP, or with the Windows Time service on a domain-joined Windows server. That was already needed for InfluxDB v2 and v3.

Log events keep the time Butler SOS received them ​

Log events are stamped with the time Butler SOS processes them, as before — not the time written in the Qlik Sense log file row. Dashboards built on log events see no change.

Raw timestamps have non-zero final digits ​

If you look at raw timestamps in nanoseconds, the last six digits are not zeros: points written one after another look like 1792231788937000412, 1792231788937000413, 1792231788941000414. That is the counter described above. It is far below anything a dashboard shows.

Fewer inflated counts after connection problems ​

After a period of slow or unstable connections to InfluxDB, sums and counts no longer jump because of retried writes. Compared with before the upgrade, those numbers can come out lower. The new numbers are the correct ones.

What has not changed ​

  • Audit events written to InfluxDB use their own write path. Where an audit event carries its own time, that time is used, as before.
  • How often Butler SOS retries, and what happens when InfluxDB cannot be reached at all.
  • No configuration is needed. There are no new settings.

Released under the MIT License.