java.lang.Object
io.prometheus.metrics.instrumentation.dropwizard5.labels.CustomLabelMapper

public class CustomLabelMapper extends Object
A LabelMapper to allow Dropwizard metrics to be translated to Prometheus metrics including custom labels and names. Prometheus metric name and labels are extracted from the Dropwizard name based on the provided list of MapperConfigs. The FIRST matching config will be used.
  • Constructor Details

    • CustomLabelMapper

      public CustomLabelMapper(List<MapperConfig> mapperConfigs)
  • Method Details

    • getName

      public String getName(String dropwizardName)
    • getLabels

      public io.prometheus.metrics.model.snapshots.Labels getLabels(String dropwizardName, List<String> additionalLabelNames, List<String> additionalLabelValues)
    • getNameAndLabels

      protected io.prometheus.metrics.instrumentation.dropwizard5.labels.CustomLabelMapper.NameAndLabels getNameAndLabels(MapperConfig config, Map<String,String> parameters)