Spring Boot

ATSD storage driver for Spring Boot simplifies the process of instrumenting Spring Boot applications.


Name Required Default Value Description
metrics.export.url No http://localhost:8088/api/v1/command ATSD API URL
metrics.export.username Yes ATSD Username.
metrics.export.password Yes ATSD Password.
metrics.export.bufferSize No 64 Size of metrics buffer. Metrics writer flushes the buffer if full or by schedule (configured by spring.metrics.export.* properties.)
metrics.names.entity No atsd-default Entity name.
metrics.names.metricPrefix No Prefix added to the original metric name.
metrics.names.tags.* No Optional set of key-value pairs in the ATSD time series identifier.


Configuration settings are specified in the application.properties file.

application.properties file example:

metrics.export.username: admin
metrics.export.password: secret
metrics.export.url: http://atsd_hostname:8088/api/v1/command
metrics.export.bufferSize: 16
metrics.names.entity: spring-boot-sample
metrics.names.metricPrefix: spring-boot
metrics.names.tags.organization: Example


Refer to AtsdNamingStrategy and AtsdMetricWriter example.

Enable public metrics export:

public MetricsEndpointMetricReader metricsEndpointMetricReader(MetricsEndpoint metricsEndpoint) {
    return new MetricsEndpointMetricReader(metricsEndpoint);

public MetricWriter atsdMetricWriter() {
    AtsdMetricWriter writer = new AtsdMetricWriter();
    return writer;

public AtsdNamingStrategy namingStrategy() {
    return new DefaultAtsdNamingStrategy();

Wrapping Methods using Custom Metrics

Wrap all class methods.

public class JdbcCityRepository implements CityRepository

Wrap a specific method.

public List<City> findCities()