Best Practices for Observability with Grafana Cloud using OpenTelemetry
Introduction
This document outlines the best practices for implementing observability in your applications using Grafana Cloud and the OpenTelemetry standard.
Logging Best Practices
Log Level
- Default Log Level: Set the log level for applications to
debugby default. This ensures comprehensive logging, which is crucial for effective monitoring and troubleshooting. - Log Level Filtering: If log level filtering is required for cost considerations, perform this filtering in the Grafana Alloy pipeline rather than at the application level.
Log Labels
- Label Format: Use PascalCase for all log labels. This ensures consistency and readability across your logs.
Metrics Best Practices
- Standard Metrics: Use standard metrics provided by OpenTelemetry to ensure compatibility and ease of integration with Grafana Cloud.
- Custom Metrics: When defining custom metrics, ensure they are well-documented and follow a consistent naming convention.
Tracing Best Practices
- Trace Context Propagation: Ensure trace context is propagated across all services to maintain a complete view of transactions.
- Span Naming: Use descriptive names for spans to make traces easier to understand and analyze.
Conclusion
Following these best practices will help you achieve effective observability with Grafana Cloud and OpenTelemetry, ensuring your applications are well-monitored and issues can be quickly identified and resolved.
Was this page useful?