Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aledsz/opentelemetry-decorator

Decorator for Elixir OpenTelemetry API
https://github.com/aledsz/opentelemetry-decorator

Last synced: 3 days ago
JSON representation

Decorator for Elixir OpenTelemetry API

Awesome Lists containing this project

README

        

# OpenTelemetry Decorator

This library provide an easily interface to trace your application with [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-erlang-api) for Elixir, using decorations above your functions.

## Usage

```elixir
defmodule Foo do
use OpenTelemetryDecorator

@decorate with_span()
def bar do
{:ok, %{id: 123}}
end
end
```

## Configuration

If you and a custom handler for function results, you can add to your `config/*.exs`:

```elixir
config :opentelemetry_decorator, handler: MyApp.Handler
```

## Installation

The package can be installed by adding `opentelemetry_decorator` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:opentelemetry_decorator, "~> 0.1.0"}
]
end
```

## Documentation

Documentation can be found at [https://hexdocs.pm/opentelemetry_decorator](https://hexdocs.pm/opentelemetry_decorator).