l8 logs Flashcards
Log Levels
What to log, what not
Tracing: Opentelemetry
- Per language instrumentation library with
support for - Automatic instrumentation
- Manual instrumentation
- Collector for metrics
- Focus on Export of Data instead of
Storing/Querying - Defining own protocoll for exchaning traces:
Opentelemetry Protocol: OTLP
=> backend Jäger
Tracing Pros
Tracing is important for drilling down production issues
* Helps to understand how distributed systems work in detail
* Is agnostic to programming languange
* Helps to see impact of changes immediately
* Breaks silos due to its transparency (remember Conways Law)
However, at the moment, it is a moving target (many PRs open, Opentelemetry still partially alpha, etc.)
Tracing vs Monitoring
Monitoring: Typically focuses on metrics and logs, providing a high-level overview of system health, performance, and resource utilization. It answers questions like “Is the system healthy?” and “What is the current performance?”
Tracing: Focuses on the flow of individual requests through the system, providing detailed insights into the interactions between services. It answers questions like “Where is the request spending most of its time?” and “Which service is causing the delay?
Tracing Concept: Spans, Traces, Span Context
Spans:
Definition: The basic unit of work in a trace. A span represents a single operation within a trace, such as a request to a service or a database query. Attributes: Each span has a unique identifier, a start and end timestamp, and metadata such as operation name, tags (key-value pairs), and logs (events).
Traces:
Definition: A trace is a collection of spans that represent a single end-to-end request or transaction as it flows through a system. Structure: Traces are composed of multiple spans that are linked together to form a directed acyclic graph (DAG), showing the flow and relationships between spans.
Span Context:
Definition: Information that is passed along with each request to link spans together into a single trace. It includes the trace ID, span ID, and sometimes other metadata. Propagation: Span context is propagated through HTTP headers, gRPC metadata, or other inter-service communication mechanisms.
Equipping requests with span-ids