Skip to content

[logging/metrics] Provide ability to log ops data from core metrics service #86162

@lukeelmers

Description

@lukeelmers

Related to #13241

In the legacy platform, we rely on the @hapi/good ops event for automatically logging ops metrics at a particular interval. The opsInterval is configurable and provided to the hapi/good configuration via the legacy logging server.

As part of our effort to remove our dependency on @hapi/good, we should provide some equivalent functionality in the Kibana platform logger via the metrics service.

Currently good includes a handful of metrics in the ops event payload**, however the legacy logger only pulls the following items from the ops event payload:

Ops formatted log property Location in @hapi/good ops payload Location in metrics service
type event ('ops')
@timestamp timestamp
tags -
pid pid process.pid
memory proc.mem.heapUsed process.memory.heap.used_in_bytes
uptime proc.uptime process.uptime_in_millis
load os.load os.load
delay proc.delay process.event_loop_delay

** More detail on the items good includes in the payload can be found in these old docs from even-better

Tasks:

  • Update the core metrics service to log these metrics at the ops.interval from config
    • Metrics should already be collecting all of these items in different locations, and is already using ops.interval to specify the collection interval
  • Integration tests
  • Documentation on where to find these logs moving forward

Open questions / things to investigate:

  • Which logging context to use?
    • 'metrics' probably makes the most sense unless there's a reason we want it to be separate from the logs related to the service itself
  • Is there anything we can remove/simplify in @kbn/legacy-logging that still preserves BWC?
    • e.g. Can we remove some of the special handling we are doing in the log formatting so that we are reformatting the existing data from the metrics service instead of what comes from the hapi/good ops events? This would be cleaner.

Metadata

Metadata

Assignees

Labels

Feature:LoggingTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//

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