Skip to content

Commit

Permalink
Improve erlang/elixir config examples (#3168)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillippOhlandt committed Aug 14, 2023
1 parent 218602f commit f5b7c14
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions content/en/docs/instrumentation/erlang/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ Application configuration:

```erlang
%% sys.config
{resource_detectors, [otel_resource_env_var, otel_resource_app_env]}
{opentelemetry, {resource_detectors, [otel_resource_env_var, otel_resource_app_env]}}
```

{{% /tab %}} {{% tab Elixir %}}

```elixir
## runtime.exs
resource_detectors: [:otel_resource_env_var, :otel_resource_app_env]
config :opentelemetry, resource_detectors: [:otel_resource_env_var, :otel_resource_app_env]
```

{{% /tab %}} {{< /tabpane >}}
Expand Down Expand Up @@ -74,14 +74,14 @@ Alternatively, use the `resource` Application environment under the

```erlang
%% sys.config
{resource, #{deployment => #{environment => <<"development">>}}
{opentelemetry, {resource, #{deployment => #{environment => <<"development">>}}}}
```

{{% /tab %}} {{% tab Elixir %}}

```elixir
## runtime.exs
resource: %{deployment: %{environment: "development" }}
config :opentelemetry, resource: %{deployment: %{environment: "development" }}
```

{{% /tab %}} {{< /tabpane >}}
Expand Down
44 changes: 22 additions & 22 deletions content/en/docs/instrumentation/erlang/sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ Traces and using the parent decision in the other cases:

```erlang
%% config/sys.config.src
{sampler, {parent_based, #{root => {trace_id_ratio_based, 0.10},
remote_parent_sampled => always_on,
remote_parent_not_sampled => always_off,
local_parent_sampled => always_on,
local_parent_not_sampled => always_off}}}
{opentelemetry, {sampler, {parent_based, #{root => {trace_id_ratio_based, 0.10},
remote_parent_sampled => always_on,
remote_parent_not_sampled => always_off,
local_parent_sampled => always_on,
local_parent_not_sampled => always_off}}}}
```

{{% /tab %}} {{% tab Elixir %}}

```elixir
# config/runtime.exs
sampler: {:parent_based, %{root: {:trace_id_ratio_based, 0.10},
remote_parent_sampled: :always_on,
remote_parent_not_sampled: :always_off,
local_parent_sampled: :always_on,
local_parent_not_sampled: :always_off}}
config :opentelemetry, sampler: {:parent_based, %{root: {:trace_id_ratio_based, 0.10},
remote_parent_sampled: :always_on,
remote_parent_not_sampled: :always_off,
local_parent_sampled: :always_on,
local_parent_not_sampled: :always_off}}

```

Expand Down Expand Up @@ -112,22 +112,22 @@ always samples and using the parent decision in the other cases:

```erlang
%% config/sys.config.src
{sampler, {parent_based, #{root => always_on,
remote_parent_sampled => always_on,
remote_parent_not_sampled => always_off,
local_parent_sampled => always_on,
local_parent_not_sampled => always_off}}}
{opentelemetry, {sampler, {parent_based, #{root => always_on,
remote_parent_sampled => always_on,
remote_parent_not_sampled => always_off,
local_parent_sampled => always_on,
local_parent_not_sampled => always_off}}}}
```

{{% /tab %}} {{% tab Elixir %}}

```elixir
# config/runtime.exs
sampler: {:parent_based, %{root: :always_on,
remote_parent_sampled: :always_on,
remote_parent_not_sampled: :always_off,
local_parent_sampled: :always_on,
local_parent_not_sampled: :always_off}}
config :opentelemetry, sampler: {:parent_based, %{root: :always_on,
remote_parent_sampled: :always_on,
remote_parent_not_sampled: :always_off,
local_parent_sampled: :always_on,
local_parent_not_sampled: :always_off}}

```

Expand Down Expand Up @@ -207,13 +207,13 @@ URL requested is `/healthcheck`:
{{< tabpane text=true langEqualsHeader=true >}} {{% tab Erlang %}}

```erlang
{sampler, {attributes_sampler, #{'http.target' => <<"/healthcheck">>}}}
{opentelemetry, {sampler, {attributes_sampler, #{'http.target' => <<"/healthcheck">>}}}}
```

{{% /tab %}} {{% tab Elixir %}}

```elixir
sampler: {AttributesSampler, %{"http.target": "/healthcheck"}}
config :opentelemetry, sampler: {AttributesSampler, %{"http.target": "/healthcheck"}}
```

{{% /tab %}} {{< /tabpane >}}

0 comments on commit f5b7c14

Please sign in to comment.