opentelemetry_exporter
The OpenTelemetry Protocol exporter for use with the OpenTelemetry Collector.
Currently only supports the Tracer protocol using either GRPC or Protobuffers over HTTP1.1. Metrics are to come soon.
Using
Easiest way to setup is to add configuration for the batch processor in OpenTelemetry application environment.
For an Erlang release in sys.config:
{opentelemetry,
[{processors,
[{otel_batch_processor,
#{exporter => {opentelemetry_exporter, #{endpoints => [{http, "localhost", 9090, []}]}}}}]}]}The default protocol is http_protobuf, to override this and use grpc add protocol to the config map:
{opentelemetry,
[{processors,
[{otel_batch_processor,
#{exporter => {opentelemetry_exporter, #{protocol => grpc,
endpoints => [{http, "localhost", 9090, []}]}}}}]}]}An Elixir release uses releases.exs:
config :opentelemetry, :processors,
otel_batch_processor: %{
exporter: {:opentelemetry_exporter, %{endpoints: [{:http, 'localhost', 9090, []}]}}
}Contributing
This project uses a submodule during developement, it is not needed if the application is being used as a dependency, so be sure to clone with the option recurse-submodules:
$ git clone --recurse-submodules https://github.com/opentelemetry-beam/opentelemetry_exporter
Upgrading OpenTelemetry Protos
The protos are in a separate repository, opentelemetry-proto, and used as a submodule in this repo. To update the Erlang protobuf modules and GRPC client first update the submodule and then use the rebar3 grpcbox plugin to generate the client:
$ git submodule update --remote opentelemetry-proto
$ rebar3 grpc gen -t client
===> Writing src/trace_service_pb.erl
===> Writing src/opentelemetry_proto_collector_trace_v_1_trace_service_client.erl (forcibly overwriting)
$ mv src/opentelemetry_proto_collector_trace_v_1_trace_service_client.erl src/opentelemetry_trace_service.erl
Then open src/opentelemetry_trace_service.erl and fix the module name.