Instrumentation

How OpenTelemetry facilitates instrumentation

In order to make a system observable, it must be instrumented: That is, code from the system’s components must emit traces, metrics, and logs.

Using OpenTelemetry, you can instrument your code in two primary ways:

  1. Code-based solutions via official APIs and SDKs for most languages
  2. Zero-code solutions

Code-based solutions allow you to get deeper insight and rich telemetry from your application itself. They let you use the OpenTelemetry API to generate telemetry from your application, which acts as an essential complement to the telemetry generated by zero-code solutions.

Zero-code solutions are great for getting started, or when you can’t modify the application you need to get telemetry out of. They provide rich telemetry from libraries you use and/or the environment your application runs in. Another way to think of it is that they provide information about what’s happening at the edges of your application.

You can use both solutions simultaneously.

Additional OpenTelemetry Benefits

OpenTelemetry provides more than just zero-code and code-based telemetry solutions. The following things are also a part of OpenTelemetry:

  • Libraries can leverage the OpenTelemetry API as a dependency, which will have no impact on applications using that library, unless the OpenTelemetry SDK is imported.
  • For each signal (traces, metrics, logs) you have several methods at your disposals to create, process, and export them.
  • With context propagation built into the implementations, you can correlate signals regardless of where they are generated.
  • Resources and Instrumentation Scopes allow grouping of signals, by different entities, like, the host, operating system or K8s cluster
  • Each language-specific implementation of the API and SDK follows the requirements and expectations of the OpenTelemetry specification.
  • Semantic Conventions provide a common naming schema that can be used for standardization across code bases and platforms.

Zero-code

Learn how to add observability to an application without the need to write code

Code-based

Learn the essential steps in setting up code-based instrumentation

Libraries

Learn how to add native instrumentation to your library.