Open shanduur opened 4 months ago
controller-runtime by default uses logr for logging and prometheus-client for metrics. I would prefer to stick to those defaults, with slog handler. Metrics are beneficial for end users as they allow monitoring and alerting, while traces may not be as essential because they primarily focus on debugging and diagnosing specific issues rather than overall system health and efficiency.
Looking at Kubernetes KEPs, I noticed that the whole ecosystem is switching to Contextual logging using k8s.io/klog/v2 (KEP-3077) which design is based on logr's design.
Context and Problem Statement
Any new application should be designed with observability from the start. Observability, encompassing tracing, logs, and metrics, is essential for understanding and managing the behaviour and performance of applications.
By incorporating robust observability practices into app design, developers can ensure better reliability, scalability, and maintainability, ultimately enhancing user experience and operational efficiency.
Considered Options
opentelementry-go (traces/metrics/logs*)
prometheus_client (go) (metrics)
log/slog (logs)
go-logr/logr (logs)
tracing.rs (traces/logs)invalidated by #1Description: A comprehensive tracing library for Rust, part of the Tokio project.Pros: Powerful and efficient tracing capabilities, integrates well with Rust asynchronous ecosystem, strong community support.Cons: Steeper learning curve for beginners, limited in comparison to more mature tracing frameworks like OpenTelemetry.opentelemetry-rust (traces/metrics/logs)invalidated by #1Description: Official OpenTelemetry client implementation for Rust.Pros: Standardized APIs for observability, integration with various tracing and logging systems, actively developed and maintained.Cons: Relatively new and evolving, potential API changes in future versions, may lack some features compared to more established tracing libraries.