Repository navigation
Datadog: publish helpline account and Studio flow SIDs to the Reference Tables - #4848
Open
janorivera wants to merge 15 commits into
Open
janorivera wants to merge 15 commits into
janorivera wants to merge 15 commits into
Conversation
…ables New opt-in enable_datadog_tagging (default false, no change for helplines that don't set it). When on, each configure apply writes the helpline's rows to s3://aselo-datadog-reference-tables (us-east-1): - helpline-tags/accounts/<code>_<env>.csv and helpline-tags/studio-flows/<code>_<env>.csv - aselo_twilio_accounts.csv and aselo_twilio_studio_flows.csv, rebuilt from every helpline's files (plus seed files) with this helpline's rows on top The Datadog Reference Tables aselo_twilio_accounts / aselo_twilio_studio_flows sync from those files and a global pipeline tags Event Stream, ALB and Lambda logs with account_short_code, account_env and flow_name. Replaces the hand-maintained lists in the "Adding Account Tags" / "Studio Flows Sids to Labels" pipelines, which miss new accounts and flows. Bucket, tables and pipeline are set up manually for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stent conditional result types') Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ted pending flow changes) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aging test flag - baseline/common.hcl: enable_datadog_tagging = true, so new helplines publish their account and Studio flow SIDs to the Datadog Reference Tables from their first configure apply - as/staging.hcl: remove the enable_datadog_tagging test flag (the module stays off by default, existing helplines are unchanged) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tags) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e) and document the new fallback tags - datadog/v1: rows in the merged and per-helpline CSV files are ordered by env, short code, then flow name (flows only), with the SID last to keep the sort keys unique - datadog-debugger agent: MISSING_ACCOUNT_SHORT_CODE / MISSING_ENV / MISSING_FLOW_NAME are the fallback values of the Reference Table pipeline (old values before 2026-11-10) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the shared Reference Table files - datadog/v1: every configure apply writes the helpline's account and Studio flow rows; there is no flag to turn it off (a flag set back to false would have deleted the shared merged files) - merged files get prevent_destroy: no single helpline may delete them (decommissioning needs a removed block first) - remove enable_datadog_tagging from the configure stage, baseline, USNC staging and SG staging (USNC/SG staging keep their rows: their resources stay in state with the same content) - datadog-debugger agent: unmapped = configure not applied since tagging, or not in twilio-iac Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ging, production) Each configure apply writes its helpline's rows to aselo-datadog-reference-tables-<environment>, so staging applies can no longer change production's files. Each bucket feeds its own two Datadog Reference Tables (<table>_<dev|stg|prod>); one global pipeline looks SIDs up in all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng them USNC and SG staging applied with the single shared bucket; moving to per-environment buckets would replace their merged-file objects, and prevent_destroy fails that plan. Rename the resource and add a removed block (destroy = false) so the old copies leave state untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… delay, seeds) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stephenhand
reviewed
Nov 26, 2026
| # folder / merged file / Reference Table per table: | ||
| # accounts accounts/ aselo_twilio_accounts.csv aselo_twilio_accounts | ||
| # studio_flows studio-flows/ aselo_twilio_studio_flows.csv aselo_twilio_studio_flows | ||
| # accounts accounts/ aselo_twilio_accounts.csv aselo_twilio_accounts_<dev|stg|prod> |
Collaborator
There was a problem hiding this comment.
can we use full environment names rather than abbrecviated ones everywhere? It will save us having to map them in the future. Or is there a limit on the size of table names?
This branch has not been deployed
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.
Each configure apply now writes the helpline's Twilio account SID and Studio flow SIDs to S3 (aselo-datadog-reference-tables). The Datadog Reference Tables read those files, and the "Aselo helpline tags (reference tables)" pipeline uses them to tag Event Stream logs with account_short_code, account_env and flow_name. This replaces the old hand-maintained pipelines, which are now disabled.
Module: the datadog/v1 module writes two kinds of files:
Own files: each helpline environment's own files, at helpline-tags/{accounts,studio-flows}/
_.csv.Merged files: aselo_twilio_accounts.csv and aselo_twilio_studio_flows.csv, rebuilt on each apply from every helpline's files plus the seed.
On for every helpline, no flag: each helpline picks it up on its next configure apply. System-down flows aren't included yet.
Plan noise: a plan shows changes to the merged files when another helpline's rows have changed since this helpline's last apply.
Applies: don't run configure applies for two helplines at the same time.
prevent_destroy: the merged files have it because every helpline's state owns them. To decommission a helpline, delete its own files from S3.
Tested: applied to USNC staging and SG staging, and Datadog tagged their logs correctly. When an account or flow isn't in the tables, the logs get MISSING_ACCOUNT_SHORT_CODE, MISSING_ENV or MISSING_FLOW_NAME, and nothing is left untagged.
Rollout: Asana task 9a lists the helplines still to apply.
🤖 Generated with Claude Code