Skip to content

Commit abd9c99

Browse files
committed
pkg/util/log: increment metric when failing to connect to fluentbit
Previous patches introduced the infrastructure necessary to record metrics within the log package without introducing circular dependencies. With all that plumbing done, we can now increment the metric representing fluentbit connection errors whenever a fluent-server log sink fails to establish a connection. Release note (ops change): This patch introduces the counter metric `fluent.sink.conn.errors` to the CockroachDB tsdb, which is exposed to `/_status/vars` clients as `fluent_sink_conn_errors`. The metric is incremented whenever a `fluent-server` log sink fails to establish a connection to the log sink pointed to by the `address` for the sink in the provided log config.
1 parent d15a362 commit abd9c99

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/util/log/fluent_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func (l *fluentSink) output(b []byte, opts sinkOutputOptions) (err error) {
7474
}
7575

7676
if err := l.ensureConnLocked(b); err != nil {
77+
logging.metrics.IncrementCounter(FluentSinkConnectionError, 1)
7778
return err
7879
}
7980
return l.tryWriteLocked(b)

0 commit comments

Comments
 (0)