1
1
---
2
2
title : Instrumentation
3
3
description : >-
4
- How OpenTelemetry facilitates automatic and manual instrumentation of
5
- applications.
4
+ How OpenTelemetry instrumentations libraries and applications.
6
5
aliases : [instrumenting]
7
6
weight : 15
8
7
---
@@ -12,32 +11,48 @@ from the system's components must emit [traces](/docs/concepts/signals/traces/),
12
11
[ metrics] ( /docs/concepts/signals/metrics/ ) , and
13
12
[ logs] ( /docs/concepts/signals/logs/ ) .
14
13
15
- Without being required to modify the source code you can collect telemetry from
16
- an application using [ automatic instrumentation] ( automatic/ ) . If you previously
17
- used an APM agent to extract telemetry from your application, Automatic
18
- Instrumentation will give you a similar out of the box experience.
19
-
20
- To facilitate the instrumentation of applications even more, you can
21
- [ manually instrument] ( manual/ ) your applications by coding against the
22
- OpenTelemetry APIs.
23
-
24
- For that you don't need to instrument all the dependencies used in your
25
- application:
26
-
27
- - some of your libraries will be observable out of the box by calling the
28
- OpenTelemetry API themselves directly. Those libraries are sometimes called
29
- ** natively instrumented** .
30
- - for libraries without such an integration the OpenTelemetry projects provide
31
- language specific [ Instrumentation Libraries] [ ]
32
-
33
- Note, that for most languages it is possible to use both manual and automatic
34
- instrumentation at the same time: Automatic Instrumentation will allow you to
35
- gain insights into your application quickly and manual instrumentation will
36
- enable you to embed granular observability into your code.
37
-
38
- The exact installation mechanism for [ manual] ( manual/ ) and
39
- [ automatic] ( automatic/ ) instrumentation varies based on the language you’re
40
- developing in, but there are some similarities covered in the sections below.
41
-
42
- [ instrumentation libraries] :
43
- /docs/specs/otel/overview/#instrumentation-libraries
14
+ OpenTelemetry has two primary ways to instrument.
15
+
16
+ 1 . [ Code-based solutions] ( /docs/concepts/instrumentation/code-based ) via
17
+ official APIs and SDKs for eleven languages.
18
+ 2 . [ Zero-code solutions] ( /docs/concepts/instrumentation/zero-code/ ) that, when
19
+ installed, instrument libraries you use.
20
+
21
+ Code-based solutions allow you to get rich telemetry from your application
22
+ itself. They let you use the OpenTelemetry API to generate telemetry from your
23
+ application, which acts as an essential complement to the telemetry generated by
24
+ zero-code solutions.
25
+
26
+ The Zero-code solutions are great for getting started, or when you can't modify
27
+ the application you need to get telemetry out of. They provide rich telemetry
28
+ from libraries you use and/or the environment your application runs in. Another
29
+ way to think of it is that they provide information about what's happening _ at
30
+ the edges_ of your application.
31
+
32
+ It's generally recommended that you use both solutions when you can.
33
+
34
+ ## Additional OpenTelemetry Benefits
35
+
36
+ OpenTelemetry provides more than just zero-code and code-based telemetry
37
+ solutions. The following things are also a part of OpenTelemetry:
38
+
39
+ - Libraries can leverage the OpenTelemetry API as a dependency, which will have
40
+ no impact on applications using that library, unless the OpenTelemetry SDK is
41
+ imported.
42
+ - For each [ signal] ( /docs/concepts/signals ) (traces, metrics, logs) you have
43
+ several methods at your disposals to create, process, and export them.
44
+ - With [ context propagation] ( /docs/concepts/context-propagation ) built into the
45
+ implementations, you can correlate signals regardless of where they are
46
+ generated.
47
+ - [ Resources] ( /docs/concepts/resources ) and
48
+ [ Instrumentation Scopes] ( /docs/concepts/instrumentation-scope ) allow grouping
49
+ of signals, by different entities, like, the
50
+ [ host] ( /docs/specs/semconv/resource/host/ ) ,
51
+ [ operating system] ( /docs/specs/semconv/resource/os/ ) or
52
+ [ K8s cluster] ( /docs/specs/semconv/resource/k8s/#cluster )
53
+ - Each language-specific implementation of the API and SDK follows the
54
+ requirements and expectations of the
55
+ [ OpenTelemetry specification] ( /docs/specs/otel/ ) .
56
+ - [ Semantic Conventions] ( /docs/concepts/semantic-conventions ) provide a common
57
+ naming schema that can be used for standardization across code bases and
58
+ platforms.
0 commit comments