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
- Host: GitHub
- URL: https://github.com/keyan/request_trace_id
- Owner: keyan
- License: mit
- Created: 2017-11-29T21:41:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T23:07:44.000Z (over 7 years ago)
- Last Synced: 2025-09-27T07:53:54.002Z (9 months ago)
- Language: Elixir
- Size: 5.86 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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