Skip to content
OpenTelemetry Erlang SDK
Erlang
Branch: master
Clone or download
tsloughter rename span fields to events and is_recording (#49)
* rename span fields to events and is_recording

* upgrade opentelemetry_api to latest master

* update testcase to use events instead of timed_events
Latest commit 09359d4 Feb 17, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci use map for options of ot_batch_processor (#48) Feb 17, 2020
config use map for options of ot_batch_processor (#48) Feb 17, 2020
include rename span fields to events and is_recording (#49) Feb 17, 2020
interop implmentation of application tracer registation and new api set_tracer ( Feb 15, 2020
samples add benchmarking example Aug 16, 2019
src rename span fields to events and is_recording (#49) Feb 17, 2020
test rename span fields to events and is_recording (#49) Feb 17, 2020
.gitignore
CODEOWNERS Set CODEOWNERS to erlang-approvers group (#47) Feb 11, 2020
LICENSE added license May 8, 2019
README.md Update README.md (#39) Jan 15, 2020
rebar.config W3C interop tests (#27) Dec 1, 2019
rebar.lock rename span fields to events and is_recording (#49) Feb 17, 2020

README.md

OpenTelemetry

OpenTelemetry stats collection and distributed tracing framework for Erlang.

Requires OTP 21.3 or above.

Design

The OpenTelemetry specification defines a language library as having 2 components, the API and the SDK. The API must not only define the interfaces of any implementation in that language but also be able to function as a noop implementation of the tracer. The SDK is the default implementation of the API that must be optional.

If you are instrumenting a project your application should only depend on the OpenTelemetry API application.

This repository is the Erlang's SDK implementation and should be included in the final release and configured to setup the sampler, span processors and span exporters.

Using

In an Erlang project add opentelemetry as the first element of the release's applications:

{relx, [{release, {<name>, <version>}, 
         [{opentelemetry, temporary},
          <your applications>]},
        ...]}.

In the above example opentelemetry is set to temporary so that if the opentelemetry application crashes, or is shutdown, it does not terminate the other applications in the project. This is optional, the opentelemetry application purposely sticks to permanent for the processes started by the root supervisor to leave it up to the end user whether they want the crash or shutdown or opentelemetry to be ignored or cause the shutdown of the rest of the applications in the release.

Doing the same for an Elixir project would be:

def project do
  [
    ...
    releases: [
      <name>: [
        applications: [opentelemetry: :temporary]
      ],

      ...
    ]
  ]
end

Benchmarks

Running benchmarks is done with benchee. Benchmark functions are in modules under samples/. To run them open a rebar3 shell in the bench profile:

$ rebar3 as bench compile

> ot_benchmarks:run().

If an Elixir script is wanted for the benchmarks they could be run like:

$ ERL_LIBS=_build/bench/lib/ mix run --no-mix-exs samples/run.exs

W3C Trace Context Interop Tests

Start the interop web server in a shell:

$ rebar3 as interop shell

> w3c_trace_context_interop:run().

Then, clone the W3C Trace Context repo and run the tests:

$ cd test
$ python3 test.py http://127.0.0.1:5000/test

Contributing

You can’t perform that action at this time.