Skip to content

Commit 625c572

Browse files
AI suggested fixes
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent d319408 commit 625c572

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

cla-backend-go/cmd/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func enabledByEnvOrStage(envVar, stage string, defaultByStage [2]bool) bool {
179179
log.Warnf("LG:api-log-flag-invalid:%s value=%q (falling back to STAGE default)", envVar, raw)
180180
}
181181
st := strings.TrimSpace(strings.ToLower(stage))
182-
if st == "prod" {
182+
if st == "prod" || st == "production" {
183183
return defaultByStage[1]
184184
}
185185
// dev and all non-prod stages default to enabled

cla-backend/cla/routes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def _normalize_git_sha(v: str) -> str:
138138
return s[:9]
139139
return s
140140

141-
def _detect_git_commit() -> str | None:
141+
def _detect_git_commit():
142142
"""
143143
Best-effort commit detection:
144144
1) common CI env vars
@@ -254,7 +254,7 @@ def _init_otel_datadog() -> None:
254254

255255
endpoint = _build_otlp_traces_endpoint()
256256

257-
exporter = OTLPSpanExporter(endpoint=endpoint, timeout=0.5)
257+
exporter = OTLPSpanExporter(endpoint=endpoint, timeout=2)
258258

259259
# Wrap exporter so any export failure disables tracing for this container
260260
from opentelemetry.sdk.trace.export import SpanExportResult
@@ -327,7 +327,7 @@ def _parse_http_status_code(status):
327327
_E2E_RUNID_HEADER = "X-EasyCLA-E2E-RunID"
328328
_E2E_LEGACY_HEADER = "X-E2E-TEST"
329329

330-
def _extract_e2e_marker(headers) -> tuple[bool, str]:
330+
def _extract_e2e_marker(headers):
331331
"""
332332
CI/E2E request marker so we can tag/filter test noise in logs and traces.
333333
Returns (is_e2e, run_id).
@@ -547,15 +547,15 @@ def process_data_api_logs(request, response):
547547
API request metadata is logged to the DynamoDB-backed APILog model
548548
for all requests.
549549
"""
550-
cla.log.info('LG:api-request-path:' + request.path + suffix)
550+
cla.log.info('LG:api-request-path:' + request.path)
551551
# Mark E2E calls in the log line so jq-based rollups can filter them out easily.
552552
e2e, e2e_run_id = _extract_e2e_marker(getattr(request, "headers", None) or {})
553553
suffix = ""
554554
if e2e:
555555
suffix = " e2e=1"
556556
if e2e_run_id:
557557
suffix += f" e2e_run_id={e2e_run_id}"
558-
cla.log.info('LG:e2e-request-path:' + request.path + suffix)
558+
cla.log.info('LG:e2e-request-path:' + request.path + suffix)
559559

560560
# DynamoDB API logging (conditional)
561561
if _enabled_by_env_or_stage("DDB_API_LOGGING", default_by_stage=(True, False)):

utils/otel_dd/validate_dd_keys.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
curl -sS -H "DD-API-KEY: ${DD_API_KEY}" -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" https://api.datadoghq.com/api/v2/validate_keys | jq -r
2+
curl -sS -H "DD-API-KEY: ${DD_API_KEY}" -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" "https://api.${DD_SITE}/api/v2/validate_keys" | jq -r

0 commit comments

Comments
 (0)