asynkron / Akka.OpenTelemetry

Apache License 2.0
5 stars 2 forks source link

Akka.OpenTelemetry

This is a library that provides OpenTelemetry instrumentation for Akka.NET. Status is work in progress.

Tracing currently works for:

And where it doesn't work:

Akka.OpenTelemetry has been tested with Asynkron TraceView

Asynkron TraceView

sequence diagram showing Akka.NET chat application with tracing component diagram showing Akka.NET chat application with tracing

There are currently no configuration support, all actors in /user/-space are traced.

Pull-requests are welcome.

Getting started

Installation

Install the NuGet package Akka.OpenTelemetry into your Akka.NET application.

Configuration

var tracerProvider = Sdk.CreateTracerProviderBuilder()
    .SetResourceBuilder(ResourceBuilder.CreateDefault()
        .AddService("Akka.OpenTelemetry.Demo")
    )
    .AddAkkaInstrumentation()
    .AddOtlpExporter(options =>
    {
        options.Endpoint = new Uri("http://localhost:4317");
        options.ExportProcessorType = ExportProcessorType.Batch;
    })
    .Build();

//augment config with OpenTelemetry settings
var bootstrap = BootstrapSetup.Create().WithOpenTelemetry();
var system = ActorSystem.Create("my-system", bootstrap);
var props = Props.Create<MyActor>();
var reff = system.ActorOf(props);