Micrometer

Elasticsearch

+

Simple Microservice Monitoring

Micrometer

  • Think SL4J for metrics!
  • Collection facade
    • Time, count, and gauge code with a vendor neutral API

Micrometer

  • Out of the box with Spring:
    • JVM stats

    • CPU usage

    • Spring MVC and WebFlux request latencies

    • RestTemplate latencies

    • Cache utilization

    • Datasource utilization, including HikariCP pool metrics

    • RabbitMQ connection factories

    • File descriptor usage

    • Logback events

    • Uptime

    • Tomcat usage

Elasticsearch

  • Database for metrics and logs
  • Schema-free storage and retrieval via APIs
  • Available as an xPaaS offering
# Connection details for elastic
management.metrics.export.elastic.host=http://localhost:9200
management.metrics.export.elastic.index=metrics-index-name
management.metrics.export.elastic.indexDate=false
management.metrics.export.elastic.userName=svc.Metrics_Service_User
management.metrics.export.elastic.password=password

# Global Tags (Reported with every stat)
management.metrics.tags.environment=DevSandbox
management.metrics.tags.pod=${hostname}

Autoconfiguration

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-elastic</artifactId>
</dependency>

Dependencies

Setup

But it is difficult to analyse/visualise these metrics...

Not offered centrally but can be hosted and connected to the elasticsearch instance

Query Based Searching

Dashboarding

Micrometer + Elastic

By Mark Robinson

Micrometer + Elastic

  • 1,138
Loading comments...

More from Mark Robinson