• Stars
    star
    310
  • Rank 129,913 (Top 3 %)
  • Language
    Erlang
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 18 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenTelemetry Erlang SDK

OpenTelemetry Erlang/Elixir


Hex.pm Hex.pm Hex.pm EEF Observability WG project

GitHub Workflow Status Codecov


OpenTelemetry distributed tracing framework for Erlang and Elixir.

These applications implement version 1.8.0 of the OpenTelemetry Specification, see the spec compliance matrix for a list of features supported.

Requirements

  • Erlang/OTP 23+ (With best effort for OTP 22 support)

If using the Elixir API:

  • Elixir 1.13+

Contacting Us

We hold weekly meetings. See details at community page.

We use GitHub Discussions for support or general questions. Feel free to drop us a line.

We are also present in the #otel-erlang-elixir channel in the CNCF slack. Please join us for more informal discussions.

You can also find us in the #opentelemetry channel on Elixir Slack.

Getting Started

You can find a getting started guide on opentelemetry.io.

To start capturing distributed traces from your application it first needs to be instrumented. The easiest way to do this is by using an instrumentation library, there are a number of officially supported instrumentation libraries for popular Erlang and Elixir libraries and frameworks.

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.

When instrumenting a project your application should only depend on the OpenTelemetry API application, found in directory apps/opentelemetry_api of this repo which is published as the hex package opentelemetry_api.

The SDK implementation, found under apps/opentelemetry and hex package opentelemetry, should be included in an OTP Release along with an exporter.

Example of Release configuration in rebar.config:

{relx, [{release, {my_instrumented_release, "0.1.0"},
         [opentelemetry_exporter,
	      {opentelemetry, temporary},
          my_instrumented_app]},

       ...]}.

Example configuration for mix's Release task:

def project do
  [
    releases: [
      my_instrumented_release: [
        applications: [opentelemetry_exporter: :permanent, opentelemetry: :temporary]
      ],

      ...
    ]
  ]
end

Note that you also need to add opentelemetry_exporter before your other opentelemetry dependencies in mix.exs so that it starts before opentelemetry does.

In the above example opentelemetry_exporter is first to ensure all of its dependencies are booted before opentelemetry attempts to start the exporter. 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 -- opentelemetry_exporter does not not need to be temporary because it does not have a startup and supervision tree. 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.

Git Dependencies

While it is recommended to use the Hex packages for the API, SDK and OTLP exporter, there are times depending on the git repo is necessary. Because the OpenTelemetry OTP Applications are kept in a single repository, under the directory apps, either rebar3's git_subdir (rebar 3.14 or above is required) or mix's sparse feature must be used when using as Git dependencies in a project. The blocks below shows how in rebar3 and mix the git repo for the API and/or SDK Applications can be used.

{opentelemetry_api, {git_subdir, "http://github.com/open-telemetry/opentelemetry-erlang", {branch, "main"}, "apps/opentelemetry_api"}},
{opentelemetry, {git_subdir, "http://github.com/open-telemetry/opentelemetry-erlang", {branch, "main"},
"apps/opentelemetry"}},
{opentelemetry_exporter, {git_subdir, "http://github.com/open-telemetry/opentelemetry-erlang", {branch, "main"}, "apps/opentelemetry_exporter"}}
{:opentelemetry_api, github: "open-telemetry/opentelemetry-erlang", sparse:
"apps/opentelemetry_api", override: true},
{:opentelemetry, github: "open-telemetry/opentelemetry-erlang", sparse:
"apps/opentelemetry", override: true},
{:opentelemetry_exporter, github: "open-telemetry/opentelemetry-erlang", sparse: "apps/opentelemetry_exporter", override: true}

The override: true is required because the SDK Application, opentelemetry, has the API in its deps list of its rebar.config as a hex dependency and this will clash when mix tries to resolve the dependencies and fail without the override. override: true is also used on the SDK because the opentelemetry_exporter application depends on it and the API as hex deps so if it is included the override is necessary.

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 shell

> otel_benchmarks:run().

If an Elixir script is wanted for the benchmarks they could be run like (after running rebar3 as bench compile):

$ ERL_AFLAGS="-pa ./_build/bench/extras/samples/" 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:start().

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

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

Contributing

Approvers (@open-telemetry/erlang-approvers):

Find more about the approver role in community repository.

Maintainers (@open-telemetry/erlang-maintainers):

Find more about the maintainer role in community repository.

Thanks to all the people who have contributed

contributors

More Repositories

1

opentelemetry-go

OpenTelemetry Go API and SDK
Go
4,753
star
2

opentelemetry-collector

OpenTelemetry Collector
Go
3,851
star
3

opentelemetry-specification

Specifications for OpenTelemetry
Makefile
3,592
star
4

opentelemetry-dotnet

The OpenTelemetry .NET Client
C#
2,947
star
5

opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
Go
2,512
star
6

opentelemetry-js

OpenTelemetry JavaScript Client
TypeScript
2,448
star
7

opentelemetry-java

OpenTelemetry Java SDK
Java
1,832
star
8

opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
Java
1,709
star
9

opentelemetry-python

OpenTelemetry Python API and SDK
Python
1,586
star
10

opentelemetry-rust

The Rust OpenTelemetry implementation
Rust
1,586
star
11

opentelemetry-demo

This repository contains the OpenTelemetry Astronomy Shop, a microservice-based distributed system intended to illustrate the implementation of OpenTelemetry in a near real-world environment.
TypeScript
1,397
star
12

opentelemetry-operator

Kubernetes Operator for OpenTelemetry Collector
Go
1,044
star
13

