Skip to content

Commit

Permalink
pkg/util/log: increment metric when failing to connect to fluentbit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abarganier committed Jul 12, 2023
1 parent 6623d16 commit ea63366
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/util/log/fluent_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (l *fluentSink) output(b []byte, opts sinkOutputOptions) (err error) {
}

if err := l.ensureConnLocked(b); err != nil {
logging.metrics.IncrementCounter(FluentSinkConnectionError, 1)
return err
}
return l.tryWriteLocked(b)
Expand Down

0 comments on commit ea63366

Please sign in to comment.