All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.openlineage.client.metrics.StatsDMeterRegistryFactory Maven / Gradle / Ivy

There is a newer version: 1.26.0
Show newest version
/*
/* Copyright 2018-2024 contributors to the OpenLineage project
/* SPDX-License-Identifier: Apache-2.0
*/

package io.openlineage.client.metrics;

import io.micrometer.statsd.StatsdMeterRegistry;
import java.util.Map;

/**
 * StatsDMetricsBuilder is a class that implements the {@link MeterRegistryFactory} interface
 * specifically for {@link StatsdMeterRegistry}. It provides methods to check if the required {@link
 * StatsdMeterRegistry} class is available and build a {@link StatsdMeterRegistry} instance based on
 * a configuration map.
 *
 * @see StatsdConfig
 *     and StatsD micrometer interface docs
 */
public class StatsDMeterRegistryFactory implements MeterRegistryFactory {

  @Override
  public StatsdMeterRegistry registry(Map config) {
    return StatsdMeterRegistry.builder(s -> (String) config.get(s)).build();
  }

  @Override
  public String type() {
    return "statsd";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy