Conversation
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds Datadog OpenTelemetry integration and feature flags for API logging; introduces idempotent Datadog OTLP/HTTP exporter and tracer initialization, conditional HTTP handler wrapping for OTEL, environment-driven flag evaluation, and serverless/IAM updates to provide Datadog secrets and extension layer support. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Handler as HTTP Handler
participant Tracer as OTEL Tracer
participant Exporter as OTLP/HTTP Exporter
participant Datadog
Client->>Handler: HTTP Request
Handler->>Tracer: instrument via WrapHTTPHandler
Tracer->>Tracer: start span "<METHOD> <PATH>"
Handler->>Handler: process request (business logic, optional DDB logging)
Handler-->>Client: HTTP Response
Tracer->>Tracer: end span
Tracer->>Exporter: batch/export spans (OTLP/HTTP)
Exporter->>Datadog: send traces
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
Pull request overview
Adds Datadog/OTel-related configuration and instrumentation to the EasyCLA Python + Go backends, primarily by wiring in the Datadog Lambda Extension layer, introducing env-driven feature flags for API logging, and adding initial OTel trace export plumbing (Go) plus a placeholder stub (Python).
Changes:
- Add Datadog config + Lambda extension layer to Serverless deployments for both backends, including Secrets Manager access for the Datadog API key secret.
- Make API request logging feature-flagged via environment variables (DynamoDB + OTel/Datadog flags).
- Introduce Go OTel SDK initialization + HTTP handler instrumentation for OTLP/HTTP export to the Datadog Lambda Extension.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| cla-backend/serverless.yml | Adds Datadog config/env vars, Secrets Manager permission, and attaches the Datadog extension layer to multiple Lambdas. |
| cla-backend/cla/routes.py | Adds env/stage-driven feature flags for API logging and an OTel/Datadog logging stub hook. |
| cla-backend-go/telemetry/datadog_otlp.go | New Go telemetry package to init OTel and export traces via OTLP/HTTP to the Datadog Lambda Extension. |
| cla-backend-go/serverless.yml | Adds Datadog config/env vars, Secrets Manager permission, and attaches the Datadog extension layer. |
| cla-backend-go/cmd/server.go | Wires feature flags and telemetry init/wrapping into the Go server startup path. |
| cla-backend-go/go.mod | Updates Go toolchain/dependencies and adds OTel modules needed for telemetry. |
| cla-backend-go/go.sum | Corresponding dependency checksum updates for the new/updated Go modules. |
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@cla-backend-go/telemetry/datadog_otlp.go`:
- Around line 116-167: The code in newOTLPHTTPExporter loses which environment
variable was chosen by using firstNonEmpty, causing incorrect path handling per
the OpenTelemetry spec; update the function to read
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_ENDPOINT separately,
determine which one is set (prefer per-signal OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
if non-empty), and then parse and normalize differently: if
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is used, preserve its path verbatim (default
to "/" if no path), and if only OTEL_EXPORTER_OTLP_ENDPOINT (base) is used,
treat it as a base URL and append "/v1/traces" (handling trailing slashes) when
building path/host; keep the existing URL parsing logic and set
otlptracehttp.WithEndpoint(host) and otlptracehttp.WithURLPath(path)
accordingly, retaining insecure detection and the default Datadog fallback
("http://localhost:4318/v1/traces") when neither var is set.
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Currently
WIP.Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io
Assisted by OpenAI
Assisted by GitHub Copilot