Skip to content

[manual-container-metrics] Update dependencies, align with OTel/DD be…#175

Draft
dineshg13 wants to merge 1 commit intomainfrom
update/manual-container-metrics
Draft

[manual-container-metrics] Update dependencies, align with OTel/DD be…#175
dineshg13 wants to merge 1 commit intomainfrom
update/manual-container-metrics

Conversation

@dineshg13
Copy link
Member

…st practices

  • Update Go OTel SDK from v1.18.0 to v1.40.0 (latest stable)
  • Update otelhttp from v0.44.0 to v0.65.0
  • Update Go version from 1.20 to 1.24
  • Change metric instruments from UpDownCounter to Gauge (correct OTel instrument for point-in-time container resource measurements)
  • Add metric descriptions and units per OTel semantic conventions
  • Add proper error handling throughout (return errors instead of swallowing them)
  • Add graceful shutdown with signal handling (SIGINT/SIGTERM)
  • Add HTTP server timeouts (read/write/idle)
  • Add /health endpoint for basic health checks
  • Add startup probe in Kubernetes manifest
  • Use multi-stage Docker build with distroless base image
  • Add pod and container security context (non-root, read-only FS, drop all capabilities)
  • Right-size resource requests/limits (100m/128Mi to 500m/256Mi)
  • Add comments documenting Datadog metric name mapping
  • Add OTel resource creation with semconv service.name
  • Remove unused go.uber.org/zap dependency
  • Document environment variables, endpoints, and metrics in README

What does this PR do?

Motivation

…st practices

- Update Go OTel SDK from v1.18.0 to v1.40.0 (latest stable)
- Update otelhttp from v0.44.0 to v0.65.0
- Update Go version from 1.20 to 1.24
- Change metric instruments from UpDownCounter to Gauge (correct OTel
  instrument for point-in-time container resource measurements)
- Add metric descriptions and units per OTel semantic conventions
- Add proper error handling throughout (return errors instead of
  swallowing them)
- Add graceful shutdown with signal handling (SIGINT/SIGTERM)
- Add HTTP server timeouts (read/write/idle)
- Add /health endpoint for basic health checks
- Add startup probe in Kubernetes manifest
- Use multi-stage Docker build with distroless base image
- Add pod and container security context (non-root, read-only FS,
  drop all capabilities)
- Right-size resource requests/limits (100m/128Mi to 500m/256Mi)
- Add comments documenting Datadog metric name mapping
- Add OTel resource creation with semconv service.name
- Remove unused go.uber.org/zap dependency
- Document environment variables, endpoints, and metrics in README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant