Skip to content

Commit

Permalink
chore(docs): Update getting started to not use Bandit as it is not re… (
Browse files Browse the repository at this point in the history
#5142)

Co-authored-by: Tiffany Hrabusa <[email protected]>
  • Loading branch information
pdgonzalez872 and tiffany76 authored Sep 4, 2024
1 parent 6361e01 commit e36a005
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions content/en/docs/languages/erlang/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,9 @@ We'll need a few other dependencies that Phoenix doesn't come with.
OpenTelemetry Collector and/or to self-hosted or commercial services.
- `opentelemetry_phoenix`: creates OpenTelemetry spans from the Elixir
`:telemetry` events created by Phoenix.
- web server dependencies: There are currently two options for web servers and
each has their telemetry counterpart. Phoenix applications post 1.7.11 default
to Bandit while pre 1.7.11 default to Cowboy. Both choices are valid. Use one
of the below options based on the web server your Phoenix application uses:
- `opentelemetry_cowboy`: creates OpenTelemetry spans from the Elixir
`:telemetry` events created by the Cowboy web server
- `opentelemetry_bandit`: creates OpenTelemetry spans from the Elixir
`:telemetry` events created by the Bandit web server
- `opentelemetry_cowboy`: creates OpenTelemetry spans from the Elixir
`:telemetry` events created by the Cowboy web server, which is used by
Phoenix.

```elixir
# mix.exs
Expand All @@ -69,27 +64,20 @@ def deps do
{:opentelemetry_api, "~> {{% param versions.otelApi %}}"},
{:opentelemetry_exporter, "~> {{% param versions.otelExporter %}}"},
{:opentelemetry_phoenix, "~> {{% param versions.otelPhoenix %}}"},
# for Cowboy
{:opentelemetry_cowboy, "~> {{% param versions.otelCowboy %}}"}
# for Bandit
{:opentelemetry_bandit, "~> {{% version-from-registry instrumentation-erlang-bandit %}}"},
{:opentelemetry_cowboy, "~> {{% param versions.otelCowboy %}}"},
{:opentelemetry_ecto, "~> {{% param versions.otelEcto %}}"} # if using ecto
]
end
```

The last three also need to be setup when your application starts:
The last two also need to be setup when your application starts:

```elixir
# application.ex
@impl true
def start(_type, _args) do
# Depending on what webserver you are using, you will either use:
:opentelemetry_cowboy.setup()
OpentelemetryPhoenix.setup(adapter: :cowboy2)
# or
OpentelemetryBandit.setup()
OpentelemetryPhoenix.setup(adapter: :bandit)
OpentelemetryEcto.setup([:dice_game, :repo]) # if using ecto
end
```
Expand Down

0 comments on commit e36a005

Please sign in to comment.