feat(infra): add Grafana Cloud OTLP env vars to the lambdas - #368
Merged
Merged
Conversation
Adds OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS to the authoritative environment block in `aws/lambda.tf`, so all six functions can ship logs and metrics to Grafana Cloud. The endpoint is not a secret and is inlined. The headers carry the Grafana instance ID and API token, so they follow the SENTRY_DSN precedent and come from Infisical (`/grafana`, `OTEL_EXPORTER_OTLP_HEADERS`) rather than the tree — this repo is public. No change is needed in `preview/`: the preview workflow copies the whole prod env map off branch-auth/branch-reports with a deny-list, so both keys flow into per-PR stacks once this applies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Auto-formatted .tf files with terraform fmt - Updated README.md with terraform-docs Co-authored-by: nourshoreibah <nourshoreibah@users.noreply.github.com>
nourshoreibah
marked this pull request as ready for review
August 23, 2026 17:51
Contributor
Terraform Plan 📖
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
OTEL_EXPORTER_OTLP_ENDPOINTandOTEL_EXPORTER_OTLP_HEADERSto the authoritativeenvironmentblock ininfrastructure/aws/lambda.tf, so all six lambdas can ship logs and metrics to Grafana Cloud.https://otlp-gateway-prod-us-west-0.grafana.net/otlp.SENTRY_DSNprecedent and come from Infisical (/grafana, keyOTEL_EXPORTER_OTLP_HEADERS) via a newinfisical_secretsdata source — this repo is public.preview/change:preview-env.ymlcopies the whole prod env map offbranch-auth/branch-reportswith a deny-list, so both keys reach per-PR stacks once this applies.Verified
terraform fmt -check -recursivecleanterraform validatepasses (Success! The configuration is valid.)Follow-ups (not in this PR)
grafana/opentelemetry-lambda) plusAWS_LAMBDA_EXEC_WRAPPERis needed before anything reaches the OTLP gateway.NODE_OPTIONSis already owned by the Sentry layer, so the OTel side must activate via the exec wrapper, notNODE_OPTIONS.OTEL_SERVICE_NAMEis unset, so all six functions would report asunknown_servicein Grafana. Worth setting per-function.env_slug = "dev", matching every other Infisical source in this module — the secret must exist in that Infisical environment orapplyfails.🤖 Generated with Claude Code