Skip to content

Instantly share code, notes, and snippets.

@yatender-oktalk
Created July 13, 2020 05:32
Show Gist options
  • Save yatender-oktalk/ccf75e094026f87c040a7431578f0d29 to your computer and use it in GitHub Desktop.
Save yatender-oktalk/ccf75e094026f87c040a7431578f0d29 to your computer and use it in GitHub Desktop.
open-telemetry-demo---apps---application.ex
defmodule Alpha.Application do
...
def start(_type, _start) do
_ = OpenTelemetry.register_application_tracer(:alpha)
children = [
# Starts a worker by calling: Alpha.Worker.start_link(arg)
# {Alpha.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Alpha.Supervisor]
Supervisor.start_link(children, opts)
end
end
defmodule Beta.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
_ = OpenTelemetry.register_application_tracer(:beta)
children = [
# Starts a worker by calling: Beta.Worker.start_link(arg)
# {Beta.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Beta.Supervisor]
Supervisor.start_link(children, opts)
end
end
defmodule Charlie.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
_ = OpenTelemetry.register_application_tracer(:charlie)
children = [
# Starts a worker by calling: Charlie.Worker.start_link(arg)
# {Charlie.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Charlie.Supervisor]
Supervisor.start_link(children, opts)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment