galatea-associates / fuse-starter-java

Starter project for Galatea java projects
17 stars 73 forks source link

Gather/log metrics #322

Open cbaltera opened 4 years ago

cbaltera commented 4 years ago

Issue Description

Spring 2.0 introduced Micrometer as a "vendor-neutral application metrics facade." In the background this powers Spring Actuator. Micrometer integrates with a number of popular metrics backends including: a log file, Elastic, Graphic, Influx, JMX, Prometheus, and more. Micrometer provides an Interface to provide metrics to other backends (Geneos is something that comes to mind)

For this issue, take default Spring JVM metrics and a custom metric of your choosing, tag them (Micrometer introduces a concept of "tagging") with the Spring environment name and host name, and write them to a separate log file (example SO post: https://stackoverflow.com/questions/50193287/exporting-metrics-to-files-when-using-spring-boot-2-0). In future iterations, this could then be extended to write logs elsewhere.

Good reading on Micrometer: https://spring.io/blog/2018/03/16/micrometer-spring-boot-2-s-new-application-metrics-collector

This works towards an answer on #25

Design

[Description of the root cause for the issue and how to resolve it. Should be complete before Review is approved]

Documentation Changes

[Description of changes necessary to the Fuse documentation due to the changes in response to this issue. Should be complete before Review is approved]

Test Evidence

[include relevant tests and output. Should be complete before Review is approved]

Validation in Develop -- [Proof issue is resolved in Develop. Should be complete before Issue is closed]

mikegajda commented 4 years ago

Perhaps do along with #90 (change the log output to be JSON instead of regular log file)