Giter VIP home page Giter VIP logo

grafana-opentelemetry-dotnet's Introduction

Grafana logo OpenTelemetry logo

Grafana OpenTelemetry distribution for .NET

Build OATS Nuget SDK Slack

About

This is a pre-configured and pre-packaged bundle of OpenTelemetry .NET components, optimized for Grafana Cloud Application Observability.

It requires only minimal setup and configuration and makes it very easy to emit OpenTelemetry metrics, logs, and traces from your .NET application.

Getting Started

Step 1: Install package

For installing the distribution with the full set of dependencies, add a reference to the Grafana.OpenTelemetry package to your project.

dotnet add package --prerelease Grafana.OpenTelemetry

Step 2: Enable the Grafana distribution at application startup

The UseGrafana extension method on the TracerProviderBuilder or the MetricProviderBuilder can be used to set up the Grafana distribution. By default, telemetry data will be sent to Grafana Alloy or an OTel collector that runs locally and listens to default OTLP ports.

using var tracerProvider = Sdk.CreateTracerProviderBuilder()
    .UseGrafana()
    .Build();

Alternatively, you can send telemetry data directly to Grafana Cloud without involving an agent or collector. This can be configured via the environment variables OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_ENDPOINT, and OTEL_EXPORTER_OTLP_HEADERS.

For details on how to obtain those values, refer to Push directly from applications using the OpenTelemetry SDKs.

export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp-gateway-prod-eu-west-0.grafana.net/otlp"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic a-secret-token"

Documentation

For detailed documentation and setup instructions, refer to the following documents:

Troubleshooting

This project utilizes the self-diagnostics feature of the .NET OpenTelemetry SDK.

To enable self-diagnostics, go to the current working directory of your process and create a configuration file named OTEL_DIAGNOSTICS.json with the following content:

{
    "LogDirectory": ".",
    "FileSize": 32768,
    "LogLevel": "Warning"
}

To disable self-diagnostics, delete the above file.

Community

To engage with the Grafana Application Observability community:

grafana-opentelemetry-dotnet's People

Contributors

pyohannes avatar matt-hensley avatar nielspilgaard avatar zeitlinger avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.