Skip to content

Commit

Permalink
Treat filebeat.events.active as gauge in monitoring log reporter
Browse files Browse the repository at this point in the history
The monitoring log reporting applies serial differencing to the filebeat.events.active value.
But this value is used as a gauge by Filebeat so it can increase and decrease. So by
reporting `current - prev` this can result in negative values that are not meaningful.
  • Loading branch information
andrewkroh committed Nov 7, 2022
1 parent 89a1134 commit 1cd5d4f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
- Add handling of AAA operations for Cisco ASA module. {issue}32257[32257] {pull}32789[32789]
- Fix gc.log always shipped even if gc fileset is disabled {issue}30995[30995]
- Fix handling of empty array in httpjson input. {pull}32001[32001]
- Fix reporting of `filebeat.events.active` in log events such that the current value is always reported instead of the difference from the last value. {pull}33597[33597]

*Heartbeat*
- Fix bug affecting let's encrypt and other users of cross-signed certs, where cert expiration was incorrectly calculated. {issue}33215[33215]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/beater/filebeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (fb *Filebeat) Run(b *beat.Beat) error {

// count active events for waiting on shutdown
wgEvents := &eventCounter{
count: monitoring.NewInt(nil, "filebeat.events.active"),
count: monitoring.NewInt(nil, "filebeat.events.active"), // Gauge
added: monitoring.NewUint(nil, "filebeat.events.added"),
done: monitoring.NewUint(nil, "filebeat.events.done"),
}
Expand Down
1 change: 1 addition & 0 deletions libbeat/monitoring/report/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var gauges = map[string]bool{
"libbeat.pipeline.clients": true,
"libbeat.config.module.running": true,
"registrar.states.current": true,
"filebeat.events.active": true,
"filebeat.harvester.running": true,
"filebeat.harvester.open_files": true,
"beat.memstats.memory_total": true,
Expand Down
4 changes: 2 additions & 2 deletions libbeat/publisher/pipeline/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func newMetricsObserver(metrics *monitoring.Registry) *metricsObserver {
return &metricsObserver{
metrics: metrics,
vars: metricsObserverVars{
clients: monitoring.NewUint(reg, "clients"),
clients: monitoring.NewUint(reg, "clients"), // Gauge

events: monitoring.NewUint(reg, "events.total"),
filtered: monitoring.NewUint(reg, "events.filtered"),
Expand All @@ -96,7 +96,7 @@ func newMetricsObserver(metrics *monitoring.Registry) *metricsObserver {
queueACKed: monitoring.NewUint(reg, "queue.acked"),
queueMaxEvents: monitoring.NewUint(reg, "queue.max_events"),

activeEvents: monitoring.NewUint(reg, "events.active"),
activeEvents: monitoring.NewUint(reg, "events.active"), // Gauge
},
}
}
Expand Down

0 comments on commit 1cd5d4f

Please sign in to comment.