Merge branch 'claude-docs' into 'main'
docs: add CLAUDE.md for Claude Code integration See merge request unboundsoftware/shiny/otelsetup!79
This commit was merged in pull request #80.
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
.idea
|
||||
.claude
|
||||
/release
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# otelsetup
|
||||
|
||||
Shared Go library for OpenTelemetry setup across all microservices.
|
||||
|
||||
## Shared Documentation
|
||||
|
||||
@../docs/claude/architecture.md
|
||||
@../docs/claude/go-services.md
|
||||
@../docs/claude/conventions.md
|
||||
|
||||
## Library Information
|
||||
|
||||
### Purpose
|
||||
|
||||
Provides standardized OpenTelemetry configuration for tracing, metrics, and logging. Used by all Go microservices to enable observability.
|
||||
|
||||
### Usage
|
||||
|
||||
```go
|
||||
import "gitlab.com/unboundsoftware/shiny/otelsetup"
|
||||
|
||||
// Bootstrap OpenTelemetry SDK
|
||||
shutdown, err := otelsetup.SetupOTelSDK(ctx, enabled, serviceName, buildVersion, environment)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer shutdown(ctx)
|
||||
|
||||
// Wrap HTTP handlers with tracing
|
||||
http.Handle("/", otelsetup.Handler(myHandler))
|
||||
```
|
||||
|
||||
### Features
|
||||
|
||||
- **Tracing** - OTLP HTTP exporter with batch processing
|
||||
- **Metrics** - OTLP HTTP exporter with periodic reader
|
||||
- **Logging** - Stdout log exporter
|
||||
- **Propagation** - TraceContext and Baggage propagation
|
||||
- **HTTP Handler** - Middleware for automatic span creation
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `OTEL_RESOURCE_ATTRIBUTES` - Auto-set if not provided (service.name, service.version, service.environment)
|
||||
- Standard OTLP environment variables for endpoint configuration
|
||||
Reference in New Issue
Block a user