You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/logger/README.md
+172-4Lines changed: 172 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Logger Package
2
2
3
-
A structured logging package built on top of [uber-go/zap](https://github.com/uber-go/zap), providing both global and context-aware logging capabilities with sensible defaults.
3
+
A structured logging package built on top of [uber-go/zap](https://github.com/uber-go/zap), providing both global and context-aware logging capabilities with sensible defaults and optional OpenTelemetry integration.
4
4
5
5
## Features
6
6
@@ -10,6 +10,7 @@ A structured logging package built on top of [uber-go/zap](https://github.com/ub
10
10
- Global and instance-based logging
11
11
- Configurable log levels and encoding formats
12
12
- Request ID tracking support
13
+
-**OpenTelemetry integration** for distributed tracing and observability
@@ -77,6 +88,112 @@ Available log levels (in order of increasing severity):
77
88
2024-03-20T10:00:00.000Z INFO Server started service=api
78
89
```
79
90
91
+
## OpenTelemetry Integration
92
+
93
+
The logger package provides seamless integration with OpenTelemetry for distributed tracing and observability platforms like SigNoz, Jaeger, and others.
- The logger is designed to be zero-allocation in most cases
156
322
- JSON encoding is more CPU-intensive but provides structured data
157
323
- Log level checks are performed atomically
158
324
- Field allocation is optimized for minimal overhead
325
+
- OpenTelemetry integration adds minimal overhead when properly configured
326
+
- Batch processing is used for OpenTelemetry exports to optimize performance
159
327
160
328
## Thread Safety
161
329
162
-
The logger is completely thread-safe and can be used concurrently from multiple goroutines.
330
+
The logger is completely thread-safe and can be used concurrently from multiple goroutines. The OpenTelemetry integration maintains thread safety through proper synchronization mechanisms.
0 commit comments