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

https://github.com/keyan/request_trace_id

A simple Elixir Plug for generating and updating trace-ids
https://github.com/keyan/request_trace_id

Last synced: 4 months ago
JSON representation

A simple Elixir Plug for generating and updating trace-ids

Awesome Lists containing this project

README

          

# RequestTraceId

A small plug similar to [`Plug.RequestId`](https://hexdocs.pm/plug/Plug.RequestId.html) except that it appends ids allowing for simple request tracing. Because of this distinction the header used is instead `X-Request-Trace-Id` and the following terminology is adopted (adapted from [Zipkin](zipkin.io)):

**span-id**
* A randomized id generated for each client/server request/response.

**request-trace-id**
* A semicolon delimited string of all span-ids generated during the lifecycle of a single upstream request.

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `request_trace_id` to your list of dependencies in `mix.exs`:

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

## Usage

To use it, just plug it into the desired module:

```
plug RequestTraceId
```

## Docs

See: https://hexdocs.pm/request_trace_id/RequestTraceId.html