Skip to content

[Metricbeat] documenting/standardizing the return of r.Event #11666

@fearful-symmetry

Description

@fearful-symmetry

This came up during a discussion with @ruflin and he asked me to file an issue.

So, there's some inconsistency about how we handle the bool that gets returned from reporter.Event(). This will only return false if the metricset has closed.

The vast majority of metricsets ignore this, however a few check the value and log an error:

./ceph/cluster_disk/cluster_disk.go:77: if reported := reporter.Event(mb.Event{MetricSetFields: event}); !reported {
./mongodb/dbstats/dbstats.go:89:                reported := reporter.Event(mb.Event{MetricSetFields: data})
./kubernetes/state_container/state_container.go:144:            if reported := reporter.Event(mb.Event{
./kubernetes/state_replicaset/state_replicaset.go:116:          if reported := reporter.Event(mb.Event{
./kubernetes/state_deployment/state_deployment.go:117:          if reported := reporter.Event(mb.Event{
./kubernetes/state_statefulset/state_statefulset.go:115:                if reported := reporter.Event(mb.Event{

How should we standardize and document this? A blurb in the beats developer docs would be helpful, at least.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions