There are two deployed instances of CTMS:
- https://ctms.prod.mozilla-ess.mozit.cloud/ - The production instance, deployed on version tags
- https://ctms.stage.mozilla-ess.mozit.cloud/ - The staging instance, deployed on pull-requests merges
The deployment code lives in https://github.com/mozilla-sre-deploy/deploy-ctms (private).
See the SRE mana page for more information and additional technical diagrams for deployment.
In order to delete all information about certain contacts, use the delete_bulk.py script.
Waitlist subscriptions can receive arbitrary fields. By default, only geo and platform are validated (eg. max length).
In order to validate a new waitlist field, the CTMS codebase has to modified.
Set CTMS_USE_MOZLOG to false to disable the MozLog JSON format used for logging.
Prometheus is used for publishing metrics for the API and the backend service. These are exported to InfluxDB for further processing and display on dashboards.
The API metrics are fetched from /metrics, and each API instance publishes
and keeps track of its own metrics. This means the same counter should be "summed"
across instances to get a deployment-wide counter. It also means that counters
reset when instances reset, such as during a deployment.
The API metrics are:
ctms_requests_duration_seconds_*- A histogram of request timings, with the labelsmethod,path_template, andstatus_code_family. The histogram parts are:ctms_requests_duration_seconds_sum- the running total of durations.ctms_requests_duration_seconds_bucket- the histogram buckets, adding the tagle.ctms_requests_duration_seconds_count- the count of requests.
ctms_api_requests_total- A counter of API endpoint requests, with the labelsclient_id,method,path_template, andstatus_code_family.ctms_requests_total- A counter of requests, with the labelsmethod,path_template,status_code, andstatus_code_family.
The API metrics labels are:
client_id: The client_id of the API key used to make the request.le: For histograms, the "less than or equal to" value of the bucket, such as"5.0"for the count of requests less than 5 seconds.method: The HTTP method, uppercase, likeGETandPOST.path_template: The path, such as/__version__or A standardized path, such as/ctms/{email_id}.status_code_family: A string like2xxand4xx, representing the first digit of the HTTP status code.status_code: The HTTP status code.
CTMS metrics are presented on two dashboards:
- CTMS Telemetry: Operational metrics for production and staging.
- CTMS Alerts: Operational metrics with triggers to alert on-call staff.