Skip to content

Commit 5b82523

Browse files
authored
Consistency update for TOCs of manual instrumentation pages (open-telemetry#2925)
1 parent c88aad5 commit 5b82523

File tree

12 files changed

+326
-190
lines changed

12 files changed

+326
-190
lines changed

content/en/docs/instrumentation/cpp/manual.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ description: Manual instrumentation for OpenTelemetry C++
77

88
{{% docs/instrumentation/manual-intro %}}
99

10-
## Tracing
10+
## Setup
11+
12+
Follow the instructions in the
13+
[Getting Started Guide](/docs/instrumentation/cpp/getting-started/) to build
14+
OpenTelemetry C++.
15+
16+
## Traces
1117

1218
### Initializing tracing
1319

@@ -215,3 +221,13 @@ p->AddView(std::move(observable_instrument_selector), std::move(observable_meter
215221
- [Metrics API](https://opentelemetry-cpp.readthedocs.io/en/latest/otel_docs/namespace_opentelemetry__metrics.html#)
216222
- [Metrics SDK](https://opentelemetry-cpp.readthedocs.io/en/latest/otel_docs/namespace_opentelemetry__sdk__metrics.html)
217223
- [Simple Metrics Example](https://github.com/open-telemetry/opentelemetry-cpp/tree/main/examples/metrics_simple)
224+
225+
## Logs
226+
227+
The logs API & SDK are currently under development.
228+
229+
## Next Steps
230+
231+
You’ll also want to configure an appropriate exporter to
232+
[export your telemetry data](/docs/instrumentation/cpp/exporters) to one or more
233+
telemetry backends.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: Exporters
3+
weight: 50
4+
spelling: cSpell:ignore ostream jaegertracing millis chrono
5+
---
6+
7+
In order to visualize and analyze your [traces](/docs/concepts/signals/traces/)
8+
and metrics, you will need to export them to a backend.
9+
10+
## Exporting to the OpenTelemetry Collector
11+
12+
The [Collector](/docs/collector/) provides a vendor agnostic way to receive,
13+
process and export telemetry data. The package
14+
[opentelemetry_exporter](https://hex.pm/packages/opentelemetry_exporter)
15+
provides support for both exporting over both HTTP (the default) and gRPC to the
16+
collector, which can then export Spans to a self-hosted service like Zipkin or
17+
Jaeger, as well as commercial services. For a full list of available exporters,
18+
see the [registry](/ecosystem/registry/?component=exporter).
19+
20+
For testing purposes the `opentelemetry-erlang` repo has a Collector
21+
configuration,
22+
[config/otel-collector-config.yaml](https://github.com/open-telemetry/opentelemetry-erlang/blob/main/config/otel-collector-config.yaml)
23+
that can be used as a starting point. This configuration is used in
24+
[docker-compose.yml](https://github.com/open-telemetry/opentelemetry-erlang/blob/main/docker-compose.yml)
25+
to start the Collector with receivers for both HTTP and gRPC that then export to
26+
Zipkin also run by [docker-compose](https://docs.docker.com/compose/).
27+
28+
To export to the running Collector the `opentelemetry_exporter` package must be
29+
added to the project's dependencies:
30+
31+
<!-- prettier-ignore-start -->
32+
{{< tabpane langEqualsHeader=true >}}
33+
34+
{{< tab Erlang >}}
35+
{deps, [{opentelemetry_api, "~> 1.3"},
36+
{opentelemetry, "~> 1.3"},
37+
{opentelemetry_exporter, "~> 1.4"}]}.
38+
{{< /tab >}}
39+
40+
{{< tab Elixir >}}
41+
def deps do
42+
[
43+
{:opentelemetry_api, "~> 1.3"},
44+
{:opentelemetry, "~> 1.3"},
45+
{:opentelemetry_exporter, "~> 1.4"}
46+
]
47+
end
48+
{{< /tab >}}
49+
50+
{{< /tabpane >}}
51+
<!-- prettier-ignore-end -->
52+
53+
It should then be added to the configuration of the Release before the SDK
54+
Application to ensure the exporter's dependencies are started before the SDK
55+
attempts to initialize and use the exporter.
56+
57+
Example of Release configuration in `rebar.config` and for
58+
[mix's Release task](https://hexdocs.pm/mix/Mix.Tasks.Release.html):
59+
60+
<!-- prettier-ignore-start -->
61+
{{< tabpane langEqualsHeader=true >}}
62+
63+
{{< tab Erlang >}}
64+
%% rebar.config
65+
{relx, [{release, {my_instrumented_release, "0.1.0"},
66+
[opentelemetry_exporter,
67+
{opentelemetry, temporary},
68+
my_instrumented_app]},
69+
70+
...]}.
71+
{{< /tab >}}
72+
73+
{{< tab Elixir >}}
74+
# mix.exs
75+
def project do
76+
[
77+
releases: [
78+
my_instrumented_release: [
79+
applications: [opentelemetry_exporter: :permanent, opentelemetry: :temporary]
80+
],
81+
82+
...
83+
]
84+
]
85+
end
86+
{{< /tab >}}
87+
88+
{{< /tabpane >}}
89+
<!-- prettier-ignore-end -->
90+
91+
Finally, the runtime configuration of the `opentelemetry` and
92+
`opentelemetry_exporter` Applications are set to export to the Collector. The
93+
configurations below show the defaults that are used if none are set, which are
94+
the HTTP protocol with endpoint of `localhost` on port `4318`. If using `grpc`
95+
for the `otlp_protocol` the endpoint should be changed to
96+
`http://localhost:4317`.
97+
98+
<!-- prettier-ignore-start -->
99+
{{< tabpane langEqualsHeader=true >}}
100+
101+
{{< tab Erlang >}}
102+
%% config/sys.config.src
103+
[
104+
{opentelemetry,
105+
[{span_processor, batch},
106+
{traces_exporter, otlp}]},
107+
108+
{opentelemetry_exporter,
109+
[{otlp_protocol, http_protobuf},
110+
{otlp_endpoint, "http://localhost:4318"}]}]}
111+
].
112+
{{< /tab >}}
113+
114+
{{< tab Elixir >}}
115+
# config/runtime.exs
116+
config :opentelemetry,
117+
span_processor: :batch,
118+
traces_exporter: :otlp
119+
120+
config :opentelemetry_exporter,
121+
otlp_protocol: :http_protobuf,
122+
otlp_endpoint: "http://localhost:4318"
123+
{{< /tab >}}
124+
125+
{{< /tabpane >}}
126+
<!-- prettier-ignore-end -->

content/en/docs/instrumentation/erlang/getting-started.md

+8-117
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ codebase. This allows you to customize the observability data your application
292292
emits.
293293
294294
You'll also want to configure an appropriate exporter to
295-
[export your telemetry data](/docs/instrumentation/erlang/getting-started#exporting-to-the-opentelemetry-collector)
296-
to one or more telemetry backends.
295+
[export your telemetry data](/docs/instrumentation/erlang/exporters) to one or
296+
more telemetry backends.
297297
298298
## Creating a New Mix/Rebar Project
299299
@@ -561,120 +561,11 @@ iex(2)>
561561
{{< /tabpane >}}
562562
<!-- prettier-ignore-end -->
563563
564-
## Exporting to the OpenTelemetry Collector
564+
## Next Steps
565565
566-
The [Collector](/docs/collector/) provides a vendor agnostic way to receive,
567-
process and export telemetry data. The package
568-
[opentelemetry_exporter](https://hex.pm/packages/opentelemetry_exporter)
569-
provides support for both exporting over both HTTP (the default) and gRPC to the
570-
collector, which can then export Spans to a self-hosted service like Zipkin or
571-
Jaeger, as well as commercial services. For a full list of available exporters,
572-
see the [registry](/ecosystem/registry/?component=exporter).
566+
Enrich your instrumentation with more
567+
[manual instrumentation](/docs/instrumentation/erlang/manual).
573568
574-
For testing purposes the `opentelemetry-erlang` repo has a Collector
575-
configuration,
576-
[config/otel-collector-config.yaml](https://github.com/open-telemetry/opentelemetry-erlang/blob/main/config/otel-collector-config.yaml)
577-
that can be used as a starting point. This configuration is used in
578-
[docker-compose.yml](https://github.com/open-telemetry/opentelemetry-erlang/blob/main/docker-compose.yml)
579-
to start the Collector with receivers for both HTTP and gRPC that then export to
580-
Zipkin also run by [docker-compose](https://docs.docker.com/compose/).
581-
582-
To export to the running Collector the `opentelemetry_exporter` package must be
583-
added to the project's dependencies:
584-
585-
<!-- prettier-ignore-start -->
586-
{{< tabpane langEqualsHeader=true >}}
587-
588-
{{< tab Erlang >}}
589-
{deps, [{opentelemetry_api, "~> 1.3"},
590-
{opentelemetry, "~> 1.3"},
591-
{opentelemetry_exporter, "~> 1.4"}]}.
592-
{{< /tab >}}
593-
594-
{{< tab Elixir >}}
595-
def deps do
596-
[
597-
{:opentelemetry_api, "~> 1.3"},
598-
{:opentelemetry, "~> 1.3"},
599-
{:opentelemetry_exporter, "~> 1.4"}
600-
]
601-
end
602-
{{< /tab >}}
603-
604-
{{< /tabpane >}}
605-
<!-- prettier-ignore-end -->
606-
607-
It should then be added to the configuration of the Release before the SDK
608-
Application to ensure the exporter's dependencies are started before the SDK
609-
attempts to initialize and use the exporter.
610-
611-
Example of Release configuration in `rebar.config` and for
612-
[mix's Release task](https://hexdocs.pm/mix/Mix.Tasks.Release.html):
613-
614-
<!-- prettier-ignore-start -->
615-
{{< tabpane langEqualsHeader=true >}}
616-
617-
{{< tab Erlang >}}
618-
%% rebar.config
619-
{relx, [{release, {my_instrumented_release, "0.1.0"},
620-
[opentelemetry_exporter,
621-
{opentelemetry, temporary},
622-
my_instrumented_app]},
623-
624-
...]}.
625-
{{< /tab >}}
626-
627-
{{< tab Elixir >}}
628-
# mix.exs
629-
def project do
630-
[
631-
releases: [
632-
my_instrumented_release: [
633-
applications: [opentelemetry_exporter: :permanent, opentelemetry: :temporary]
634-
],
635-
636-
...
637-
]
638-
]
639-
end
640-
{{< /tab >}}
641-
642-
{{< /tabpane >}}
643-
<!-- prettier-ignore-end -->
644-
645-
Finally, the runtime configuration of the `opentelemetry` and
646-
`opentelemetry_exporter` Applications are set to export to the Collector. The
647-
configurations below show the defaults that are used if none are set, which are
648-
the HTTP protocol with endpoint of `localhost` on port `4318`. If using `grpc`
649-
for the `otlp_protocol` the endpoint should be changed to
650-
`http://localhost:4317`.
651-
652-
<!-- prettier-ignore-start -->
653-
{{< tabpane langEqualsHeader=true >}}
654-
655-
{{< tab Erlang >}}
656-
%% config/sys.config.src
657-
[
658-
{opentelemetry,
659-
[{span_processor, batch},
660-
{traces_exporter, otlp}]},
661-
662-
{opentelemetry_exporter,
663-
[{otlp_protocol, http_protobuf},
664-
{otlp_endpoint, "http://localhost:4318"}]}]}
665-
].
666-
{{< /tab >}}
667-
668-
{{< tab Elixir >}}
669-
# config/runtime.exs
670-
config :opentelemetry,
671-
span_processor: :batch,
672-
traces_exporter: :otlp
673-
674-
config :opentelemetry_exporter,
675-
otlp_protocol: :http_protobuf,
676-
otlp_endpoint: "http://localhost:4318"
677-
{{< /tab >}}
678-
679-
{{< /tabpane >}}
680-
<!-- prettier-ignore-end -->
569+
You'll also want to configure an appropriate exporter to
570+
[export your telemetry data](/docs/instrumentation/erlang/exporters) to one or
571+
more telemetry backends.

content/en/docs/instrumentation/erlang/manual.md

+34-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,27 @@ description: Manual instrumentation for OpenTelemetry Erlang/Elixir
77

88
{{% docs/instrumentation/manual-intro %}}
99

10-
## Tracing
10+
## Setup
11+
12+
Add the following dependencies to your project:
13+
14+
- `opentelemetry_api`: contains the interfaces you'll use to instrument your
15+
code. Things like `Tracer.with_span` and `Tracer.set_attribute` are defined
16+
here.
17+
- `opentelemetry`: contains the SDK that implements the interfaces defined in
18+
the API. Without it, all the functions in the API are no-ops.
19+
20+
```elixir
21+
# mix.exs
22+
def deps do
23+
[
24+
{:opentelemetry, "~> 1.3"},
25+
{:opentelemetry_api, "~> 1.2"},
26+
]
27+
end
28+
```
29+
30+
## Traces
1131

1232
### Initialize Tracing
1333

@@ -353,11 +373,23 @@ Tracer.set_status(:error, "this is not ok")
353373
{{< /tabpane >}}
354374
<!-- prettier-ignore-end -->
355375

356-
## Creating Metrics
376+
## Metrics
357377

358378
The metrics API, found in `apps/opentelemetry_experimental_api` of the
359379
[opentelemetry-erlang](https://github.com/open-telemetry/opentelemetry-erlang)
360380
repository, is currently unstable, documentation TBA.
361381

382+
## Logs
383+
384+
The logs API, found in `apps/opentelemetry_experimental_api` of the
385+
[opentelemetry-erlang](https://github.com/open-telemetry/opentelemetry-erlang)
386+
repository, is currently unstable, documentation TBA.
387+
388+
## Next Steps
389+
390+
You’ll also want to configure an appropriate exporter to
391+
[export your telemetry data](/docs/instrumentation/erlang/exporters) to one or
392+
more telemetry backends.
393+
362394
[opentelemetry specification]: /docs/specs/otel/
363395
[trace semantic conventions]: /docs/specs/otel/trace/semantic_conventions/

0 commit comments

Comments
 (0)