spring-boot-actuator-user-agent-metrics

Filter to log user agent statistics as spring boot actuator metrics

License

License

Categories

Categories

Spring Boot Container Microservices Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

eu.hinsch
ArtifactId

ArtifactId

spring-boot-actuator-user-agent-metrics
Last Version

Last Version

0.3.2
Release Date

Release Date

Type

Type

jar
Description

Description

spring-boot-actuator-user-agent-metrics
Filter to log user agent statistics as spring boot actuator metrics
Project URL

Project URL

https://github.com/lukashinsch/spring-boot-actuator-user-agent-metrics
Source Code Management

Source Code Management

https://github.com/lukashinsch/spring-boot-actuator-user-agent-metrics

Download spring-boot-actuator-user-agent-metrics

How to add to project

<!-- https://jarcasting.com/artifacts/eu.hinsch/spring-boot-actuator-user-agent-metrics/ -->
<dependency>
    <groupId>eu.hinsch</groupId>
    <artifactId>spring-boot-actuator-user-agent-metrics</artifactId>
    <version>0.3.2</version>
</dependency>
// https://jarcasting.com/artifacts/eu.hinsch/spring-boot-actuator-user-agent-metrics/
implementation 'eu.hinsch:spring-boot-actuator-user-agent-metrics:0.3.2'
// https://jarcasting.com/artifacts/eu.hinsch/spring-boot-actuator-user-agent-metrics/
implementation ("eu.hinsch:spring-boot-actuator-user-agent-metrics:0.3.2")
'eu.hinsch:spring-boot-actuator-user-agent-metrics:jar:0.3.2'
<dependency org="eu.hinsch" name="spring-boot-actuator-user-agent-metrics" rev="0.3.2">
  <artifact name="spring-boot-actuator-user-agent-metrics" type="jar" />
</dependency>
@Grapes(
@Grab(group='eu.hinsch', module='spring-boot-actuator-user-agent-metrics', version='0.3.2')
)
libraryDependencies += "eu.hinsch" % "spring-boot-actuator-user-agent-metrics" % "0.3.2"
[eu.hinsch/spring-boot-actuator-user-agent-metrics "0.3.2"]

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-actuator jar 2.1.4.RELEASE
org.springframework.boot : spring-boot-starter-web jar 2.1.4.RELEASE
nl.basjes.parse.useragent : yauaa jar 5.12

Project Modules

There are no modules declared in this project.

Coverage Status Build Status Maven Central

spring-boot-actuator-user-agent-metrics

Filter to log user agent statistics as spring boot actuator metrics. Uses Yauaa library (https://github.com/nielsbasjes/yauaa) under the hood.

Upgrade notice

With version 0.3 the baseline has been updated to java 11 and spring boot 2.1 and the underlying user agent parser library has been replaced with a more recent project. To match the new metrics framework (micrometer), the metrics concept has been changed from individual metrics keys per value (e.g. browser version) to a single metric with (configurable) tags. Therefore, the keys namespace in the configuration has been renamed to tags.

Note: do not use version 0.2.0, while it was updated to work with current framework versions, the library used for user agent parsing was outdated and could not correctly identify a number of current browsers.

Howto use

Gradle

runtime("eu.hinsch:spring-boot-actuator-user-agent-metrics:0.3.2")

Maven

<dependency>
  <groupId>eu.hinsch</groupId>
  <artifactId>spring-boot-actuator-user-agent-metrics</artifactId>
  <version>0.3.2</version>
</dependency>

Configuration

All config properties are located beneath the prefix user-agent-metric

Key Default Description
enabled false Turn metrics filter on/off
url-patterns empty list List of patterns (ant style) to match the servlet filter on
exclude-patterns empty list List of patterns (regex) to match against the request URI to exclude the request from metrics collection
tags empty list list of fields to be added as micrometer tags. For a list of available fields see https://github.com/nielsbasjes/yauaa/blob/master/analyzer/src/main/java/nl/basjes/parse/useragent/UserAgent.java

For an example see SpringBootActuatorUserAgentMetricsTestApplication and application.yml

Versions

Version
0.3.2
0.3.1
0.3.0
0.2.0
0.1.1
0.1.0