maven-central-badge build-badge

Welcome to reactive-streams-telemetry!

The goal of this Scala/Java library is to provide a Reactive Streams interface to Open Telemetry metrics and traces so that low memory utilization can be attained.

Metrics and traces are presented using streams where elements pertain to Open Telemetry's MetricData and SpanData classes respectively. Applications can consume these streams and present them however they wish e.g. Akka HTTP can be used to serve a snapshot of metrics and traces as JSON with an HTTP GET route. Another example could be where metrics and traces are published over UDP to your favorite collection engine.

Akka Streams is used as the Reactive Streams interface and implementation.

Other than the libraries declared above, there are no additional dependencies.


Serve up the latest telemetry gathered given an Alpakka Unix Domain Socket and the establishment of the metrics and traces sources from their respective exporters:

import akka.NotUsed
import{ Flow, Sink, Source }
import{ MetricProtobufMarshalling, SpanProtobufMarshalling }

val metrics: Source[MetricData, NotUsed] = ???
val traces: Source[SpanData, NotUsed] = ???

val source =
    .map { metricData =>
      import MetricProtobufMarshalling._
        .map { spanData =>
          import SpanProtobufMarshalling._


  .bindAndHandle(Flow.fromSinkAndSourceCoupled(Sink.ignore, source),
                 new File("/var/run/mysocket.sock"))

The above will just output the string representations of each element of telemetry.


Builds are published to Maven Central. Please substitute version accordingly.

"" %% "reactive-streams-telemetry" % version


Please check out the tests for sample usage.

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.


You'll need a GPG key to sign as artifacts are published to Sonatype for publishing at Maven Central. Once you have GPG setup:

export GPG_TTY=$(tty)
sbt publishSigned


This code is open source software licensed under the Apache-2.0 license.

(c) Copyright Titan Class Pty Ltd, 2019