2021-10-06 19:36:22 +00:00
|
|
|
# opentelemetry_cowboy
|
|
|
|
|
|
|
|
[![EEF Observability WG project](https://img.shields.io/badge/EEF-Observability-black)](https://github.com/erlef/eef-observability-wg)
|
2021-10-15 20:01:11 +00:00
|
|
|
[![Hex.pm](https://img.shields.io/hexpm/v/opentelemetry_cowboy)](https://hex.pm/packages/opentelemetry_cowboy)
|
2021-10-06 19:36:22 +00:00
|
|
|
![Build Status](https://github.com/open-telemetry/opentelemetry-erlang-contrib/workflows/Erlang/badge.svg)
|
|
|
|
|
2021-10-15 20:01:11 +00:00
|
|
|
Telemetry handler that creates Opentelemetry spans from cowboy events.
|
2021-10-06 19:36:22 +00:00
|
|
|
|
|
|
|
After installing, setup the handler in your application behaviour before your
|
|
|
|
top-level supervisor starts.
|
|
|
|
|
|
|
|
```erlang
|
|
|
|
opentelemetry_cowboy:setup()
|
|
|
|
```
|
|
|
|
|
|
|
|
See [cowboy_telemetry](https://github.com/beam-telemetry/cowboy_telemetry) for prerequisite setup.
|
|
|
|
|
|
|
|
There is no additional prerequisite setup for [plug_cowboy](https://hex.pm/packages/plug_cowboy) users.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```erlang
|
|
|
|
{deps, [
|
2024-02-14 01:09:42 +00:00
|
|
|
{opentelemetry_cowboy, "~> 0.3"}
|
2021-10-06 19:36:22 +00:00
|
|
|
]}
|
|
|
|
```
|
|
|
|
```elixir
|
|
|
|
def deps do
|
|
|
|
[
|
2024-02-14 01:09:42 +00:00
|
|
|
{:opentelemetry_cowboy, "~> 0.3"}
|
2021-10-06 19:36:22 +00:00
|
|
|
]
|
|
|
|
end
|
|
|
|
```
|