A standard for extracing telemetry data from applications to understand usage, such data include: - Traces - Logs - Metrics - Exceptions This is done using a OTEL exported that batches all data and sends it to a different opentelemetry supporting backend like [[Signoz]]. ## Traces Consists of a trace id, span id and parent span id. This is used to understand how the system interacted with a request. The trace id is the same for the whole requests and represents the whole request as such. A span id is a id for just a piece of work, the developer decides what this mean. Normally in API applications a endpoint call is a span id with attributes such as start/ end time and API request type such as POST/ GET etc. The parent span id is simply the span that sent the request to the current span to later built a map of who called what and make a floatchart on what happened. ## Logs Logs can either be sent via the (not sure here #missing) OTEL collector or using some custom infra integrations. Logs can also contain trace ids meaning they can be linked (and later filtered) to only show a single request. ## Metrics Metrics can also come either from the OTEL collector ( #missing) or using some custom infra integration. As they have a timestamp attached to them, its possible to see the metrics of the system while a request happened to maybe see impact of a request on memory/ cpu/ network etc. ## Exceptions The OTEL collector can also get more information about the current state such as the stacktrace/ exception that happened for a given trace id. ## Sampling Sampling is a technique where not 100% of the data is recorded. This is something the developer has to decide if he it or not. A common approach is to record 100% of failed request but only a certain amount of successful requests, as normally these dont needs to be debugged. Sampling can happen on multiple places: 1. On creation (Head based sampling), this will drop unneeded traces early to save on performance 2. During ingestion (Rate-limit/ probabilistic sampling), this is used to keep requests within quotas dropping what is too much 3. After finish (Tail based sampling), after the complete trace has finished decide on if keep it or not