opentelemetry-go-contrib

Collection of extensions for OpenTelemetry-Go.
Go
988
star
14

opentelemetry-cpp

The OpenTelemetry C++ Client
C++
754
star
15

community

OpenTelemetry community content
690
star
16

opentelemetry-php

The OpenTelemetry PHP Library
PHP
667
star
17

opentelemetry-python-contrib

OpenTelemetry instrumentation for Python modules
Python
606
star
18

opentelemetry-js-contrib

OpenTelemetry instrumentation for JavaScript modules
TypeScript
596
star
19

docs-cn

OpenTelemetry 中文文档: 接入使用、技术标准、RFC、SDK等.
581
star
20

opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
Makefile
519
star
21

opentelemetry.io

The OpenTelemetry website and documentation
JavaScript
462
star
22

opentelemetry-ruby

OpenTelemetry Ruby API & SDK, and related gems
Ruby
447
star
23

opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
C#
375
star
24

opentelemetry-go-instrumentation

OpenTelemetry Auto Instrumentation using eBPF
C
351
star
25

opentelemetry-helm-charts

OpenTelemetry Helm Charts
Smarty
332
star
26

opentelemetry-dotnet-instrumentation

OpenTelemetry .NET Automatic Instrumentation
C++
329
star
27

oteps

OpenTelemetry Enhancement Proposals
Makefile
315
star
28

opentelemetry-lambda

Create your own Lambda Layer in each OTel language using this starter code. Add the Lambda Layer to your Lamdba Function to get tracing with OpenTelemetry.
Go
242
star
29

opentelemetry-network

eBPF Collector
C++
231
star
30

opentelemetry-collector-releases

OpenTelemetry Collector Official Releases
Go
200
star
31

opentelemetry-swift

OpenTelemetry API for Swift
Swift
181
star
32

semantic-conventions

Defines standards for generating consistent, accessible telemetry across a variety of domains
Roff
175
star
33

opentelemetry-java-examples

Java
152
star
34

opentelemetry-java-contrib

Java
136
star
35

opentelemetry-erlang-contrib

OpenTelemetry instrumentation for Erlang & Elixir
Elixir
129
star
36

opamp-go

OpAMP protocol implementation in Go
Go
116
star
37

opentelemetry-cpp-contrib

Python
115
star
38

opamp-spec

OpAMP Specification
Makefile
92
star
39

opentelemetry-log-collection

OpenTelemetry log collection library
Go
91
star
40

opentelemetry-js-api

OpenTelemetry Javascript API
TypeScript
82
star
41

opentelemetry-android

OpenTelemetry Tooling for Android
Java
82
star
42

opentelemetry-php-instrumentation

OpenTelemetry PHP auto-instrumentation extension
C
76
star
43

opentelemetry-ruby-contrib

Contrib Packages for the OpenTelemetry Ruby API and SDK implementation.
Ruby
68
star
44

opentelemetry-erlang-api

Erlang/Elixir OpenTelemetry API
Erlang
60
star
45

opentelemetry-collector-builder

A CLI tool that generates OpenTelemetry Collector binaries based on a manifest.
Go
56
star
46

otel-arrow

Protocol and libraries for sending and receiving OpenTelemetry data using Apache Arrow
Go
51
star
47

opentelemetry-php-contrib

opentelemetry-php-contrib
PHP
51
star
48

wg-prometheus

Workgroup for building Prometheus-OTLP interoperability for the OTEL Collector and Prometheus related discussions.
40
star
49

otel-arrow-collector

[DoNotUse] OpenTelemetry Collector with Apache Arrow support FORK OF OPENTELEMETRY COLLECTOR
Go
30
star
50

opentelemetry-go-build-tools

Build tools for use by the Go API/SDK, the collector, and their associated contrib repositories
Go
30
star
51

build-tools

Building tools provided by OpenTelemetry
Python
29
star
52

opentelemetry-proto-go

Generated code for OpenTelemetry protobuf data model
Makefile
24
star
53

opentelemetry-profiling

OpenTelemetry Profiling (language independent code, benchmarks, experiments, etc)
22
star
54

opentelemetry-configuration

JSON Schema definitions for OpenTelemetry file configuration
Makefile
22
star
55

opentelemetry-sqlcommenter

SQLCommenter components for various languages
JavaScript
19
star
56

docs-ja

Makefile
16
star
57

opentelemetry-rust-contrib

OpenTelemetry Contrib Packages for Rust
Rust
16
star
58

opentelemetry-proto-java

Java Bindings for the OpenTelemetry Protocol (OTLP)
Java
13
star
59

opentelemetry-sandbox-web-js

non-production level experimental Web JS packages
TypeScript
12
star
60

semantic-conventions-java

Java generated classes for semantic conventions
Java
11
star
61

weaver

A (currently prototype) tool for interacting with Telemetry Schemas / definitions in OpenTelemetry
Rust
9
star
62

assign-reviewers-action

GitHub action to assign reviewers/approvers/etc based on configuration
TypeScript
7
star
63

sig-security

Python
6
star
64

opamp-java

OpAMP protocol implementation in Java
Java
4
star
65

opentelemetry-network-build-tools

eBPF Collector Build Tools
C
4
star
66

opentelemetry-go-vanityurls

Vanityurls config for go.opentelemetry.io subdomain
Shell
2
star
67

.github

1
star
68

experimental-arrow-proto

[Experiment] Protocol definitions for the OpenTelemetry protocol (OTLP) with Apache Arrow support
Makefile
1
star
69

cpp-build-tools

Builds a docker image to make interacting with C++ projects easier.
Shell
1
star