Skip to content

Instantly share code, notes, and snippets.

@tsloughter
Created November 13, 2020 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsloughter/7ff0ce8bfb0a884560de82e6b2a331a6 to your computer and use it in GitHub Desktop.
Save tsloughter/7ff0ce8bfb0a884560de82e6b2a331a6 to your computer and use it in GitHub Desktop.
start(_StartType, _StartArgs) ->
application:load(opentelemetry),
application:set_env(opentelemetry, sampler, {always_on, #{}}),
application:set_env(opentelemetry, processors, [{otel_batch_processor, #{exporter => {otel_exporter_stdout, []},
exporting_timeout_ms => 100,
scheduled_delay_ms => timer:seconds(5)}}]),
{ok, _} = application:ensure_all_started(opentelemetry),
{ok, _} = application:ensure_all_started(opentelemetry_api),
otel_batch_processor:set_exporter(otel_exporter_stdout, []),
true = opentelemetry:register_application_tracer(otel_example),
% otel_batch_processor:set_exporter(opentelemetry_exporter, #{protocol => http_protobuf,
% endpoints => [
% {http, "localhost", 9090, []}],
% scheduled_delay_ms => 10000}),
otel_example_sup:start_link().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment