There are various guidelines to keep in mind when working with OpenTelemetry, as with almost any other area of software engineering.
For OpenTelemetry Traces, we recommend following these best practices.
An event is a human-readable message on a span that represents “something happening” during its lifetime. An event is, therefore, better suited to display information about errors.
An attribute you do not use cannot be detected in Dynatrace and cannot give you any further insights into your system.
Context propagation connects the individual traces over all tiers of your application. If you have no context propagation, your spans will be orphaned and create multiple traces instead of all spans created as child spans within one trace.
Simplicity of use has two advantages:
OneAgent brings many benefits, including automatic trace ingestion in some languages. See OpenTelemetry traces with OneAgent.
It will help your observability, especially in case of an error, as the root cause will be easier to track down.
In manual instrumentation, you must set an individual name for each span you create.
Whenever you start a span, you need to end it. Otherwise, no data will be sent.
Initialize OpenTelemetry before using any library that you want to instrument. Otherwise, no spans will be created, and your calls will be missing.
Whether or not you use the Collector, an exporter is required to send your data to the desired backend.
Samplers can only consider information already present during span creation.
Languages with implicit context propagation do not set newly created spans as the active span in the current context by default; this might result in split traces.