elastic / elastic/beats

Migrate remaining metrics global references to use Beat-level Monitoring

Open
#44,889 2 comments 0 reactions 0 assignees View on GitHub
Stalled Team:Elastic-Agent-Data-Plane
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 2h
Merged PRs (30d)
364

Description

https://github.com/elastic/beats/pull/44452 adds a self-contained `Monitoring` struct to each beat, replacing previous process-level globals and implicit string-keyed registries with explicit fields and accessors, and migrates many calls to the metrics API. However, some calls to the old global API require additional work to migrate, mostly because they occur in package initializers and similar, before the `Beat` struct exists. This issue lists the metrics that still need to be migrated. Metrics listed here will not work correctly in Beat Receiver (OTel) mode until they are migrated.

Some of the listed metrics may not need to be migrated; for example, the Kafka output will not be used in Beat Receiver mode, and thus there is no functional harm in leaving its metrics unchanged (it just blocks us from deleting the globals when the rest of the migration is complete). The same might be true of some processor metrics.

## Global ("stats") metrics

- [ ] auditd.*
- [ ] filebeat.harvester.*
- [ ] filebeat.inputs.kafka.*
- [ ] heartbeat.*
- [ ] kafka output: libbeat.outputs.{read.bytes, write.bytes, write.latency, kafka.requests-in-flight}
- [ ] processor.add_host_metadata.fqdn_lookup_failed
- [ ] processor.dns.*
- [ ] processor.rate_limit.*
- [ ] processor.javascript.*
- [ ] processor.syslog.*
- [ ] process@quark.*
- [ ] processor.add_session_metadata.processdb.*
- [ ] processor.add_session_metadata.kernel_tracing.*

## State registry metrics

- [ ] input.{count, names} (filebeat)
- [ ] module.{count, names} (filebeat, metricbeat)
- [ ] heartbeat.*

## Input ("dataset") metrics

- [ ] [harvester UUID].* (filebeat log input)
- All Filebeat inputs that use the old `inputmon` API instead of the metrics registry provided in the input context (migration of this case is usually very easy), including:
* [ ] tcp
* [ ] udp
* [ ] unix
* [ ] awscloudwatch
* [ ] awss3
* [ ] azureblobstorage
* [ ] azureeventhub
* [ ] cel
* [ ] entityanalytics
* [ ] gcppubsub
* [ ] gcs
* [ ] http_endpoint
* [ ] httpjson
* [ ] lumberjack
* [ ] streaming
* [ ] unifiedlogs
- [ ] Some packetbeat TCP / UDP metrics reported via `inputmon.NewInputRegistry`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.