A Micrometer plugin for Fluency. Send metrics of Micrometer to fluentd.
ThisBuild / scalaVersion := "2.12.8"
lazy val root = (project in file("."))
.settings(
libraryDependencies ++= Seq(
"io.github.yoyama" % "fluency-meter-registory_2.12" % VERSION)
object Example {
def main(args: Array[String]): Unit ={
val fluency:Fluency = new FluencyBuilderForFluentd().build()
val fconfig = new FluencyRegistryConfig {
override def prefix(): String = "default"
override def tag(): String = "example"
override def step(): Duration = Duration.ofSeconds(10)
}
val m = FluencyMeterRegistry(fconfig, HierarchicalNameMapper.DEFAULT, Clock.SYSTEM, fluency)
m.counter("count1").increment()
m.summary("summary1").record(999.9)
}
}
<dependencies>
<dependency>
<groupId>io.github.yoyama</groupId>
<artifactId>fluency-meter-registory_2.12</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
Fluency fluency = new FluencyBuilderForFluentd().build();
FluencyRegistryConfig fconfig = FluencyRegistryConfig.apply("example.java", "test", Duration.ofSeconds(10));
FluencyMeterRegistry meter = FluencyMeterRegistry.apply(fconfig, HierarchicalNameMapper.DEFAULT, Clock.SYSTEM, fluency);
meter.counter("count1").increment();
meter.summary("summary1").record(999.9);
Thread.sleep(30000);