Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce open telemetry support #49

Merged
merged 1 commit into from
Apr 21, 2024
Merged

feat: introduce open telemetry support #49

merged 1 commit into from
Apr 21, 2024

Conversation

LarsSkovslund
Copy link
Collaborator

This PR introduces support for Open Telemetry.

To configure telemetry

builder
    .Services
    .AddOpenTelemetry()
    .WithMetrics(metrics =>
    {
        metrics
            .AddAspNetCoreInstrumentation()
            .AddHttpClientInstrumentation()
            .AddRuntimeInstrumentation();
    })
    .WithTracing(tracing =>
    {
        if (builder.Environment.IsDevelopment())
        {
            // We want to view all traces in development
            tracing.SetSampler(new AlwaysOnSampler());
        }

        tracing
            .AddAspNetCoreInstrumentation()
            .AddHttpClientInstrumentation()
            .AddSource(EventStoreDiagnostics.SourceName); // enable trace telemetry from event store and cqrs.
    });

To configure cosmos to emit otel telemetry, please see here. Cosmos client options are exposed on the EventStoreClientOptions.CosmosClientOptions.

Copy link

@rickykaare rickykaare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Awesome!

@LarsSkovslund LarsSkovslund merged commit 94cb0b9 into main Apr 21, 2024
1 check passed
@LarsSkovslund LarsSkovslund deleted the feature/otel branch April 21, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants