Support for Dropwizard metric names with encoded tags

The Metrics library (v4.x) does not natively support tags, however tags can be encoded as part of the metric name. This library offers a modified MetricName class for converting tagged metrics to the legay format.

Лицензия

Лицензия

Категории

Категории

DropWizard Контейнер Микросервисы Metrics Тестирование приложения и мониторинг Monitoring
Группа

Группа

de.peetzen.dropwizard.metrics
Идентификатор

Идентификатор

metrics-tagging
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

Support for Dropwizard metric names with encoded tags
The Metrics library (v4.x) does not natively support tags, however tags can be encoded as part of the metric name. This library offers a modified MetricName class for converting tagged metrics to the legay format.
Ссылка на сайт

Ссылка на сайт

https://github.com/peetzen/dropwizard-metrics-tagging
Система контроля версий

Система контроля версий

https://github.com/peetzen/dropwizard-metrics-tagging

Скачать metrics-tagging

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Tagging support for Dropwizard Metrics

CircleCI Maven Central License

The Metrics project from Dropwizard does not natively support tags in version v4.x. However, tags can be encoded as part of the metric name. This library offers a MetricName class for creating metric names and converting tagged metric names to the legacy format.

Documentation

This library adds support for creating metric names with tags.

The MetricName class is based on the code for Dropwizard metrics (v5.x) and adds methods for converting to the legacy metric name format. In addition, it contains support for dealing with tags from the MetricTaggingContext ThreadLocal context.

Getting started

The artifacts including source and binaries are available on the central Maven repositories.

For maven:

<dependency>
  <groupId>de.peetzen.dropwizard.metrics</groupId>
  <artifactId>metrics-tagging</artifactId>
  <version>1.0.1</version>
</dependency>

For gradle:

implementation group: 'de.peetzen.dropwizard.metrics', name: 'metrics-tagging', version: '1.0.1'

Fully compatible with Dropwizard Metrics version v4.x.

Usage

Create a metric name with a single explicit tag.

    String name = MetricName.build("my","metric").tagged("tenant", "tenant-id").toLegacyFormat();
    assert name.equals("my.metric[tenant:tenant-id]");

Create a metric name with a single tag fetched from the MetricTaggingContext context.

    MetricName metricName = MetricName.build("my","metric");
    MetricTaggingContext.put("tenant", "tenant-id")

    String name = metricName.taggedUsingContext().toLegacyFormat();
    assert name.equals("my.metric[tenant:tenant-id]");

Версии библиотеки

Версия
1.0.1
1.0.0