Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include full queue metrics in the monitoring index #42439

Merged
merged 5 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Fix setting unique registry for non beat receivers {issue}42288[42288] {pull}42292[42292]
- The Kafka output now drops events when there is an authorisation error {issue}42343[42343] {pull}42401[42401]
- Fix autodiscovery memory leak related to metadata of start events {pull}41748[41748]
- All standard queue metrics are now included in metrics monitoring, including: `added.{events, bytes}`, `consumed.{events, bytes}`, `removed.{events, bytes}`, and `filled.{events, bytes, pct}`. {pull}42439[42439]
- The following output latency metrics are now included in metrics monitoring: `output.latency.{count, max, median, p99}`. {pull}42439[42439]

*Auditbeat*

Expand Down
18 changes: 0 additions & 18 deletions libbeat/publisher/pipeline/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ type metricsObserverVars struct {
eventsTotal, eventsFiltered, eventsPublished, eventsFailed *monitoring.Uint
eventsDropped, eventsRetry *monitoring.Uint // (retryer) drop/retry counters
activeEvents *monitoring.Uint

// queue metrics
queueACKed *monitoring.Uint
queueMaxEvents *monitoring.Uint
percentQueueFull *monitoring.Float
}

func newMetricsObserver(metrics *monitoring.Registry) *metricsObserver {
Expand Down Expand Up @@ -118,19 +113,6 @@ func newMetricsObserver(metrics *monitoring.Registry) *metricsObserver {
// events.dropped counts events that were dropped because errors from
// the output workers exceeded the configured maximum retry count.
eventsDropped: monitoring.NewUint(reg, "events.dropped"),

// (Gauge) queue.max_events measures the maximum number of events the
// queue will accept, or 0 if there is none.
queueMaxEvents: monitoring.NewUint(reg, "queue.max_events"),

// queue.acked counts events that have been acknowledged by the output
// workers. This includes events that were dropped for fatal errors,
// which are also reported in events.dropped.
queueACKed: monitoring.NewUint(reg, "queue.acked"),

// (Gauge) queue.filled.pct.events measures the fraction (from 0 to 1)
// of the queue's event capacity that is currently filled.
percentQueueFull: monitoring.NewFloat(reg, "queue.filled.pct.events"),
},
}
}
Expand Down
29 changes: 28 additions & 1 deletion metricbeat/module/beat/stats/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,40 @@ var (
"write": c.Dict("write", s.Schema{
"bytes": c.Int("bytes"),
"errors": c.Int("errors"),
"latency": c.Dict("latency", s.Schema{
"count": c.Int("count"),
"max": c.Int("max"),
"median": c.Float("median"),
"p99": c.Float("p99"),
}),
}),
}),
"pipeline": c.Dict("pipeline", s.Schema{
"clients": c.Int("clients"),
"queue": c.Dict("queue", s.Schema{
"acked": c.Int("acked"),
"max_events": c.Int("max_events"),

"added": c.Dict("added", s.Schema{
"events": c.Int("events"),
"bytes": c.Int("bytes"),
}),
"consumed": c.Dict("consumed", s.Schema{
"events": c.Int("events"),
"bytes": c.Int("bytes"),
}),
"removed": c.Dict("removed", s.Schema{
"events": c.Int("events"),
"bytes": c.Int("bytes"),
}),
"filled": c.Dict("filled", s.Schema{
"events": c.Int("events"),
"bytes": c.Int("bytes"),
"pct": c.Float("pct"),
}),

// Backwards compatibility: "acked" is the old name for
// "removed.events" and should not be used by new code/dashboards.
"acked": c.Int("acked"),
}),
"events": c.Dict("events", s.Schema{
"active": c.Int("active"),
Expand Down
Loading