:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(signals): add datadog errors, alerts, apm and logs as inbox signal sources (#120323)
Andrew Maguire6e5be9a9a56f
diff --git a/packages/agent/packages/agent-contracts/src/inbox-types.ts b/packages/agent/packages/agent-contracts/src/inbox-types.tsindex e87e9f2ed12a..890f9613aa06 100644--- a/packages/agent/packages/agent-contracts/src/inbox-types.ts+++ b/packages/agent/packages/agent-contracts/src/inbox-types.ts@@ -118,6 +118,16 @@ export const EXTERNAL_INBOX_SOURCES = [recordKind: "issue",setup: "dynamic",},+ {+ product: "datadog",+ label: "Datadog",+ description:+ "Surface monitor alerts and new errors from APM, logs and error tracking",+ dwSourceType: "Datadog",+ requiredTables: ["error_tracking_issues", "monitor_alerts"],+ recordKind: "issue",+ setup: "dynamic",+ },{product: "honeybadger",label: "Honeybadger",diff --git a/products/desktop/packages/core/src/inbox/signalSourceService.ts b/products/desktop/packages/core/src/inbox/signalSourceService.tsindex cfbb02a4a162..ffe764c14e28 100644--- a/products/desktop/packages/core/src/inbox/signalSourceService.ts+++ b/products/desktop/packages/core/src/inbox/signalSourceService.ts@@ -51,13 +51,17 @@ const ERROR_TRACKING_SOURCE_TYPES: SourceType[] = [const DATA_WAREHOUSE_SOURCES: Record<string,- { dwSourceType: string; requiredTable: string; recordKind: SourceType }+ {+ dwSourceType: string;+ requiredTables: readonly string[];+ recordKind: SourceType;+ }> = Object.fromEntries(EXTERNAL_INBOX_SOURCES.map((s) => [s.product,{dwSourceType: s.dwSourceType,- requiredTable: s.requiredTables[0],+ requiredTables: s.requiredTables,recordKind: s.recordKind,},]),@@ -173,32 +177,34 @@ export class SignalSourceService {return;}- const requiredSchema = schemas.find(- (s) => s.name.toLowerCase() === dwConfig.requiredTable,- );- if (!requiredSchema) {- return;- }+ for (const table of dwConfig.requiredTables) {+ const requiredSchema = schemas.find(+ (s) => s.name.toLowerCase() === table,+ );+ if (!requiredSchema) {+ continue;+ }- // Issue-like records (issues, findings, feedback, reviews) mutate after creation, so- // they need full-refresh sync; tickets are append-only.- if (sourceNeedsFullRefresh(dwConfig.recordKind as SignalRecordKind)) {- const needsUpdate =- !requiredSchema.should_sync ||- requiredSchema.sync_type !== "full_refresh";- if (needsUpdate) {+ // Issue-like records (issues, findings, feedback, reviews) mutate after creation, so+ // they need full-refresh sync; tickets are append-only.+ if (sourceNeedsFullRefresh(dwConfig.recordKind as SignalRecordKind)) {+ const needsUpdate =+ !requiredSchema.should_sync ||+ requiredSchema.sync_type !== "full_refresh";+ if (needsUpdate) {+ await client.updateExternalDataSchema(projectId, requiredSchema.id, {+ should_sync: true,+ sync_type: "full_refresh",+ });+ }+ continue;+ }++ if (!requiredSchema.should_sync) {await client.updateExternalDataSchema(projectId, requiredSchema.id, {should_sync: true,- sync_type: "full_refresh",});}- return;- }-- if (!requiredSchema.should_sync) {- await client.updateExternalDataSchema(projectId, requiredSchema.id, {- should_sync: true,- });}}diff --git a/products/desktop/packages/ui/src/features/inbox/components/utils/source-product-icons.tsx b/products/desktop/packages/ui/src/features/inbox/components/utils/source-product-icons.tsxindex 692e154ed83f..2d46b46f8a72 100644--- a/products/desktop/packages/ui/src/features/inbox/components/utils/source-product-icons.tsx+++ b/products/desktop/packages/ui/src/features/inbox/components/utils/source-product-icons.tsx@@ -152,6 +152,7 @@ const SOURCE_PRODUCT_META: Partial<Record<SourceProduct, SourceProductMeta>> = {label: "Honeybadger",},raygun: { Icon: BugIcon, color: "var(--red-9)", label: "Raygun" },+ datadog: { Icon: BugIcon, color: "var(--plum-9)", label: "Datadog" },snyk: { Icon: ShieldIcon, color: "var(--purple-9)", label: "Snyk" },sonarqube: { Icon: ShieldIcon, color: "var(--blue-9)", label: "SonarQube" },semgrep: { Icon: ShieldIcon, color: "var(--green-9)", label: "Semgrep" },diff --git a/products/desktop/packages/ui/src/features/inbox/hooks/useSignalSourceToggles.ts b/products/desktop/packages/ui/src/features/inbox/hooks/useSignalSourceToggles.tsindex 27044307218f..d460a359f306 100644--- a/products/desktop/packages/ui/src/features/inbox/hooks/useSignalSourceToggles.ts+++ b/products/desktop/packages/ui/src/features/inbox/hooks/useSignalSourceToggles.ts@@ -52,13 +52,17 @@ const SOURCE_LABELS: Partial<Record<SourceKey, string>> = {const DATA_WAREHOUSE_SOURCES: Record<string,- { dwSourceType: string; requiredTable: string; recordKind: SourceType }+ {+ dwSourceType: string;+ requiredTables: readonly string[];+ recordKind: SourceType;+ }> = Object.fromEntries(EXTERNAL_INBOX_SOURCES.map((s) => [s.product,{dwSourceType: s.dwSourceType,- requiredTable: s.requiredTables[0],+ requiredTables: s.requiredTables,recordKind: s.recordKind,},]),@@ -208,32 +212,38 @@ export function useSignalSourceToggles() {const source = findExternalSource(product);if (!source?.schemas || !Array.isArray(source.schemas)) return;- const requiredSchema = source.schemas.find(- (s) => s.name.toLowerCase() === dwConfig.requiredTable,- );- if (!requiredSchema) return;-- // Issue-like records (issues, findings, feedback, reviews) get edited/closed after- // creation, so incremental append would miss updates — force a full refresh. Tickets- // are treated as append-only (matches the original Zendesk behavior).- if (sourceNeedsFullRefresh(dwConfig.recordKind as SignalRecordKind)) {- const syncType = requiredSchema.sync_type;- const needsUpdate =- !requiredSchema.should_sync || syncType !== "full_refresh";+ for (const table of dwConfig.requiredTables) {+ const requiredSchema = source.schemas.find(+ (s) => s.name.toLowerCase() === table,+ );+ if (!requiredSchema) continue;++ // Issue-like records (issues, findings, feedback, reviews) get edited/closed after+ // creation, so incremental append would miss updates — force a full refresh. Tickets+ // are treated as append-only (matches the original Zendesk behavior).+ if (sourceNeedsFullRefresh(dwConfig.recordKind as SignalRecordKind)) {+ const syncType = requiredSchema.sync_type;+ const needsUpdate =+ !requiredSchema.should_sync || syncType !== "full_refresh";++ if (needsUpdate) {+ await client.updateExternalDataSchema(+ projectId,+ requiredSchema.id,+ {+ should_sync: true,+ sync_type: "full_refresh",+ },+ );+ }+ continue;+ }- if (needsUpdate) {+ if (!requiredSchema.should_sync) {await client.updateExternalDataSchema(projectId, requiredSchema.id, {should_sync: true,- sync_type: "full_refresh",});}- return;- }-- if (!requiredSchema.should_sync) {- await client.updateExternalDataSchema(projectId, requiredSchema.id, {- should_sync: true,- });}},[projectId, client, findExternalSource],diff --git a/products/signals/backend/contracts.py b/products/signals/backend/contracts.pyindex 4df611278a7f..f68ff88cb09b 100644--- a/products/signals/backend/contracts.py+++ b/products/signals/backend/contracts.py@@ -798,6 +798,38 @@ class RaygunErrorGroupSignalInput(SignalInputBase):extra: RaygunErrorGroupSignalExtra+class DatadogSignalExtra(SignalExtraBase):+ # One schema serves every Datadog table, because a variant is keyed by (source_product, source_type).+ # `kind` says which record kind the signal came from.+ # Each emitter fills only the fields its kind has, so every field except `kind` is optional.+ kind: Literal["incident", "error_tracking_issue", "error_span", "error_log", "monitor_alert"]+ severity: str | None = None+ state: str | None = None+ created: str | None = None+ service: str | None = None+ platform: str | None = None+ file_path: str | None = None+ function_name: str | None = None+ error_type: str | None = None+ resource_name: str | None = None+ first_seen: str | None = None+ last_seen: str | None = None+ is_crash: str | None = None+ window_total_count: str | None = None+ window_impacted_users: str | None = None+ occurrences: str | None = None+ monitor_id: str | None = None+ monitor_type: str | None = None+ priority: str | None = None+ alert_url: str | None = None+++class DatadogSignalInput(SignalInputBase):+ source_type: Literal[SignalSourceType.ISSUE]+ source_product: Literal[SignalSourceProduct.DATADOG]+ extra: DatadogSignalExtra++# ── Tier-2 security scanners + Tier-3 feedback/reviews ────────────────────────────@@ -1091,6 +1123,7 @@ SignalInput = Annotated[| BugsnagErrorSignalInput| HoneybadgerFaultSignalInput| RaygunErrorGroupSignalInput+ | DatadogSignalInput| SnykScannerFindingSignalInput| SonarqubeScannerFindingSignalInput| SemgrepScannerFindingSignalInput@@ -1147,6 +1180,7 @@ SIGNAL_INPUT_VARIANTS: tuple[type[SignalInputBase], ...] = (BugsnagErrorSignalInput,HoneybadgerFaultSignalInput,RaygunErrorGroupSignalInput,+ DatadogSignalInput,SnykScannerFindingSignalInput,SonarqubeScannerFindingSignalInput,SemgrepScannerFindingSignalInput,diff --git a/products/signals/backend/emission/AGENTS.md b/products/signals/backend/emission/AGENTS.mdindex 07ef81125ce6..92ae17befd7b 100644--- a/products/signals/backend/emission/AGENTS.md+++ b/products/signals/backend/emission/AGENTS.md@@ -55,6 +55,18 @@ Each source defines how to fetch records via its `record_fetcher` on the config:A source that declares `scope_field` (a HogQL expression yielding a record's scope id) and `scope_config_key` (a list of allowed ids on `SignalSourceConfig.config`) gets an `IN` clause added to its query, so a team narrows a workspace-wide warehouse sync without changing what the warehouse imports.An absent, empty, or malformed list means no narrowing.Declare the key per source in `contracts.SCOPE_CONFIG_KEYS` and read it from there, as `linear_issues.py` does for Linear team ids: the table stays out of `emission/` so the API serializer validates the same key without importing the emitters.+- **Grouped warehouse fetcher** (`fetchers/grouped_warehouse.py`) — for high-volume tables that store one row per occurrence (Datadog error spans and logs).+ The generic fetcher has no `GROUP BY`, so it would emit one signal per row.+ The grouped fetcher reads a fixed trailing window of event time (`GROUPED_WINDOW_DAYS`) and ignores `last_synced_at`.+ That value is the start time of the previous sync job, so a cursor on it would skip rows that a page-capped sync left for the next sync and rows the source indexed late.+ The window makes re-reading safe because the ledger and the weekly fingerprint deduplicate groups.+ The grouped fetcher does not read `first_sync_lookback_days`, so leave it at the model default of 7.+ It aggregates the window once, reads up to `GROUP_SCAN_LIMIT` groups from the noisiest down, drops the groups already in `SignalEmissionRecord`, and keeps the first `max_records` new groups, so set `record_processed_outputs=True` on the config.+ Its query runs as the signals ClickHouse user on the offline workload, like the generic fetcher.+ Hash the group key into `source_id` and keep the weight below 1.0, so one group cannot open a report on its own.+ Add `week_period(last_seen)` to the hashed key so a group that stays noisy, or returns after a fix, can emit at most once per ISO week, and again across a week boundary.+ The fetcher rejects `scope_field`, because a group has no single scope value.+ The generic fetcher takes an optional `order_by` on the config, so the `max_records` limit keeps the most important records.- **Conversations fetcher** (`fetchers/conversations.py`) — queries Django ORM for Postgres tickets + comments.Records emission in `SignalEmissionRecord` optimistically at fetch time.diff --git a/products/signals/backend/emission/_common.py b/products/signals/backend/emission/_common.pyindex 678b7635f6d3..09c76e44e62e 100644--- a/products/signals/backend/emission/_common.py+++ b/products/signals/backend/emission/_common.py@@ -72,13 +72,13 @@ def make_flat_emitter(source_id=str(record_id),description=description,weight=1.0,- extra=_build_extra(record, extra_fields, json_list_fields),+ extra=build_extra(record, extra_fields, json_list_fields),)return emitter-def _build_extra(+def build_extra(record: dict[str, Any],extra_fields: tuple[str, ...],json_list_fields: tuple[str, ...],diff --git a/products/signals/backend/emission/datadog_common.py b/products/signals/backend/emission/datadog_common.pynew file mode 100644index 000000000000..e44ae6bbb9f8--- /dev/null+++ b/products/signals/backend/emission/datadog_common.py@@ -0,0 +1,6 @@+from typing import Any+++def clean_text(value: Any) -> str:+ """A value as stripped text, with `None` as an empty string."""+ return "" if value is None else str(value).strip()diff --git a/products/signals/backend/emission/datadog_error_issues.py b/products/signals/backend/emission/datadog_error_issues.pynew file mode 100644index 000000000000..d5ac151206b2--- /dev/null+++ b/products/signals/backend/emission/datadog_error_issues.py@@ -0,0 +1,111 @@+"""Signal emitter for datadog `error_tracking_issues` (record kind: issue).++The table has one row per Datadog Error Tracking issue, which already groups errors across APM traces, logs and RUM.+`first_seen` is an ISO string and never changes, so the time cursor emits each issue once, as `sentry_issues.py` does with `firstSeen`.+"""++from typing import Any++from structlog import get_logger++from products.signals.backend.emission._common import build_extra+from products.signals.backend.emission._prompts import ERROR_ACTIONABILITY_PROMPT, ERROR_SUMMARIZATION_PROMPT+from products.signals.backend.emission.datadog_common import clean_text+from products.signals.backend.emission.fetchers.data_warehouse import data_warehouse_record_fetcher+from products.signals.backend.emission.registry import SignalEmitterOutput, SignalSourceTableConfig++DATADOG_ERROR_ISSUE_FIELDS = (+ "id",+ "error_type",+ "error_message",+ "service",+ "state",+ "platform",+ "file_path",+ "function_name",+ "first_seen",+ "last_seen",+ "is_crash",+ "window_total_count",+ "window_impacted_users",+)++logger = get_logger(__name__)++_EXTRA_FIELDS = tuple(f for f in DATADOG_ERROR_ISSUE_FIELDS if f not in ("id", "error_message"))+_TRUE_VALUES = ("true", "1")+_MAX_MESSAGE_CHARS = 200+++def _is_crash(value: Any) -> bool:+ return clean_text(value).lower() in _TRUE_VALUES+++def _details(record: dict[str, Any]) -> str:+ parts: list[str] = []+ if service := clean_text(record.get("service")):+ parts.append(f"Service: {service}")+ file_path = clean_text(record.get("file_path"))+ function_name = clean_text(record.get("function_name"))+ location = ":".join(part for part in (file_path, function_name) if part)+ if location:+ parts.append(f"Location: {location}")+ if events := clean_text(record.get("window_total_count")):+ parts.append(f"Events: {events}")+ if users := clean_text(record.get("window_impacted_users")):+ parts.append(f"Users: {users}")+ if _is_crash(record.get("is_crash")):+ parts.append("Crash")+ return ", ".join(parts)+++def datadog_error_issue_emitter(team_id: int, record: dict[str, Any]) -> SignalEmitterOutput | None:+ try:+ issue_id = clean_text(record["id"])+ except KeyError as e:+ msg = f"datadog error issue record missing required field {e}"+ logger.exception(msg, team_id=team_id, signals_type="data-import-signals")+ raise ValueError(msg) from e+ # An issue can have no error type, so the first message line stands in as its title.+ message_line = (clean_text(record.get("error_message")).splitlines() or [""])[0].strip()[:_MAX_MESSAGE_CHARS]+ title = clean_text(record.get("error_type")) or message_line+ if not issue_id or not title:+ logger.info(+ "Ignoring datadog error issue with empty id or title",+ team_id=team_id,+ signals_type="data-import-signals",+ )+ return None+ lines = [title]+ # Datadog's grouped representative message, like Sentry's title; raw span and log messages are excluded as possible personal data.+ if message_line and message_line != title:+ lines.append(message_line)+ if details := _details(record):+ lines.append(details)+ return SignalEmitterOutput(+ source_product="datadog",+ source_type="issue",+ source_id=f"error_tracking_issue:{issue_id}",+ description="\n".join(lines),+ weight=1.0,+ extra={"kind": "error_tracking_issue", **build_extra(record, _EXTRA_FIELDS, ())},+ )+++DATADOG_ERROR_ISSUES_CONFIG = SignalSourceTableConfig(+ source_product="datadog",+ source_type="issue",+ emitter=datadog_error_issue_emitter,+ record_fetcher=data_warehouse_record_fetcher,+ partition_field="first_seen",+ partition_field_is_datetime_string=True,+ fields=DATADOG_ERROR_ISSUE_FIELDS,+ where_clause="ifNull(state, '') NOT IN ('RESOLVED', 'IGNORED', 'EXCLUDED')",+ # The busiest new issues come first, so a deploy that opens hundreds of issues keeps the ones that matter.+ order_by="window_total_count DESC",+ max_records=200,+ first_sync_lookback_days=1,+ actionability_prompt=ERROR_ACTIONABILITY_PROMPT,+ summarization_prompt=ERROR_SUMMARIZATION_PROMPT,+ description_summarization_threshold_chars=2000,+)diff --git a/products/signals/backend/emission/datadog_error_logs.py b/products/signals/backend/emission/datadog_error_logs.pynew file mode 100644index 000000000000..1bab4df4713d--- /dev/null+++ b/products/signals/backend/emission/datadog_error_logs.py@@ -0,0 +1,112 @@+"""Signal emitter for datadog `error_logs` (record kind: issue).++The table holds one row per error log line.+The fetcher groups the rows of a trailing window by (service, normalized message), and the emitter produces one signal per group, at most once per ISO week.+The fetcher reads a fixed window of event time and ignores `last_synced_at`, because rows that a page-capped sync left behind or that Datadog indexed late would fall before that cursor and never emit.+The emission ledger and the weekly fingerprint keep re-reading the same rows safe.+The sync already filters to `status:error` at the source.+"""++import hashlib+from typing import Any++from structlog import get_logger++from products.signals.backend.emission._common import build_extra+from products.signals.backend.emission._prompts import ERROR_ACTIONABILITY_PROMPT, ERROR_SUMMARIZATION_PROMPT+from products.signals.backend.emission.datadog_common import clean_text+from products.signals.backend.emission.fetchers.grouped_warehouse import grouped_warehouse_record_fetcher, week_period+from products.signals.backend.emission.registry import SignalEmitterOutput, SignalSourceTableConfig++logger = get_logger(__name__)++DATADOG_ERROR_LOG_FIELDS = ("service", "message_pattern", "occurrences", "first_seen", "last_seen")++# Structured logs often leave `message` empty and put the text in Datadog's standard `error.message`+# or `error.kind` attributes. Without this fallback they all fall into one empty group that never emits.+_MESSAGE_TEXT_SQL = (+ "coalesce(nullIf(message, ''), "+ "nullIf(JSONExtractString(toString(attributes), 'error', 'message'), ''), "+ "nullIf(JSONExtractString(toString(attributes), 'error', 'kind'), ''), '')"+)+# Replacing UUIDs, hex strings and digit runs puts lines that differ only by an id into one group.+# The pattern is also the only message text that reaches the signal. Raw messages can hold personal+# data, so the signal never carries a sample line.+_UUID_REGEX = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"+_HEX_OR_NUMBER_REGEX = "[0-9a-fA-F]{8,}|[0-9]+"+MESSAGE_PATTERN_SQL = (+ f"substring(replaceRegexpAll(replaceRegexpAll({_MESSAGE_TEXT_SQL}, '{_UUID_REGEX}', '#'), "+ f"'{_HEX_OR_NUMBER_REGEX}', '#'), 1, 200)"+)+_SELECT_SQL = f"""+ service,+ {MESSAGE_PATTERN_SQL} AS message_pattern,+ count() AS occurrences,+ min(timestamp) AS first_seen,+ max(timestamp) AS last_seen+"""+++def log_source_id(record: dict[str, Any]) -> str:+ # The week lets a fixed error that returns, or one that stays noisy, emit again.+ fingerprint = "|".join(+ (+ clean_text(record.get("service")),+ clean_text(record.get("message_pattern")),+ week_period(record.get("last_seen")),+ )+ )+ return "error_log:" + hashlib.sha256(fingerprint.encode("utf-8")).hexdigest()+++datadog_error_log_record_fetcher = grouped_warehouse_record_fetcher(+ select_sql=_SELECT_SQL,+ group_by_sql="service, message_pattern",+ order_by_sql="occurrences DESC",+ source_id_for=log_source_id,+)+++def datadog_error_log_emitter(team_id: int, record: dict[str, Any]) -> SignalEmitterOutput | None:+ service = clean_text(record.get("service"))+ message_pattern = clean_text(record.get("message_pattern"))+ if not message_pattern:+ logger.info(+ "Ignoring datadog error log group without a message pattern",+ team_id=team_id,+ signals_type="data-import-signals",+ )+ return None+ occurrences = clean_text(record.get("occurrences"))+ first_seen = clean_text(record.get("first_seen"))+ last_seen = clean_text(record.get("last_seen"))+ summary = f"Error logs in {service}" if service else "Error logs"+ if occurrences:+ summary += f": {occurrences} occurrences"+ if first_seen and last_seen:+ summary += f" between {first_seen} and {last_seen}"+ return SignalEmitterOutput(+ source_product="datadog",+ source_type="issue",+ source_id=log_source_id(record),+ description=f"{summary}\n{message_pattern}",+ # A log line is a noisier failure signal than a failed span, so it weighs less.+ weight=0.3,+ extra={"kind": "error_log", **build_extra(record, ("service", "occurrences", "first_seen", "last_seen"), ())},+ )+++DATADOG_ERROR_LOGS_CONFIG = SignalSourceTableConfig(+ source_product="datadog",+ source_type="issue",+ emitter=datadog_error_log_emitter,+ record_fetcher=datadog_error_log_record_fetcher,+ record_processed_outputs=True,+ partition_field="timestamp",+ partition_field_is_datetime_string=True,+ fields=DATADOG_ERROR_LOG_FIELDS,+ max_records=50,+ actionability_prompt=ERROR_ACTIONABILITY_PROMPT,+ summarization_prompt=ERROR_SUMMARIZATION_PROMPT,+ description_summarization_threshold_chars=2000,+)diff --git a/products/signals/backend/emission/datadog_error_spans.py b/products/signals/backend/emission/datadog_error_spans.pynew file mode 100644index 000000000000..4c3d81c26460--- /dev/null+++ b/products/signals/backend/emission/datadog_error_spans.py@@ -0,0 +1,116 @@+"""Signal emitter for datadog `error_spans` (record kind: issue).++The table holds one row per failed span.+The fetcher groups the rows of a trailing window by (service, resource, error type), and the emitter produces one signal per group, at most once per ISO week.+The fetcher reads a fixed window of event time and ignores `last_synced_at`, because rows that a page-capped sync left behind or that Datadog indexed late would fall before that cursor and never emit.+The emission ledger and the weekly fingerprint keep re-reading the same rows safe.+The sync already filters to `status:error` at the source, which keeps the table to errors only.+"""++import hashlib+from typing import Any++from structlog import get_logger++from products.signals.backend.emission._common import build_extra+from products.signals.backend.emission._prompts import ERROR_ACTIONABILITY_PROMPT, ERROR_SUMMARIZATION_PROMPT+from products.signals.backend.emission.datadog_common import clean_text+from products.signals.backend.emission.fetchers.grouped_warehouse import grouped_warehouse_record_fetcher, week_period+from products.signals.backend.emission.registry import SignalEmitterOutput, SignalSourceTableConfig++logger = get_logger(__name__)++DATADOG_ERROR_SPAN_FIELDS = (+ "service",+ "resource_name",+ "occurrences",+ "first_seen",+ "last_seen",+ "error_type",+)++# The Datadog source writes `error_type` on every span row, because the spans API keeps the error+# under `custom`, `attributes` or the top level depending on the span. Reading a raw `error` column+# would fail the whole query on an account whose spans never carry one. Only the error type reaches+# the signal, so the grouping key stays short and stable.+_SELECT_SQL = """+ service,+ resource_name,+ error_type,+ count() AS occurrences,+ min(start_timestamp) AS first_seen,+ max(start_timestamp) AS last_seen+"""+++def span_source_id(record: dict[str, Any]) -> str:+ # The error type separates two different failures of one resource, and the week lets a fixed error+ # that returns, or one that stays noisy, emit again.+ fingerprint = "|".join(+ (+ clean_text(record.get("service")),+ clean_text(record.get("resource_name")),+ clean_text(record.get("error_type")),+ week_period(record.get("last_seen")),+ )+ )+ return "error_span:" + hashlib.sha256(fingerprint.encode("utf-8")).hexdigest()+++datadog_error_span_record_fetcher = grouped_warehouse_record_fetcher(+ select_sql=_SELECT_SQL,+ group_by_sql="service, resource_name, error_type",+ order_by_sql="occurrences DESC",+ source_id_for=span_source_id,+)+++def datadog_error_span_emitter(team_id: int, record: dict[str, Any]) -> SignalEmitterOutput | None:+ service = clean_text(record.get("service"))+ resource_name = clean_text(record.get("resource_name"))+ if not service and not resource_name:+ logger.info(+ "Ignoring datadog error span group without service and resource",+ team_id=team_id,+ signals_type="data-import-signals",+ )+ return None+ occurrences = clean_text(record.get("occurrences"))+ first_seen = clean_text(record.get("first_seen"))+ last_seen = clean_text(record.get("last_seen"))+ error_type = clean_text(record.get("error_type"))+ where = " on ".join(+ part for part in (f"Error spans in {service}" if service else "Error spans", resource_name) if part+ )+ summary = f"{where}: {occurrences} occurrences" if occurrences else where+ if first_seen and last_seen:+ summary += f" between {first_seen} and {last_seen}"+ lines = [summary]+ if error_type:+ lines.append(error_type)+ return SignalEmitterOutput(+ source_product="datadog",+ source_type="issue",+ source_id=span_source_id(record),+ description="\n".join(lines),+ # Below the report threshold of 1.0, so one noisy group alone cannot open a report.+ weight=0.5,+ extra={"kind": "error_span", **build_extra(record, DATADOG_ERROR_SPAN_FIELDS, ())},+ )+++DATADOG_ERROR_SPANS_CONFIG = SignalSourceTableConfig(+ source_product="datadog",+ source_type="issue",+ emitter=datadog_error_span_emitter,+ record_fetcher=datadog_error_span_record_fetcher,+ # Each group is emitted once through the ledger, because every sync window can contain it again.+ record_processed_outputs=True,+ partition_field="start_timestamp",+ partition_field_is_datetime_string=True,+ fields=DATADOG_ERROR_SPAN_FIELDS,+ max_records=50,+ actionability_prompt=ERROR_ACTIONABILITY_PROMPT,+ summarization_prompt=ERROR_SUMMARIZATION_PROMPT,+ description_summarization_threshold_chars=2000,+)diff --git a/products/signals/backend/emission/datadog_incidents.py b/products/signals/backend/emission/datadog_incidents.pynew file mode 100644index 000000000000..0066b9f56c14--- /dev/null+++ b/products/signals/backend/emission/datadog_incidents.py@@ -0,0 +1,74 @@+"""Signal emitter for datadog `incidents` (record kind: issue).++`created` is an ISO string.+The warehouse source flattens JSON:API attributes to the row root.+"""++from typing import Any++from structlog import get_logger++from products.signals.backend.emission._common import build_extra+from products.signals.backend.emission._prompts import ERROR_ACTIONABILITY_PROMPT, ERROR_SUMMARIZATION_PROMPT+from products.signals.backend.emission.datadog_common import clean_text+from products.signals.backend.emission.fetchers.data_warehouse import data_warehouse_record_fetcher+from products.signals.backend.emission.registry import SignalEmitterOutput, SignalSourceTableConfig++logger = get_logger(__name__)++DATADOG_FIELDS = ("id", "title", "severity", "state", "created")++_EXTRA_FIELDS = ("severity", "state", "created")+++def datadog_incident_emitter(team_id: int, record: dict[str, Any]) -> SignalEmitterOutput | None:+ try:+ incident_id = clean_text(record["id"])+ title = clean_text(record["title"])+ except KeyError as e:+ msg = f"datadog incident record missing required field {e}"+ logger.exception(msg, team_id=team_id, signals_type="data-import-signals")+ raise ValueError(msg) from e+ if not incident_id or not title:+ logger.info(+ "Ignoring datadog incident with empty id or title",+ team_id=team_id,+ signals_type="data-import-signals",+ )+ return None+ description = title+ details = [+ f"{label}: {value}"+ for label, value in (+ ("Severity", clean_text(record.get("severity"))),+ ("State", clean_text(record.get("state"))),+ )+ if value+ ]+ if details:+ description = f"{title}\n{', '.join(details)}"+ return SignalEmitterOutput(+ source_product="datadog",+ source_type="issue",+ source_id=f"incident:{incident_id}",+ description=description,+ weight=1.0,+ extra={"kind": "incident", **build_extra(record, _EXTRA_FIELDS, ())},+ )+++DATADOG_CONFIG = SignalSourceTableConfig(+ source_product="datadog",+ source_type="issue",+ emitter=datadog_incident_emitter,+ record_fetcher=data_warehouse_record_fetcher,+ partition_field="created",+ partition_field_is_datetime_string=True,+ fields=DATADOG_FIELDS,+ where_clause="ifNull(state, '') NOT IN ('resolved', 'completed')",+ max_records=500,+ first_sync_lookback_days=1,+ actionability_prompt=ERROR_ACTIONABILITY_PROMPT,+ summarization_prompt=ERROR_SUMMARIZATION_PROMPT,+ description_summarization_threshold_chars=2000,+)diff --git a/products/signals/backend/emission/datadog_monitor_alerts.py b/products/signals/backend/emission/datadog_monitor_alerts.pynew file mode 100644index 000000000000..371984a7bd6c--- /dev/null+++ b/products/signals/backend/emission/datadog_monitor_alerts.py@@ -0,0 +1,158 @@+"""Signal emitter for datadog `monitor_alerts` (record kind: issue).++The table holds one row per firing monitor alert event (`status:error`).+The warehouse source flattens JSON:API attributes to the row root, so the alert details sit in the nested `attributes` column.+The query JSON-extracts only identifiers and short labels.+It never selects `message`, the title, or any monitor message, query or notification text, because that free text can hold personal data.+"""++import hashlib+from typing import Any+from urllib.parse import urlparse++from structlog import get_logger++from products.signals.backend.emission._prompts import ERROR_ACTIONABILITY_PROMPT, ERROR_SUMMARIZATION_PROMPT+from products.signals.backend.emission.datadog_common import clean_text+from products.signals.backend.emission.fetchers.data_warehouse import data_warehouse_record_fetcher+from products.signals.backend.emission.registry import SignalEmitterOutput, SignalSourceTableConfig++logger = get_logger(__name__)++_ATTRS = "toString(attributes)"+++def _raw_id(*path: str) -> str:+ # ClickHouse returns '' from JSONExtractString for a numeric value, and the monitor id is a number,+ # so the id is read raw and stripped of the quotes a string id would carry. A JSON null reads as 'null'.+ path_sql = ", ".join(f"'{part}'" for part in path)+ return f"nullIf(nullIf(replaceAll(JSONExtractRaw({_ATTRS}, {path_sql}), '\"', ''), ''), 'null')"+++DATADOG_MONITOR_ALERT_FIELDS = (+ "id",+ "timestamp",+ f"coalesce({_raw_id('monitor_id')}, {_raw_id('monitor', 'id')}, '') AS monitor_id",+ (+ f"coalesce(nullIf(JSONExtractString({_ATTRS}, 'monitor', 'name'), ''), "+ f"nullIf(JSONExtractString({_ATTRS}, 'monitor', 'templated_name'), ''), '') AS monitor_name"+ ),+ f"JSONExtractString({_ATTRS}, 'monitor', 'transition', 'destination_state') AS destination_state",+ f"JSONExtractString({_ATTRS}, 'priority') AS priority",+ f"JSONExtractString({_ATTRS}, 'service') AS service",+ f"JSONExtractString({_ATTRS}, 'evt', 'type') AS monitor_kind",+ (+ f"coalesce(nullIf(JSONExtractString({_ATTRS}, 'monitor', 'alert_cycle_key_txt'), ''), "+ f"nullIf(JSONExtractString({_ATTRS}, 'monitor-alert-event', 'alert_cycle_key'), ''), '') AS alert_cycle_key"+ ),+ f"JSONExtractString({_ATTRS}, 'monitor', 'result', 'alert_url') AS alert_url",+)++_DATADOG_HOSTS = ("datadoghq.com", "datadoghq.eu", "ddog-gov.com")++# SignalEmissionRecord.source_id is limited to 200 characters.+_SOURCE_ID_MAX_LENGTH = 200+++def datadog_url_or_none(value: Any) -> str | None:+ """The URL when it is an https link on a Datadog host, otherwise `None`."""+ url = clean_text(value)+ # A browser reads a backslash as a slash, but `urlparse` does not, so the two can disagree on the host.+ if not url or any(ch == "\\" or ch.isspace() or not ch.isprintable() for ch in url):+ return None+ try:+ parsed = urlparse(url)+ hostname = parsed.hostname+ port = parsed.port+ except ValueError:+ return None+ if parsed.scheme != "https" or not hostname:+ return None+ # The netloc must be only the host and an optional port, so userinfo cannot hide the real host.+ if parsed.netloc.lower() != (hostname if port is None else f"{hostname}:{port}"):+ return None+ if any(hostname == host or hostname.endswith(f".{host}") for host in _DATADOG_HOSTS):+ return url+ return None+++def monitor_alert_source_id(record: dict[str, Any]) -> str:+ # Re-notifications inside one alert cycle share an id. A recovery followed by a new alert starts a new cycle.+ monitor_id = clean_text(record.get("monitor_id"))+ cycle = clean_text(record.get("alert_cycle_key")) or clean_text(record.get("id"))+ source_id = f"monitor_alert:{monitor_id}:{cycle}"+ if len(source_id) >= _SOURCE_ID_MAX_LENGTH:+ source_id = f"monitor_alert:{monitor_id}:{hashlib.sha256(cycle.encode('utf-8')).hexdigest()}"+ return source_id+++def datadog_monitor_alert_emitter(team_id: int, record: dict[str, Any]) -> SignalEmitterOutput | None:+ try:+ event_id = clean_text(record["id"])+ monitor_id = clean_text(record["monitor_id"])+ monitor_name = clean_text(record["monitor_name"])+ except KeyError as e:+ msg = f"datadog monitor alert record missing required field {e}"+ logger.exception(msg, team_id=team_id, signals_type="data-import-signals")+ raise ValueError(msg) from e+ if not event_id or not monitor_id or not monitor_name:+ logger.info(+ "Ignoring datadog monitor alert with empty id, monitor id or monitor name",+ team_id=team_id,+ signals_type="data-import-signals",+ )+ return None+ monitor_type = clean_text(record.get("monitor_kind"))+ priority = clean_text(record.get("priority"))+ service = clean_text(record.get("service"))+ details = [+ f"{label}: {value}"+ for label, value in (+ ("Monitor type", monitor_type.replace("_", " ")),+ ("Priority", f"P{priority}" if priority else ""),+ ("Service", service),+ )+ if value+ ]+ description = f"{monitor_name}\n{', '.join(details)}" if details else monitor_name+ return SignalEmitterOutput(+ source_product="datadog",+ source_type="issue",+ source_id=monitor_alert_source_id(record),+ description=description,+ weight=1.0,+ extra={+ "kind": "monitor_alert",+ "monitor_id": monitor_id,+ "state": clean_text(record.get("destination_state")) or None,+ "priority": priority or None,+ "service": service or None,+ "monitor_type": monitor_type or None,+ "alert_url": datadog_url_or_none(record.get("alert_url")),+ },+ )+++DATADOG_MONITOR_ALERTS_CONFIG = SignalSourceTableConfig(+ source_product="datadog",+ source_type="issue",+ emitter=datadog_monitor_alert_emitter,+ record_fetcher=data_warehouse_record_fetcher,+ # Re-notifications of one alert cycle are separate rows with a new timestamp and the same source id.+ # This flag makes the emit idempotency key the source id, so Temporal refuses a second signal for it.+ # The fetcher never reads the ledger rows, so a re-notification of a filtered alert is judged again.+ record_processed_outputs=True,+ partition_field="timestamp",+ partition_field_is_datetime_string=True,+ fields=DATADOG_MONITOR_ALERT_FIELDS,+ # The sync already asks Datadog for `status:error`. This guard keeps a recovery event from+ # becoming a signal if Datadog ever ignores that query term.+ where_clause=f"JSONExtractString({_ATTRS}, 'status') = 'error'",+ # Newest first, so the `max_records` limit drops the oldest re-notifications of a storm.+ order_by="timestamp DESC",+ max_records=1000,+ first_sync_lookback_days=1,+ actionability_prompt=ERROR_ACTIONABILITY_PROMPT,+ summarization_prompt=ERROR_SUMMARIZATION_PROMPT,+ description_summarization_threshold_chars=2000,+)diff --git a/products/signals/backend/emission/fetchers/data_warehouse.py b/products/signals/backend/emission/fetchers/data_warehouse.pyindex 46597bcc7f96..c8b598ae1732 100644--- a/products/signals/backend/emission/fetchers/data_warehouse.py+++ b/products/signals/backend/emission/fetchers/data_warehouse.py@@ -86,10 +86,12 @@ def data_warehouse_record_fetcher(where_sql = " AND ".join(where_parts)fields_sql = ", ".join(config.fields)# Limiting can cause a data loss, as the missed records won't be picked in the next sync, but it's acceptable for the current use case+ order_sql = f"ORDER BY {config.order_by}" if config.order_by else ""query = f"""SELECT {fields_sql}FROM {escape_table_name(table_name)}WHERE {where_sql}+ {order_sql}LIMIT {config.max_records}"""logger.info(diff --git a/products/signals/backend/emission/fetchers/grouped_warehouse.py b/products/signals/backend/emission/fetchers/grouped_warehouse.pynew file mode 100644index 000000000000..52f2bb0dd68e--- /dev/null+++ b/products/signals/backend/emission/fetchers/grouped_warehouse.py@@ -0,0 +1,184 @@+from collections.abc import Callable, Sequence+from datetime import datetime+from typing import Any++import structlog++from posthog.hogql.parser import parse_select+from posthog.hogql.query import execute_hogql_query++from posthog.clickhouse.client.connection import ClickHouseUser+from posthog.clickhouse.workload import Workload+from posthog.models import Team++from products.signals.backend.emission.fetchers.data_warehouse import escape_table_name+from products.signals.backend.emission.registry import SignalSourceTableConfig+from products.signals.backend.models import SignalEmissionRecord++logger = structlog.get_logger(__name__)++# The ledger drops groups that already produced a signal. If the query read only `max_records` groups,+# the noisiest recurring groups would fill the result on every sync and starve new groups ranked below+# them. One aggregation reads up to this many groups, and the ledger filter keeps the first new ones.+# A second aggregation per page would scan the same window again for every page of known groups.+GROUP_SCAN_LIMIT = 10_000+# Bounds the `source_id IN (...)` list of each ledger lookup.+LEDGER_LOOKUP_BATCH = 1_000++# The fetcher reads a fixed trailing window of event time and ignores `last_synced_at`.+# That value is the start time of the previous sync job, so a cursor on it would skip rows that a+# page-capped sync left for the next one, and rows that the source indexed late.+# The ledger plus the weekly fingerprint make a second read of the same rows safe.+# The window covers a page-capped sync that resumes on the next run and late-indexed rows.+GROUPED_WINDOW_DAYS = 2+++def week_period(value: Any) -> str:+ """ISO year and week of a timestamp, or an empty string when it cannot be read.++ Fingerprints carry the period so a group that stays noisy, or returns after a fix, can emit once+ per ISO week instead of once ever.+ """+ text = "" if value is None else str(value).strip()+ try:+ parsed = datetime.fromisoformat(text.replace("Z", "+00:00"))+ except ValueError:+ return ""+ iso = parsed.isocalendar()+ return f"{iso.year}-W{iso.week:02d}"+++def already_emitted_source_ids(team: Team, config: SignalSourceTableConfig, source_ids: Sequence[str]) -> set[str]:+ """The `source_ids` that already produced a signal for this team and source.++ The ledger is the idempotence key for a fetcher that reads the same rows on more than one sync.+ """+ return set(+ SignalEmissionRecord.objects.filter(+ team=team,+ source_product=config.source_product,+ source_type=config.source_type,+ source_id__in=source_ids,+ ).values_list("source_id", flat=True)+ )+++def grouped_window_clause(config: SignalSourceTableConfig, window_days: int = GROUPED_WINDOW_DAYS) -> str:+ """The WHERE clause that keeps rows of the trailing `window_days` days of event time."""+ partition_expr = (+ f"parseDateTimeBestEffort({config.partition_field})"+ if config.partition_field_is_datetime_string+ else config.partition_field+ )+ return f"{partition_expr} > now() - interval {window_days} day"+++class GroupedWarehouseRecordFetcher:+ """A record fetcher that collapses a warehouse table into one record per group.++ A group has no single `scope_field` value, so the fetcher rejects a config that sets one.+ """++ def __init__(+ self,+ *,+ select_sql: str,+ group_by_sql: str,+ order_by_sql: str,+ source_id_for: Callable[[dict[str, Any]], str],+ window_days: int,+ ) -> None:+ self._select_sql = select_sql+ self._group_by_sql = group_by_sql+ self._order_by_sql = order_by_sql+ self._source_id_for = source_id_for+ self._window_days = window_days++ def __call__(self, team: Team, config: SignalSourceTableConfig, context: dict[str, Any]) -> list[dict[str, Any]]:+ if config.scope_field is not None:+ raise ValueError("The grouped warehouse fetcher does not support scope_field")+ table_name: str = context["table_name"]+ extra: dict[str, Any] = context.get("extra", {})+ window_sql = grouped_window_clause(config, self._window_days)+ where_sql = f"{window_sql} AND {config.where_clause}" if config.where_clause else window_sql+ # The group columns break ties, so the scan limit cuts the same groups on every sync.+ order_sql = f"{self._order_by_sql}, {self._group_by_sql}"+ logger.info(+ "Querying grouped records for signal emission",+ table_name=table_name,+ where_clause=config.where_clause,+ window_days=self._window_days,+ max_records=config.max_records,+ scan_limit=GROUP_SCAN_LIMIT,+ signals_type="data-import-signals",+ **extra,+ )+ query = f"""+ SELECT {self._select_sql}+ FROM {escape_table_name(table_name)}+ WHERE {where_sql}+ GROUP BY {self._group_by_sql}+ ORDER BY {order_sql}+ LIMIT {GROUP_SCAN_LIMIT}+ """+ try:+ result = execute_hogql_query(+ query=parse_select(query),+ team=team,+ query_type="EmitSignalsNewRecords",+ bypass_warehouse_access_control=True,+ ch_user=ClickHouseUser.SIGNALS,+ workload=Workload.OFFLINE,+ )+ except Exception as e:+ logger.exception(f"Error querying grouped records: {e}", **extra)+ # Raise so the activity retries instead of leaving a permanent gap in emitted signals.+ raise+ if not result.results or not result.columns:+ return []+ records = [dict(zip(result.columns, row)) for row in result.results]+ new_records: list[dict[str, Any]] = []+ for start in range(0, len(records), LEDGER_LOOKUP_BATCH):+ batch = records[start : start + LEDGER_LOOKUP_BATCH]+ source_ids = [self._source_id_for(record) for record in batch]+ already_emitted = already_emitted_source_ids(team, config, source_ids)+ new_records.extend(+ record for record, source_id in zip(batch, source_ids) if source_id not in already_emitted+ )+ if len(new_records) >= config.max_records:+ break+ return new_records[: config.max_records]+++def grouped_warehouse_record_fetcher(+ *,+ select_sql: str,+ group_by_sql: str,+ order_by_sql: str,+ source_id_for: Callable[[dict[str, Any]], str],+ window_days: int = GROUPED_WINDOW_DAYS,+) -> GroupedWarehouseRecordFetcher:+ """Build a fetcher that collapses the recent rows of a warehouse table into one record per group.++ High-volume sources (error spans, error logs) store one row per occurrence, so the generic+ fetcher would emit one signal per occurrence. This fetcher aggregates the rows of the trailing+ `window_days` days of event time once, walks up to `GROUP_SCAN_LIMIT` groups from the noisiest+ down, drops the groups whose `source_id` is already in `SignalEmissionRecord`, and keeps the first+ `max_records` new groups. Pair it with `record_processed_outputs=True` on the config so the pipeline writes that+ ledger.++ The fetcher ignores `last_synced_at`. Re-reading rows is safe because the ledger and the weekly+ fingerprint (see `week_period`) deduplicate groups, so a row that a capped sync skipped or that+ the source indexed late still gets picked up on a later sync.++ `select_sql` aliases must match `config.fields`, because the pipeline builds records from them.+ Ordering comes from `order_by_sql`, not from `config.order_by`.+ The config must not set `scope_field`, because a group has no single scope value.+ """+ return GroupedWarehouseRecordFetcher(+ select_sql=select_sql,+ group_by_sql=group_by_sql,+ order_by_sql=order_by_sql,+ source_id_for=source_id_for,+ window_days=window_days,+ )diff --git a/products/signals/backend/emission/registry.py b/products/signals/backend/emission/registry.pyindex 9cd8a2278b6b..e2dd99ef06a0 100644--- a/products/signals/backend/emission/registry.py+++ b/products/signals/backend/emission/registry.py@@ -61,6 +61,9 @@ class SignalSourceTableConfig(BaseModel):fields: tuple[str, ...]# Optional filter clause (interpreted by the fetcher — HogQL for data warehouse, ORM for Postgres sources)where_clause: str | None = None+ # Optional ORDER BY expression (HogQL) for the fetcher's query, so the `max_records` limit keeps the+ # most important records instead of an arbitrary subset+ order_by: str | None = None# Max records to process per syncmax_records: int = 1000# Set to True when the source stores datetime values as strings (e.g. GitHub JSON fields)@@ -154,6 +157,11 @@ def _register_all_emitters() -> None:from products.signals.backend.emission.bugsnag_errors import BUGSNAG_CONFIGfrom products.signals.backend.emission.canny_posts import CANNY_CONFIGfrom products.signals.backend.emission.conversations_tickets import CONVERSATIONS_TICKETS_CONFIG+ from products.signals.backend.emission.datadog_error_issues import DATADOG_ERROR_ISSUES_CONFIG+ from products.signals.backend.emission.datadog_error_logs import DATADOG_ERROR_LOGS_CONFIG+ from products.signals.backend.emission.datadog_error_spans import DATADOG_ERROR_SPANS_CONFIG+ from products.signals.backend.emission.datadog_incidents import DATADOG_CONFIG+ from products.signals.backend.emission.datadog_monitor_alerts import DATADOG_MONITOR_ALERTS_CONFIGfrom products.signals.backend.emission.dixa_conversations import DIXA_CONFIGfrom products.signals.backend.emission.featurebase_posts import FEATUREBASE_CONFIGfrom products.signals.backend.emission.freshdesk_tickets import FRESHDESK_CONFIG@@ -213,6 +221,11 @@ def _register_all_emitters() -> None:register_signal_source(ExternalDataSourceType.BUGSNAG, "errors", BUGSNAG_CONFIG)register_signal_source(ExternalDataSourceType.HONEYBADGER, "faults", HONEYBADGER_CONFIG)register_signal_source(ExternalDataSourceType.RAYGUN, "error_groups", RAYGUN_CONFIG)+ register_signal_source(ExternalDataSourceType.DATADOG, "error_tracking_issues", DATADOG_ERROR_ISSUES_CONFIG)+ register_signal_source(ExternalDataSourceType.DATADOG, "error_spans", DATADOG_ERROR_SPANS_CONFIG)+ register_signal_source(ExternalDataSourceType.DATADOG, "error_logs", DATADOG_ERROR_LOGS_CONFIG)+ register_signal_source(ExternalDataSourceType.DATADOG, "incidents", DATADOG_CONFIG)+ register_signal_source(ExternalDataSourceType.DATADOG, "monitor_alerts", DATADOG_MONITOR_ALERTS_CONFIG)# Tier-2 security scanners (record kind: scanner_finding)register_signal_source(ExternalDataSourceType.SNYK, "issues", SNYK_CONFIG)register_signal_source(ExternalDataSourceType.SONARQUBE, "issues", SONARQUBE_CONFIG)diff --git a/products/signals/backend/emission/tests/test_datadog_error_signals.py b/products/signals/backend/emission/tests/test_datadog_error_signals.pynew file mode 100644index 000000000000..7d8d23de3675--- /dev/null+++ b/products/signals/backend/emission/tests/test_datadog_error_signals.py@@ -0,0 +1,696 @@+from datetime import timedelta+from typing import Any++import pytest+from posthog.test.base import BaseTest, ClickhouseTestMixin+from unittest.mock import MagicMock, patch++from django.utils import timezone++from parameterized import parameterized++from posthog.hogql import ast+from posthog.hogql.functions.mapping import find_hogql_aggregation, find_hogql_function, find_hogql_posthog_function+from posthog.hogql.query import execute_hogql_query+from posthog.hogql.visitor import TraversingVisitor++from posthog.models import Team++from products.signals.backend.contracts import DatadogSignalExtra+from products.signals.backend.emission.datadog_error_issues import (+ DATADOG_ERROR_ISSUES_CONFIG,+ datadog_error_issue_emitter,+)+from products.signals.backend.emission.datadog_error_logs import (+ DATADOG_ERROR_LOGS_CONFIG,+ MESSAGE_PATTERN_SQL,+ datadog_error_log_emitter,+ log_source_id,+)+from products.signals.backend.emission.datadog_error_spans import (+ DATADOG_ERROR_SPANS_CONFIG,+ datadog_error_span_emitter,+ span_source_id,+)+from products.signals.backend.emission.datadog_incidents import datadog_incident_emitter+from products.signals.backend.emission.datadog_monitor_alerts import (+ datadog_monitor_alert_emitter,+ monitor_alert_source_id,+)+from products.signals.backend.emission.fetchers.grouped_warehouse import GroupedWarehouseRecordFetcher, week_period+from products.signals.backend.emission.registry import _SIGNAL_TABLE_CONFIGS, SignalSourceTableConfig+from products.signals.backend.emission.tests.test_datadog_monitor_alerts import MOCK_DATADOG_MONITOR_ALERT_RECORD+from products.signals.backend.models import SignalEmissionRecord++MOCK_DATADOG_ERROR_ISSUE_RECORD: dict = {+ "id": "issue-1",+ "error_type": "ConnectionRefusedError",+ "error_message": "Connection refused by upstream payments.example.com",+ "service": "checkout-api",+ "state": "OPEN",+ "platform": "BACKEND",+ "file_path": "app/payments/client.py",+ "function_name": "charge",+ "first_seen": "2026-07-15T10:00:00.000Z",+ "last_seen": "2026-07-15T12:30:00.000Z",+ "is_crash": False,+ "window_total_count": 42,+ "window_impacted_users": 7,+}+++def datadog_error_issue_record() -> dict:+ return {**MOCK_DATADOG_ERROR_ISSUE_RECORD}+++MOCK_DATADOG_ERROR_SPAN_RECORD: dict = {+ "service": "checkout-api",+ "resource_name": "POST /orders",+ "occurrences": 120,+ "first_seen": "2026-07-15T10:00:00.000Z",+ "last_seen": "2026-07-15T12:30:00.000Z",+ "error_type": "TimeoutError",+}+++def datadog_error_span_record() -> dict:+ return {**MOCK_DATADOG_ERROR_SPAN_RECORD}+++MOCK_DATADOG_ERROR_LOG_RECORD: dict = {+ "service": "checkout-api",+ "message_pattern": "Payment # failed for order #",+ "occurrences": 87,+ "first_seen": "2026-07-15T10:00:00.000Z",+ "last_seen": "2026-07-15T12:30:00.000Z",+}+++def datadog_error_log_record() -> dict:+ return {**MOCK_DATADOG_ERROR_LOG_RECORD}+++MOCK_DATADOG_INCIDENT_RECORD: dict = {+ "id": "abc",+ "title": "Checkout latency",+ "severity": "SEV-2",+ "state": "active",+ "created": "2026-07-15T10:00:00.000Z",+}+++def datadog_incident_record() -> dict:+ return {**MOCK_DATADOG_INCIDENT_RECORD}+++class TestDatadogErrorIssueEmitter:+ def test_emits_signal_for_valid_issue(self, datadog_error_issue_record):+ result = datadog_error_issue_emitter(team_id=1, record=datadog_error_issue_record)++ assert result is not None+ assert (result.source_product, result.source_type) == ("datadog", "issue")+ assert result.source_id == "error_tracking_issue:issue-1"+ assert result.weight == 1.0+ assert result.description == (+ "ConnectionRefusedError\n"+ "Connection refused by upstream payments.example.com\n"+ "Service: checkout-api, Location: app/payments/client.py:charge, Events: 42, Users: 7"+ )+ assert result.extra["kind"] == "error_tracking_issue"+ assert result.extra["service"] == "checkout-api"+ assert result.extra["window_total_count"] == "42"+ assert result.extra["is_crash"] == "False"++ @parameterized.expand(+ [+ ("empty_id", {"id": ""}, None),+ ("none_id", {"id": None}, None),+ ("no_type_and_no_message", {"error_type": "", "error_message": None}, None),+ (+ "empty_type_falls_back_to_first_message_line",+ {"error_type": "", "error_message": "Disk full\nat writer.py:10"},+ "Disk full\nService: checkout-api",+ ),+ (+ "empty_type_with_long_message_is_truncated",+ {"error_type": "", "error_message": "x" * 300},+ f"{'x' * 200}\nService: checkout-api",+ ),+ (+ "multi_line_message_keeps_only_the_first_line",+ {"error_type": "OSError", "error_message": "Disk full\nat writer.py:10"},+ "OSError\nDisk full\nService: checkout-api",+ ),+ (+ "long_message_is_truncated",+ {"error_type": "OSError", "error_message": "x" * 300},+ f"OSError\n{'x' * 200}\nService: checkout-api",+ ),+ ]+ )+ def test_title_and_required_fields(self, _name, overrides, expected_prefix):+ result = datadog_error_issue_emitter(+ team_id=1, record={**MOCK_DATADOG_ERROR_ISSUE_RECORD, "file_path": None, "function_name": None, **overrides}+ )++ if expected_prefix is None:+ assert result is None+ else:+ assert result is not None+ assert result.description.startswith(expected_prefix)++ @parameterized.expand([("bool", True), ("string", "true")])+ def test_crash_flag_is_named_in_details(self, _name, is_crash):+ result = datadog_error_issue_emitter(+ team_id=1, record={**MOCK_DATADOG_ERROR_ISSUE_RECORD, "is_crash": is_crash}+ )++ assert result is not None+ assert result.description.endswith(", Crash")++ def test_missing_id_column_raises(self, datadog_error_issue_record):+ del datadog_error_issue_record["id"]++ with pytest.raises(ValueError, match="missing required field"):+ datadog_error_issue_emitter(team_id=1, record=datadog_error_issue_record)+++class TestDatadogErrorSpanEmitter:+ def test_emits_signal_for_valid_group(self, datadog_error_span_record):+ result = datadog_error_span_emitter(team_id=1, record=datadog_error_span_record)++ assert result is not None+ assert result.weight == 0.5+ assert result.source_id == span_source_id(datadog_error_span_record)+ assert result.description == (+ "Error spans in checkout-api on POST /orders: 120 occurrences between "+ "2026-07-15T10:00:00.000Z and 2026-07-15T12:30:00.000Z\n"+ "TimeoutError"+ )+ assert result.extra["kind"] == "error_span"+ assert result.extra["occurrences"] == "120"+ # Messages can hold personal data, so only the error type reaches the signal.+ assert "TimeoutError" in result.description+ assert "error_message" not in result.extra++ def test_skips_group_without_service_and_resource(self, datadog_error_span_record):+ record = {**datadog_error_span_record, "service": None, "resource_name": ""}++ assert datadog_error_span_emitter(team_id=1, record=record) is None++ def test_source_id_fits_the_ledger_column(self, datadog_error_span_record):+ record = {**datadog_error_span_record, "resource_name": "x" * 5000}++ assert len(span_source_id(record)) < 200+++class TestDatadogErrorLogEmitter:+ def test_emits_signal_with_pattern_only(self, datadog_error_log_record):+ result = datadog_error_log_emitter(team_id=1, record=datadog_error_log_record)++ assert result is not None+ assert result.weight == 0.3+ assert result.source_id == log_source_id(datadog_error_log_record)+ assert result.description.endswith("\nPayment # failed for order #")+ assert "87 occurrences" in result.description+ assert result.extra["kind"] == "error_log"+ assert "message_pattern" not in result.extra++ def test_skips_group_without_message_pattern(self, datadog_error_log_record):+ assert datadog_error_log_emitter(team_id=1, record={**datadog_error_log_record, "message_pattern": ""}) is None++ def test_span_and_log_ids_never_collide(self, datadog_error_span_record, datadog_error_log_record):+ assert span_source_id(datadog_error_span_record) != log_source_id(datadog_error_log_record)+++class TestDatadogGroupSourceIds:+ @parameterized.expand(+ [+ ("span_same_group_new_counts", span_source_id, MOCK_DATADOG_ERROR_SPAN_RECORD, {"occurrences": 999}, True),+ ("span_other_resource", span_source_id, MOCK_DATADOG_ERROR_SPAN_RECORD, {"resource_name": "GET /o"}, False),+ ("span_other_service", span_source_id, MOCK_DATADOG_ERROR_SPAN_RECORD, {"service": "billing-api"}, False),+ (+ "span_other_error_type",+ span_source_id,+ MOCK_DATADOG_ERROR_SPAN_RECORD,+ {"error_type": "ValueError"},+ False,+ ),+ (+ "span_same_week",+ span_source_id,+ MOCK_DATADOG_ERROR_SPAN_RECORD,+ {"last_seen": "2026-07-17T09:00:00.000Z"},+ True,+ ),+ (+ "span_next_week",+ span_source_id,+ MOCK_DATADOG_ERROR_SPAN_RECORD,+ {"last_seen": "2026-07-22T09:00:00.000Z"},+ False,+ ),+ ("log_same_group_new_counts", log_source_id, MOCK_DATADOG_ERROR_LOG_RECORD, {"occurrences": 1}, True),+ (+ "log_other_pattern",+ log_source_id,+ MOCK_DATADOG_ERROR_LOG_RECORD,+ {"message_pattern": "Refund # failed"},+ False,+ ),+ ("log_other_service", log_source_id, MOCK_DATADOG_ERROR_LOG_RECORD, {"service": "billing-api"}, False),+ (+ "alert_renotification_in_same_cycle",+ monitor_alert_source_id,+ MOCK_DATADOG_MONITOR_ALERT_RECORD,+ {"id": "evt-2", "timestamp": "2026-07-15T10:30:00.000Z"},+ True,+ ),+ (+ "alert_other_cycle",+ monitor_alert_source_id,+ MOCK_DATADOG_MONITOR_ALERT_RECORD,+ {"alert_cycle_key": "cycle-def"},+ False,+ ),+ (+ "alert_other_monitor",+ monitor_alert_source_id,+ MOCK_DATADOG_MONITOR_ALERT_RECORD,+ {"monitor_id": "1002"},+ False,+ ),+ (+ "alert_without_cycle_other_event",+ monitor_alert_source_id,+ {**MOCK_DATADOG_MONITOR_ALERT_RECORD, "alert_cycle_key": ""},+ {"id": "evt-2"},+ False,+ ),+ (+ "alert_without_cycle_same_event",+ monitor_alert_source_id,+ {**MOCK_DATADOG_MONITOR_ALERT_RECORD, "alert_cycle_key": ""},+ {"timestamp": "2026-07-15T10:30:00.000Z"},+ True,+ ),+ (+ "log_next_week",+ log_source_id,+ MOCK_DATADOG_ERROR_LOG_RECORD,+ {"last_seen": "2026-07-22T09:00:00.000Z"},+ False,+ ),+ ]+ )+ def test_source_id_identifies_the_group(self, _name, source_id_fn, base_record, overrides, expect_same):+ changed = {**base_record, **overrides}++ assert (source_id_fn(changed) == source_id_fn(base_record)) is expect_same+++class TestDatadogIncidentEmitter:+ def test_emits_signal_for_valid_incident(self, datadog_incident_record):+ result = datadog_incident_emitter(team_id=1, record=datadog_incident_record)++ assert result is not None+ assert (result.source_product, result.source_type) == ("datadog", "issue")+ assert result.source_id == "incident:abc"+ assert result.weight == 1.0+ assert result.description == "Checkout latency\nSeverity: SEV-2, State: active"+ assert result.extra["kind"] == "incident"++ @parameterized.expand(+ [+ ("severity_only", {"state": None}, "Checkout latency\nSeverity: SEV-2"),+ ("state_only", {"severity": ""}, "Checkout latency\nState: active"),+ ("neither", {"severity": None, "state": None}, "Checkout latency"),+ ]+ )+ def test_description_names_only_the_set_details(self, _name, overrides, expected):+ result = datadog_incident_emitter(team_id=1, record={**MOCK_DATADOG_INCIDENT_RECORD, **overrides})++ assert result is not None+ assert result.description == expected++ @parameterized.expand([("empty_title", {"title": ""}), ("empty_id", {"id": ""}), ("none_id", {"id": None})])+ def test_skips_incident_without_id_or_title(self, _name, overrides):+ assert datadog_incident_emitter(team_id=1, record={**MOCK_DATADOG_INCIDENT_RECORD, **overrides}) is None++ def test_missing_id_column_raises(self, datadog_incident_record):+ del datadog_incident_record["id"]++ with pytest.raises(ValueError, match="missing required field"):+ datadog_incident_emitter(team_id=1, record=datadog_incident_record)+++class TestDatadogExtraContract:+ # DatadogSignalExtra has optional fields only, so the contract round trip cannot notice an emitter+ # that drops or renames a field. Pinning the exact keys per kind does.+ @parameterized.expand(+ [+ (+ "error_tracking_issue",+ lambda: datadog_error_issue_emitter(1, MOCK_DATADOG_ERROR_ISSUE_RECORD),+ {+ "kind",+ "error_type",+ "service",+ "state",+ "platform",+ "file_path",+ "function_name",+ "first_seen",+ "last_seen",+ "is_crash",+ "window_total_count",+ "window_impacted_users",+ },+ ),+ (+ "error_span",+ lambda: datadog_error_span_emitter(1, MOCK_DATADOG_ERROR_SPAN_RECORD),+ {"kind", "service", "resource_name", "occurrences", "first_seen", "last_seen", "error_type"},+ ),+ (+ "error_log",+ lambda: datadog_error_log_emitter(1, MOCK_DATADOG_ERROR_LOG_RECORD),+ {"kind", "service", "occurrences", "first_seen", "last_seen"},+ ),+ (+ "incident",+ lambda: datadog_incident_emitter(1, MOCK_DATADOG_INCIDENT_RECORD),+ {"kind", "severity", "state", "created"},+ ),+ (+ "monitor_alert",+ lambda: datadog_monitor_alert_emitter(1, MOCK_DATADOG_MONITOR_ALERT_RECORD),+ {"kind", "monitor_id", "state", "priority", "service", "monitor_type", "alert_url"},+ ),+ ]+ )+ def test_extra_keys_match_the_kind(self, kind, build_output, expected_keys):+ output = build_output()++ assert output is not None+ assert output.extra["kind"] == kind+ assert set(output.extra) == expected_keys+ DatadogSignalExtra(**output.extra)+++class TestErrorIssueFetcherOrder:+ def test_query_keeps_the_busiest_issues_at_the_limit(self):+ captured: dict[str, Any] = {}++ def fake_execute(query, **kwargs):+ captured["query"] = query+ return MagicMock(results=[], columns=[])++ with patch(+ "products.signals.backend.emission.fetchers.data_warehouse.execute_hogql_query", side_effect=fake_execute+ ):+ DATADOG_ERROR_ISSUES_CONFIG.record_fetcher(+ MagicMock(), DATADOG_ERROR_ISSUES_CONFIG, {"table_name": "datadog.error_tracking_issues", "extra": {}}+ )++ query = captured["query"]+ assert query.order_by is not None and query.order_by[0].order == "DESC"+ assert query.order_by[0].expr.chain == ["window_total_count"]+++class TestWeekPeriod:+ @parameterized.expand(+ [+ ("iso_with_z", "2026-07-15T10:00:00.000Z", "2026-W29"),+ ("datetime_string", "2026-07-15 10:00:00+00:00", "2026-W29"),+ ("year_boundary_uses_iso_year", "2027-01-01T00:00:00Z", "2026-W53"),+ ("unreadable", "yesterday", ""),+ ("none", None, ""),+ ]+ )+ def test_week_period(self, _name, value, expected):+ assert week_period(value) == expected+++class _ConstantCollector(TraversingVisitor):+ def __init__(self) -> None:+ self.constants: list[Any] = []++ def visit_constant(self, node: ast.Constant) -> None:+ self.constants.append(node.value)+++class _CallNameCollector(TraversingVisitor):+ def __init__(self) -> None:+ self.names: list[str] = []++ def visit_call(self, node: ast.Call) -> None:+ self.names.append(node.name)+ super().visit_call(node)+++def _grouped_fetcher_query(config: SignalSourceTableConfig, last_synced_at: str | None) -> ast.SelectQuery:+ """Run the real grouped fetcher against a stubbed executor and return the AST it built."""+ captured: dict[str, ast.SelectQuery] = {}++ def fake_execute(query, **kwargs):+ captured["query"] = query+ result = MagicMock()+ result.results = []+ result.columns = []+ return result++ with patch(+ "products.signals.backend.emission.fetchers.grouped_warehouse.execute_hogql_query", side_effect=fake_execute+ ):+ config.record_fetcher(+ MagicMock(),+ config,+ {"table_name": "source.table", "last_synced_at": last_synced_at, "extra": {}},+ )+ return captured["query"]+++class TestRegisteredGroupedConfigsBuildValidHogQL:+ """A grouped source whose query cannot parse or names an unknown function fails here+ instead of failing silently on every sync in production."""++ @pytest.mark.parametrize("last_synced_at", [None, "2025-01-01T00:00:00Z"])+ def test_every_grouped_source_query_parses_and_uses_known_functions(self, last_synced_at):+ configs = [+ (key, config)+ for key, config in sorted(_SIGNAL_TABLE_CONFIGS.items())+ if isinstance(config.record_fetcher, GroupedWarehouseRecordFetcher)+ ]+ assert len(configs) > 1, "the registry sweep matched no grouped warehouse source"+ unknown: dict[tuple[str, str], list[str]] = {}+ for key, config in configs:+ collector = _CallNameCollector()+ collector.visit(_grouped_fetcher_query(config, last_synced_at))+ unknown[key] = [+ name+ for name in collector.names+ if not (find_hogql_function(name) or find_hogql_aggregation(name) or find_hogql_posthog_function(name))+ ]+ assert {key: names for key, names in unknown.items() if names} == {}+++class TestGroupedWarehouseRecordFetcher(BaseTest):+ context: dict[str, Any] = {"table_name": "datadog.error_spans", "last_synced_at": None, "extra": {}}++ def _fetch(self, config, rows: list[dict[str, Any]], context: dict[str, Any] | None = None):+ self.queries: list[Any] = []++ def fake_execute(query, **kwargs):+ self.queries.append(query)+ offset = query.offset.value if isinstance(query.offset, ast.Constant) else 0+ limit = query.limit.value+ page = rows[offset : offset + limit]+ result = MagicMock()+ result.columns = list(rows[0]) if page else []+ result.results = [list(row.values()) for row in page]+ return result++ with patch(+ "products.signals.backend.emission.fetchers.grouped_warehouse.execute_hogql_query",+ side_effect=fake_execute,+ ):+ records = config.record_fetcher(self.team, config, context or self.context)+ return records, self.queries[0]++ def _span_rows(self, *resources: str) -> list[dict[str, Any]]:+ return [+ {"service": "checkout-api", "resource_name": resource, "occurrences": 10 - i}+ for i, resource in enumerate(resources)+ ]++ def _record_emitted(self, row: dict[str, Any], team: Team) -> None:+ SignalEmissionRecord.objects.create(+ team=team,+ source_product="datadog",+ source_type="issue",+ source_id=span_source_id(row),+ emitted_at=timezone.now(),+ )++ def test_drops_groups_already_in_the_ledger(self):+ rows = self._span_rows("POST /orders", "GET /orders")+ self._record_emitted(rows[0], team=self.team)++ records, _ = self._fetch(DATADOG_ERROR_SPANS_CONFIG, rows)++ assert [r["resource_name"] for r in records] == ["GET /orders"]++ def test_noisiest_emitted_groups_do_not_starve_new_ones(self):+ rows = self._span_rows("POST /orders", "GET /orders", "GET /cart")+ for row in rows[:2]:+ self._record_emitted(row, team=self.team)+ config = DATADOG_ERROR_SPANS_CONFIG.model_copy(update={"max_records": 1})++ records, _ = self._fetch(config, rows)++ assert [r["resource_name"] for r in records] == ["GET /cart"]++ def test_reads_past_known_groups_with_one_aggregation(self):+ resources = [f"GET /r{i}" for i in range(6)]+ rows = self._span_rows(*resources)+ for row in rows[:5]:+ self._record_emitted(row, team=self.team)+ config = DATADOG_ERROR_SPANS_CONFIG.model_copy(update={"max_records": 1})++ records, _ = self._fetch(config, rows)++ assert [r["resource_name"] for r in records] == ["GET /r5"]+ assert len(self.queries) == 1++ def test_considers_only_groups_inside_the_scan_limit(self):+ rows = self._span_rows(*[f"GET /r{i}" for i in range(6)])+ for row in rows[:4]:+ self._record_emitted(row, team=self.team)+ config = DATADOG_ERROR_SPANS_CONFIG.model_copy(update={"max_records": 1})++ with patch("products.signals.backend.emission.fetchers.grouped_warehouse.GROUP_SCAN_LIMIT", 4):+ records, query = self._fetch(config, rows)++ assert records == []+ assert query.limit.value == 4++ def test_keeps_only_max_records_groups_in_query_order(self):+ config = DATADOG_ERROR_SPANS_CONFIG.model_copy(update={"max_records": 2})++ records, _ = self._fetch(config, self._span_rows("a", "b", "c"))++ assert [r["resource_name"] for r in records] == ["a", "b"]++ def test_query_groups_by_noise_and_ignores_the_sync_cursor(self):+ where_by_cursor = {}+ for last_synced_at in (None, "2026-07-15T10:00:00+00:00"):+ _, query = self._fetch(+ DATADOG_ERROR_LOGS_CONFIG,+ [{"service": "checkout-api", "message_pattern": "p", "occurrences": 1}],+ {**self.context, "table_name": "datadog.error_logs", "last_synced_at": last_synced_at},+ )+ assert [g.chain for g in query.group_by or [] if isinstance(g, ast.Field)] == [+ ["service"],+ ["message_pattern"],+ ]+ assert query.order_by is not None and query.order_by[0].order == "DESC"+ assert isinstance(query.limit, ast.Constant) and query.limit.value > DATADOG_ERROR_LOGS_CONFIG.max_records+ collector = _ConstantCollector()+ collector.visit(query)+ assert not any(hasattr(value, "year") for value in collector.constants)+ assert query.where is not None+ where_by_cursor[last_synced_at] = query.where.to_hogql()++ assert len(set(where_by_cursor.values())) == 1++ def test_fetching_with_a_scope_is_rejected(self):+ config = DATADOG_ERROR_SPANS_CONFIG.model_copy(+ update={"scope_field": "service", "scope_config_key": "datadog_services"}+ )++ with pytest.raises(ValueError, match="does not support scope_field"):+ config.record_fetcher(self.team, config, self.context)++ def test_returns_nothing_when_the_window_has_no_rows(self):+ records, _ = self._fetch(DATADOG_ERROR_SPANS_CONFIG, [])++ assert records == []++ def test_ledger_of_another_team_does_not_drop_groups(self):+ other_team = Team.objects.create(organization=self.organization, name="Other team")+ rows = self._span_rows("POST /orders")+ self._record_emitted(rows[0], team=other_team)++ records, _ = self._fetch(DATADOG_ERROR_SPANS_CONFIG, rows)++ assert len(records) == 1+++class TestErrorLogMessagePattern(ClickhouseTestMixin, BaseTest):+ @parameterized.expand(+ [+ ("top_level_message", "'Payment 4021 failed'", "'{}'", "Payment # failed"),+ (+ "structured_log_error_message",+ "''",+ """'{"error": {"kind": "TimeoutError", "message": "Upstream timed out after 30s"}}'""",+ "Upstream timed out after #s",+ ),+ ("structured_log_error_kind_only", "''", """'{"error": {"kind": "AccessDenied"}}'""", "AccessDenied"),+ ("no_text_anywhere", "''", "'{}'", ""),+ ]+ )+ def test_pattern_falls_back_to_standard_error_attributes(self, _name, message, attributes, expected):+ result = execute_hogql_query(+ f"SELECT {MESSAGE_PATTERN_SQL} FROM (SELECT {message} AS message, {attributes} AS attributes)",+ team=self.team,+ )++ assert result.results[0][0] == expected+++def _fetched_where(team: Team, last_synced_at: str | None) -> str:+ """The WHERE clause the grouped span fetcher sends for a sync with this cursor."""+ captured: list[Any] = []++ def fake_execute(query, **kwargs):+ captured.append(query)+ return MagicMock(results=[], columns=[])++ with patch(+ "products.signals.backend.emission.fetchers.grouped_warehouse.execute_hogql_query",+ side_effect=fake_execute,+ ):+ DATADOG_ERROR_SPANS_CONFIG.record_fetcher(+ team,+ DATADOG_ERROR_SPANS_CONFIG,+ {"table_name": "datadog.error_spans", "last_synced_at": last_synced_at, "extra": {}},+ )+ return captured[0].where.to_hogql()+++class TestGroupedWindowClause(ClickhouseTestMixin, BaseTest):+ @parameterized.expand(+ [+ # The sync cursor is 12 hours old, so a row from a day ago sits before it and must still be read.+ ("before_cursor_inside_window", 1, 1),+ ("outside_window", 3, 0),+ ]+ )+ def test_window_keeps_rows_by_event_time_not_by_sync_cursor(self, _name, age_days, expected_count):+ where_sql = _fetched_where(self.team, (timezone.now() - timedelta(hours=12)).isoformat())+ timestamp = (timezone.now() - timedelta(days=age_days)).strftime("%Y-%m-%dT%H:%M:%S.000Z")++ result = execute_hogql_query(+ f"SELECT count() FROM (SELECT '{timestamp}' AS start_timestamp) WHERE {where_sql}", team=self.team+ )++ assert result.results[0][0] == expected_countdiff --git a/products/signals/backend/emission/tests/test_datadog_monitor_alerts.py b/products/signals/backend/emission/tests/test_datadog_monitor_alerts.pynew file mode 100644index 000000000000..8a3fc56f3ed8--- /dev/null+++ b/products/signals/backend/emission/tests/test_datadog_monitor_alerts.py@@ -0,0 +1,238 @@+import json+from typing import Any++import pytest+from posthog.test.base import BaseTest, ClickhouseTestMixin++from parameterized import parameterized++from posthog.hogql import ast+from posthog.hogql.query import execute_hogql_query++from products.signals.backend.emission.datadog_monitor_alerts import (+ DATADOG_MONITOR_ALERT_FIELDS,+ DATADOG_MONITOR_ALERTS_CONFIG,+ datadog_monitor_alert_emitter,+ datadog_url_or_none,+ monitor_alert_source_id,+)++MOCK_DATADOG_MONITOR_ALERT_RECORD: dict = {+ "id": "evt-1",+ "timestamp": "2026-07-15T10:00:00.000Z",+ "monitor_id": "1001",+ "monitor_name": "Checkout latency high",+ "destination_state": "Alert",+ "priority": "2",+ "service": "checkout-api",+ "monitor_kind": "query_alert_monitor",+ "alert_cycle_key": "cycle-abc",+ "alert_url": "https://app.datadoghq.com/monitors/1001",+}+++def datadog_monitor_alert_record() -> dict:+ return {**MOCK_DATADOG_MONITOR_ALERT_RECORD}+++class TestDatadogMonitorAlertEmitter:+ def test_emits_signal_for_valid_alert(self, datadog_monitor_alert_record):+ result = datadog_monitor_alert_emitter(team_id=1, record=datadog_monitor_alert_record)++ assert result is not None+ assert (result.source_product, result.source_type) == ("datadog", "issue")+ assert result.source_id == "monitor_alert:1001:cycle-abc"+ assert result.weight == 1.0+ assert (+ result.description+ == "Checkout latency high\nMonitor type: query alert monitor, Priority: P2, Service: checkout-api"+ )+ assert result.extra["kind"] == "monitor_alert"+ assert result.extra["alert_url"] == "https://app.datadoghq.com/monitors/1001"++ @parameterized.expand(+ [+ ("no_details", {"monitor_kind": "", "priority": "", "service": ""}, "Checkout latency high"),+ (+ "only_service",+ {"monitor_kind": "", "priority": "", "service": "checkout-api"},+ "Checkout latency high\nService: checkout-api",+ ),+ (+ "only_type_and_priority",+ {"monitor_kind": "log_alert", "priority": "1", "service": None},+ "Checkout latency high\nMonitor type: log alert, Priority: P1",+ ),+ ]+ )+ def test_description_names_only_the_set_details(self, _name, overrides, expected):+ result = datadog_monitor_alert_emitter(team_id=1, record={**MOCK_DATADOG_MONITOR_ALERT_RECORD, **overrides})++ assert result is not None+ assert result.description == expected++ @parameterized.expand(+ [+ ("empty_monitor_name", {"monitor_name": ""}),+ ("empty_monitor_id", {"monitor_id": ""}),+ ("none_event_id", {"id": None}),+ ]+ )+ def test_skips_alert_without_id_or_monitor(self, _name, overrides):+ assert (+ datadog_monitor_alert_emitter(team_id=1, record={**MOCK_DATADOG_MONITOR_ALERT_RECORD, **overrides}) is None+ )++ @parameterized.expand([("id",), ("monitor_id",), ("monitor_name",)])+ def test_missing_required_column_raises(self, column):+ record = {k: v for k, v in MOCK_DATADOG_MONITOR_ALERT_RECORD.items() if k != column}++ with pytest.raises(ValueError, match="missing required field"):+ datadog_monitor_alert_emitter(team_id=1, record=record)++ def test_source_id_fits_the_ledger_column(self):+ source_id = monitor_alert_source_id({**MOCK_DATADOG_MONITOR_ALERT_RECORD, "alert_cycle_key": "c" * 5000})++ assert len(source_id) < 200+ assert source_id.startswith("monitor_alert:1001:")++ @parameterized.expand(+ [+ ("us1", "https://app.datadoghq.com/monitors/1001", True),+ ("us3", "https://us3.datadoghq.com/monitors/1001", True),+ ("eu", "https://app.datadoghq.eu/monitors/1001", True),+ ("gov", "https://app.ddog-gov.com/monitors/1001", True),+ ("other_host", "https://example.com/monitors/1001", False),+ ("plain_http", "http://app.datadoghq.com/monitors/1001", False),+ ("lookalike_subdomain", "https://app.datadoghq.com.evil.example/monitors/1001", False),+ ("lookalike_suffix", "https://evildatadoghq.com/monitors/1001", False),+ ("userinfo_trick", "https://[email protected]/monitors/1001", False),+ ("backslash_userinfo_trick", "https://evil.example\\@app.datadoghq.com/monitors/1001", False),+ ("backslash_in_path", "https://app.datadoghq.com\\.evil.example/monitors/1001", False),+ ("control_character", "https://app.datadoghq.com/monitors/1001\r\nX: y", False),+ ("embedded_space", "https://app.datadoghq.com/monitors/ 1001", False),+ ("trailing_dot_host", "https://app.datadoghq.com./monitors/1001", False),+ ("explicit_port", "https://app.datadoghq.com:8443/monitors/1001", True),+ ("javascript_scheme", "javascript:alert(1)", False),+ ("empty", "", False),+ ("none", None, False),+ ]+ )+ def test_alert_url_is_restricted_to_datadog_hosts(self, _name, url, expect_kept):+ assert datadog_url_or_none(url) == (url if expect_kept else None)+++def _alert_attributes(**overrides: Any) -> dict[str, Any]:+ attributes: dict[str, Any] = {+ "status": "error",+ "title": "[Triggered on {service:checkout-api}] PERSONAL-MARKER title",+ "monitor_id": 1001,+ "priority": "2",+ "service": "checkout-api",+ "evt": {"type": "query_alert_monitor", "id": "evt-1"},+ "monitor": {+ "id": 1001,+ "name": "Checkout latency high",+ "message": "PERSONAL-MARKER monitor message",+ "query": "avg(last_5m):avg:trace.http.request.duration{*} > 2",+ "alert_cycle_key_txt": "cycle-abc",+ "transition": {"transition_type": "alert", "destination_state": "Alert"},+ "result": {"alert_url": "https://app.datadoghq.com/monitors/1001?result_id=1"},+ },+ "monitor-alert-event": {"text_only_message": "PERSONAL-MARKER text", "alert_cycle_key": "cycle-xyz"},+ }+ attributes.update(overrides)+ return attributes+++class TestMonitorAlertFields(ClickhouseTestMixin, BaseTest):+ @parameterized.expand(+ [+ (+ "full_firing_event",+ _alert_attributes(),+ [+ (+ "evt-1",+ "1001",+ "Checkout latency high",+ "Alert",+ "2",+ "checkout-api",+ "query_alert_monitor",+ "cycle-abc",+ "https://app.datadoghq.com/monitors/1001?result_id=1",+ )+ ],+ ),+ (+ "string_monitor_id",+ _alert_attributes(monitor_id="77"),+ [+ (+ "evt-1",+ "77",+ "Checkout latency high",+ "Alert",+ "2",+ "checkout-api",+ "query_alert_monitor",+ "cycle-abc",+ "https://app.datadoghq.com/monitors/1001?result_id=1",+ )+ ],+ ),+ (+ "cycle_key_only_on_the_alert_event",+ _alert_attributes(monitor={"name": "Checkout latency high"}),+ [+ (+ "evt-1",+ "1001",+ "Checkout latency high",+ "",+ "2",+ "checkout-api",+ "query_alert_monitor",+ "cycle-xyz",+ "",+ )+ ],+ ),+ (+ "ids_from_the_monitor_object",+ _alert_attributes(monitor_id=None, monitor={"id": 2002, "templated_name": "Checkout latency {{host}}"}),+ [+ (+ "evt-1",+ "2002",+ "Checkout latency {{host}}",+ "",+ "2",+ "checkout-api",+ "query_alert_monitor",+ "cycle-xyz",+ "",+ )+ ],+ ),+ ("recovered_event", _alert_attributes(status="ok"), []),+ ("warning_event", _alert_attributes(status="warn"), []),+ ("no_attributes", {}, []),+ ]+ )+ def test_extracts_identifiers_and_filters_to_firing_alerts(self, _name, attributes, expected_rows):+ # The row is built inline, so this proves the extraction against ClickHouse's JSON functions.+ selected = ", ".join(DATADOG_MONITOR_ALERT_FIELDS)+ result = execute_hogql_query(+ f"SELECT {selected} FROM (SELECT 'evt-1' AS id, '2026-07-15T10:00:00.000Z' AS timestamp, "+ f"{{attributes}} AS attributes) WHERE {DATADOG_MONITOR_ALERTS_CONFIG.where_clause}",+ team=self.team,+ placeholders={"attributes": ast.Constant(value=json.dumps(attributes))},+ )++ rows = [tuple(row)[:1] + tuple(row)[2:] for row in result.results]+ assert rows == expected_rows+ assert all("PERSONAL-MARKER" not in str(value) for row in result.results for value in row)diff --git a/products/signals/backend/emission/tests/test_tier1_registry.py b/products/signals/backend/emission/tests/test_tier1_registry.pyindex 5e87b7597a96..8347e8ea4725 100644--- a/products/signals/backend/emission/tests/test_tier1_registry.py+++ b/products/signals/backend/emission/tests/test_tier1_registry.py@@ -23,6 +23,11 @@ TIER1_SOURCES = [(ExternalDataSourceType.BUGSNAG, "errors", "bugsnag", "issue"),(ExternalDataSourceType.HONEYBADGER, "faults", "honeybadger", "issue"),(ExternalDataSourceType.RAYGUN, "error_groups", "raygun", "issue"),+ (ExternalDataSourceType.DATADOG, "error_tracking_issues", "datadog", "issue"),+ (ExternalDataSourceType.DATADOG, "error_spans", "datadog", "issue"),+ (ExternalDataSourceType.DATADOG, "error_logs", "datadog", "issue"),+ (ExternalDataSourceType.DATADOG, "incidents", "datadog", "issue"),+ (ExternalDataSourceType.DATADOG, "monitor_alerts", "datadog", "issue"),# Tier-2 security scanners(ExternalDataSourceType.SNYK, "issues", "snyk", "scanner_finding"),(ExternalDataSourceType.SONARQUBE, "issues", "sonarqube", "scanner_finding"),@@ -53,12 +58,13 @@ def _mock_record(fields: tuple[str, ...]) -> dict:"""A full record covering every SELECTed column, with plausible types."""record: dict = {}for field in fields:- if field in ("tags", "labels"):- record[field] = '["one", "two"]'- elif field in ("id", "iid", "project_id", "number", "workflow_state_id"):- record[field] = 123+ name = field.rsplit(" AS ", 1)[-1]+ if name in ("tags", "labels"):+ record[name] = '["one", "two"]'+ elif name in ("id", "iid", "project_id", "number", "workflow_state_id"):+ record[name] = 123else:- record[field] = f"value-{field}"+ record[name] = f"value-{name}"return recorddiff --git a/products/signals/backend/enums.py b/products/signals/backend/enums.pyindex 63b845547337..4a6f1a8ffc0e 100644--- a/products/signals/backend/enums.py+++ b/products/signals/backend/enums.py@@ -99,6 +99,7 @@ class SignalSourceProduct(StrEnum):BUGSNAG = "bugsnag"HONEYBADGER = "honeybadger"RAYGUN = "raygun"+ DATADOG = "datadog"# Tier-2 security scanners (record kind: scanner_finding)SNYK = "snyk"SONARQUBE = "sonarqube"@@ -191,6 +192,7 @@ SIGNAL_SOURCE_PRODUCT_LABELS: dict[SignalSourceProduct, str] = {SignalSourceProduct.BUGSNAG: "Bugsnag",SignalSourceProduct.HONEYBADGER: "Honeybadger",SignalSourceProduct.RAYGUN: "Raygun",+ SignalSourceProduct.DATADOG: "Datadog",SignalSourceProduct.SNYK: "Snyk",SignalSourceProduct.SONARQUBE: "SonarQube",SignalSourceProduct.SEMGREP: "Semgrep",diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 7686292e0d55..53ffc20b5633 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -219,6 +219,7 @@ export const InboxOnboardingStepEnumApi = {* * `bugsnag` - Bugsnag* * `honeybadger` - Honeybadger* * `raygun` - Raygun+ * * `datadog` - Datadog* * `snyk` - Snyk* * `sonarqube` - SonarQube* * `semgrep` - Semgrep@@ -273,6 +274,7 @@ export const SignalSourceProductEnumApi = {Bugsnag: 'bugsnag',Honeybadger: 'honeybadger',Raygun: 'raygun',+ Datadog: 'datadog',Snyk: 'snyk',Sonarqube: 'sonarqube',Semgrep: 'semgrep',@@ -376,6 +378,7 @@ export interface InboxOnboardingSourceApi {* * `bugsnag` - Bugsnag* * `honeybadger` - Honeybadger* * `raygun` - Raygun+ * * `datadog` - Datadog* * `snyk` - Snyk* * `sonarqube` - SonarQube* * `semgrep` - Semgrep@@ -2241,6 +2244,7 @@ export interface SignalReportSuggestedReviewersArtefactApi {* * `bugsnag` - bugsnag* * `honeybadger` - honeybadger* * `raygun` - raygun+ * * `datadog` - datadog* * `snyk` - snyk* * `sonarqube` - sonarqube* * `semgrep` - semgrep@@ -2295,6 +2299,7 @@ export const SignalSourceProductApi = {Bugsnag: 'bugsnag',Honeybadger: 'honeybadger',Raygun: 'raygun',+ Datadog: 'datadog',Snyk: 'snyk',Sonarqube: 'sonarqube',Semgrep: 'semgrep',@@ -2821,6 +2826,40 @@ export interface RaygunErrorGroupSignalExtraApi {created_at: string | null}+export type DatadogSignalExtraKindEnumApi =+ (typeof DatadogSignalExtraKindEnumApi)[keyof typeof DatadogSignalExtraKindEnumApi]++export const DatadogSignalExtraKindEnumApi = {+ Incident: 'incident',+ ErrorTrackingIssue: 'error_tracking_issue',+ ErrorSpan: 'error_span',+ ErrorLog: 'error_log',+ MonitorAlert: 'monitor_alert',+} as const++export interface DatadogSignalExtraApi {+ kind: DatadogSignalExtraKindEnumApi+ severity?: string | null+ state?: string | null+ created?: string | null+ service?: string | null+ platform?: string | null+ file_path?: string | null+ function_name?: string | null+ error_type?: string | null+ resource_name?: string | null+ first_seen?: string | null+ last_seen?: string | null+ is_crash?: string | null+ window_total_count?: string | null+ window_impacted_users?: string | null+ occurrences?: string | null+ monitor_id?: string | null+ monitor_type?: string | null+ priority?: string | null+ alert_url?: string | null+}+export interface SnykScannerFindingSignalExtraApi {effective_severity_level: string | nullstatus: string | null@@ -2995,6 +3034,7 @@ export type SignalExtraApi =| BugsnagErrorSignalExtraApi| HoneybadgerFaultSignalExtraApi| RaygunErrorGroupSignalExtraApi+ | DatadogSignalExtraApi| SnykScannerFindingSignalExtraApi| SonarqubeScannerFindingSignalExtraApi| SemgrepScannerFindingSignalExtraApi@@ -3090,6 +3130,7 @@ export interface SignalNodeApi {* * `bugsnag` - bugsnag* * `honeybadger` - honeybadger* * `raygun` - raygun+ * * `datadog` - datadog* * `snyk` - snyk* * `sonarqube` - sonarqube* * `semgrep` - semgrepdiff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.tsindex 911ab7b2d541..50a3c3932ecb 100644--- a/products/signals/frontend/generated/api.zod.ts+++ b/products/signals/frontend/generated/api.zod.ts@@ -170,6 +170,7 @@ export const SignalsOnboardingCreateBody = /* @__PURE__ */ zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -191,10 +192,10 @@ export const SignalsOnboardingCreateBody = /* @__PURE__ */ zod.object({'google_search_console',]).describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console').describe(- 'Source product selected during setup.\n\n\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ 'Source product selected during setup.\n\n\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([@@ -346,6 +347,7 @@ export const SignalsOnboardingCompleteCreateBody = /* @__PURE__ */ zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -367,10 +369,10 @@ export const SignalsOnboardingCompleteCreateBody = /* @__PURE__ */ zod.object({'google_search_console',]).describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console').describe(- 'Source product selected during setup.\n\n\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ 'Source product selected during setup.\n\n\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([@@ -3520,6 +3522,7 @@ export const SignalsSourceConfigsCreateBody = /* @__PURE__ */ zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -3541,7 +3544,7 @@ export const SignalsSourceConfigsCreateBody = /* @__PURE__ */ zod.object({'google_search_console',]).describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([@@ -3612,6 +3615,7 @@ export const SignalsSourceConfigsUpdateBody = /* @__PURE__ */ zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -3633,7 +3637,7 @@ export const SignalsSourceConfigsUpdateBody = /* @__PURE__ */ zod.object({'google_search_console',]).describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([@@ -3704,6 +3708,7 @@ export const SignalsSourceConfigsPartialUpdateBody = /* @__PURE__ */ zod.object('bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -3726,7 +3731,7 @@ export const SignalsSourceConfigsPartialUpdateBody = /* @__PURE__ */ zod.object(]).optional().describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/canonical_descriptions.pyindex 9fa8f4e34385..b7c29d71c8d6 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/canonical_descriptions.py@@ -48,6 +48,94 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"aggregation_key": "Key used to group related events together.",},},+ "error_tracking_issues": {+ "description": (+ "A grouped error from Datadog Error Tracking, combining APM traces, logs, and RUM. "+ "The table is rebuilt on every sync from the last 14 days of activity, so it holds issues with errors in that window."+ ),+ "docs_url": "https://docs.datadoghq.com/api/latest/error-tracking/#search-error-tracking-issues",+ "columns": {+ "id": "Unique identifier for the error tracking issue.",+ "error_type": "Type or class of the error, for example an exception name.",+ "error_message": "Message of the error that defines the issue.",+ "file_path": "Path of the source file where the error occurred.",+ "function_name": "Name of the function where the error occurred.",+ "service": "Name of the service the error comes from.",+ "platform": "Platform the error comes from (for example BACKEND, BROWSER, ANDROID, or IOS).",+ "languages": "Programming languages of the code the error comes from.",+ "state": "Triage state of the issue (OPEN, ACKNOWLEDGED, RESOLVED, IGNORED, or EXCLUDED).",+ "is_crash": "Whether the error crashed the application.",+ "first_seen": "Time the issue was first seen, as an ISO 8601 UTC string.",+ "last_seen": "Time the issue was last seen, as an ISO 8601 UTC string.",+ "first_seen_version": "Application version in which the issue was first seen.",+ "last_seen_version": "Application version in which the issue was last seen.",+ "regression": "Details of the latest regression of the issue: when it regressed, in which version, and when it was resolved.",+ "window_total_count": "Number of error events for the issue in the synced window. When the window was split to stay under the API limit, the counts of the parts are added up.",+ "window_impacted_sessions": "Number of sessions affected in the synced window. When the window was split, this is the largest count of any part, so it can be lower than the true number.",+ "window_impacted_users": "Number of users affected in the synced window. When the window was split, this is the largest count of any part, so it can be lower than the true number.",+ },+ },+ "error_spans": {+ "description": (+ "An APM span with an error status. Only spans matching status:error are synced, "+ "because span volume is too high to sync in full."+ ),+ "docs_url": "https://docs.datadoghq.com/api/latest/spans/#get-a-list-of-spans",+ "columns": {+ "id": "Unique identifier for the span.",+ "service": "Name of the service that emitted the span.",+ "resource_name": "Resource the span measured, for example an endpoint or a query.",+ "operation_name": "Name of the operation the span measured.",+ "resource_hash": "Hash of the span's resource.",+ "env": "Environment the span was recorded in.",+ "host": "Host that emitted the span.",+ "trace_id": "Identifier of the trace the span belongs to.",+ "span_id": "Identifier of the span within its trace.",+ "parent_id": "Identifier of the parent span, if any.",+ "status": "Status of the span. Always error in this table.",+ "error": "Error details of the span, such as the error type.",+ "custom": "Custom span attributes, including error message and stack trace when the tracer sets them.",+ "tags": "Tags attached to the span.",+ "start_timestamp": "Time at which the span started, as an ISO 8601 UTC string.",+ "end_timestamp": "Time at which the span ended, as an ISO 8601 UTC string.",+ },+ },+ "error_logs": {+ "description": (+ "A log event with the error status. Only logs matching status:error are synced. "+ "Use the logs table for every log level."+ ),+ "docs_url": "https://docs.datadoghq.com/api/latest/logs/#search-logs",+ "columns": {+ "id": "Unique identifier for the log event.",+ "service": "Name of the service that emitted the log.",+ "host": "Host that emitted the log.",+ "message": "The log message body.",+ "status": "Severity status of the log. Always error in this table.",+ "tags": "Tags attached to the log event.",+ "timestamp": "Time at which the log event occurred.",+ },+ },+ "monitor_alerts": {+ "description": (+ "A Datadog monitor alert event that is firing (status error). "+ "Only events matching source:alert status:error are synced. "+ "The table is rebuilt on every sync from the last 7 days."+ ),+ "docs_url": "https://docs.datadoghq.com/api/latest/events/#get-a-list-of-events",+ "columns": {+ "id": "Unique identifier for the event.",+ "type": "JSON:API resource type of the event.",+ "timestamp": "Time at which the alert event occurred, as an ISO 8601 UTC string.",+ "message": "Free-text notification body of the alert.",+ "tags": "Tags attached to the event.",+ "attributes": (+ "Nested object with the alert details: status (error means firing), title, monitor_id, priority, "+ "service, evt (type of monitor), and monitor (id, name, type, alert cycle key, state transition, "+ "result links)."+ ),+ },+ },"dashboards": {"description": "A Datadog dashboard — a configurable set of widgets visualizing metrics and logs.","docs_url": "https://docs.datadoghq.com/api/latest/dashboards/#get-all-dashboards",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/datadog.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/datadog.pyindex 1a48a232f2de..926f5e63a201 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/datadog.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/datadog.py@@ -12,6 +12,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.httfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.schema import schema_for_resourcefrom products.warehouse_sources.backend.temporal.data_imports.sources.common.typings import SourceResponse+from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.error_tracking import search_issue_rowsfrom products.warehouse_sources.backend.temporal.data_imports.sources.datadog.settings import (DATADOG_ENDPOINTS,DatadogEndpointConfig,@@ -262,8 +263,13 @@ def _make_fetcher(wait=wait_exponential_jitter(initial=1, max=30),reraise=True,)- def fetch_page(page_url: str, allow_missing: bool = False) -> Any:- response = session.get(page_url, timeout=REQUEST_TIMEOUT_SECONDS)+ def fetch_page(page_url: str, allow_missing: bool = False, json_body: Optional[dict[str, Any]] = None) -> Any:+ # The transport only retries GET on its own, so a POST search relies on the retry above.+ # That is safe because the search reads data and changes nothing.+ if json_body is not None:+ response = session.post(page_url, json=json_body, timeout=REQUEST_TIMEOUT_SECONDS)+ else:+ response = session.get(page_url, timeout=REQUEST_TIMEOUT_SECONDS)# 408 is a transient request timeout on Datadog's side; retry it like 429/5xx rather than# letting it raise_for_status() into a fatal, non-retried HTTPError.@@ -287,22 +293,32 @@ def _walk(start_url: str,fetch_page: Callable[..., Any],host: str,+ logger: FilteringBoundLogger,save_state: Callable[[str], None] | None = None,allow_missing: bool = False,+ max_pages: int | None = None,) -> Iterator[list[dict[str, Any]]]:"""Page through one endpoint URL, yielding a normalized batch per response."""url = start_url+ pages = 0while True:data = fetch_page(url, allow_missing)if data is None:return+ pages += 1items = _extract_items(data, config)if items:if config.flatten_attributes:items = [_flatten_item(item) for item in items]+ if config.row_transform is not None:+ items = [config.row_transform(item) for item in items]yield items+ if max_pages is not None and pages >= max_pages:+ logger.warning("datadog.page_cap_reached", endpoint=config.name, pages=pages)+ return+# An empty page is not the end of the walk: the usage endpoints carry their cursor in# `meta` independently of `data`, so only the paginator decides when to stop.next_url = _compute_next_url(config, url, data, len(items), host)@@ -321,6 +337,7 @@ def _fan_out_rows(config: DatadogEndpointConfig,fetch_page: Callable[..., Any],host: str,+ logger: FilteringBoundLogger,) -> Iterator[list[dict[str, Any]]]:"""Walk a parent endpoint and query the child endpoint once per parent id."""fan_out = config.parent@@ -333,7 +350,7 @@ def _fan_out_rows()parents_seen = 0- for parent_batch in _walk(parent_config, parent_url, fetch_page, host):+ for parent_batch in _walk(parent_config, parent_url, fetch_page, host, logger):for parent in parent_batch:if parents_seen >= fan_out.max_parents:# Returning here would write a truncated table that looks like a complete sync.@@ -356,7 +373,7 @@ def _fan_out_rows()# A parent deleted between the list call and its child call answers 404; skip it# rather than failing the whole sync.- for child_batch in _walk(config, child_url, fetch_page, host, allow_missing=True):+ for child_batch in _walk(config, child_url, fetch_page, host, logger, allow_missing=True):for row in child_batch:row[fan_out.child_id_field] = parent_idyield child_batch@@ -386,10 +403,16 @@ def get_rows(session = make_tracked_session(headers=headers, redact_values=(api_key, app_key))fetch_page = _make_fetcher(session, logger)+ if config.search is not None:+ # A search is a set of time windows, not a URL chain, so there is no position to resume from.+ url = _build_initial_url(host, config.path, config.static_params)+ yield from search_issue_rows(config, fetch_page, url, logger)+ return+if config.parent is not None:# A fan-out position is a parent cursor plus a child page, which the single-URL resume# state cannot express, so these endpoints restart from the first parent instead.- yield from _fan_out_rows(config, fetch_page, host)+ yield from _fan_out_rows(config, fetch_page, host, logger)returnresume_config = resumable_source_manager.load_state() if resumable_source_manager.can_resume() else None@@ -404,12 +427,18 @@ def get_rows(params = _build_initial_params(config, should_use_incremental_field, db_incremental_field_last_value)url = _build_initial_url(host, config.path, params)+ # The cap is safe only where the rows it drops come back or are the oldest: an incremental sync+ # resumes from the checkpointed cursor, and a newest-first walk drops the oldest rows.+ newest_first = (config.sort_param or "").startswith("-")+ max_pages = config.max_pages_per_sync if should_use_incremental_field or newest_first else Noneyield from _walk(config,url,fetch_page,host,+ logger,save_state=lambda next_url: resumable_source_manager.save_state(DatadogResumeConfig(next_url=next_url)),+ max_pages=max_pages,)@@ -438,7 +467,7 @@ def datadog_source(db_incremental_field_last_value=db_incremental_field_last_value,),primary_keys=list(config.primary_keys),- sort_mode="asc",+ sort_mode="desc" if (config.sort_param or "").startswith("-") else "asc",partition_count=1,partition_size=1,partition_mode="datetime" if config.partition_key else None,diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/error_spans.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/error_spans.pynew file mode 100644index 000000000000..5f001f221ebe--- /dev/null+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/error_spans.py@@ -0,0 +1,39 @@+from typing import Any++# The spans API documents span tags under `custom`, and some spans also carry them under `attributes`+# or at the top level. A tag can be nested (`{"error": {"type": ...}}`) or dotted (`"error.type"`).+_TAG_CONTAINERS = ("custom", "attributes")+++def _nested_error_type(value: Any) -> str | None:+ if isinstance(value, dict):+ error_type = value.get("type")+ if isinstance(error_type, str) and error_type:+ return error_type+ return None+++def span_error_type(row: dict[str, Any]) -> str | None:+ """The span's error type, wherever the spans API put it, or `None`."""+ if error_type := _nested_error_type(row.get("error")):+ return error_type+ for container_name in _TAG_CONTAINERS:+ container = row.get(container_name)+ if not isinstance(container, dict):+ continue+ if error_type := _nested_error_type(container.get("error")):+ return error_type+ dotted = container.get("error.type")+ if isinstance(dotted, str) and dotted:+ return dotted+ return None+++def with_span_error_type(row: dict[str, Any]) -> dict[str, Any]:+ """Add an `error_type` column to a flattened span row.++ Every row gets the column, empty when the span has no error type, so the table always has it and+ a query that groups on it cannot fail on an account whose spans keep the error somewhere else.+ """+ row["error_type"] = span_error_type(row)+ return rowdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/error_tracking.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/error_tracking.pynew file mode 100644index 000000000000..1a1be81c4743--- /dev/null+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/error_tracking.py@@ -0,0 +1,254 @@+from collections.abc import Callable, Iterator+from dataclasses import field+from datetime import UTC, datetime+from typing import TYPE_CHECKING, Any++from structlog.types import FilteringBoundLogger++from posthog.dataclasses import frozen++if TYPE_CHECKING:+ from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.settings import DatadogEndpointConfig++SEARCH_BATCH_SIZE = 500+++@frozen+class DatadogIssueSearchConfig:+ """Request and response shape of Datadog's Error Tracking issue search.++ The endpoint is a POST with a JSON body, returns at most ``max_results_per_request`` issues and+ has no pagination, so the sync covers a lookback window by halving it until no slice is capped.+ """++ query: str = "*"+ # ``ALL`` covers APM traces, logs and RUM in one call, so one request grades every source of errors.+ persona: str = "ALL"+ # A capped response keeps only the first results. The signals emitter reads only newly seen issues,+ # so those must be kept. With TOTAL_COUNT, long-running noisy issues fill the response and new+ # low-count issues never reach the table.+ order_by: str = "FIRST_SEEN"+ # Resolved, ignored and excluded issues never become signals, so Datadog filters them out. They+ # would otherwise fill the capped result list and force needless window splits.+ states: tuple[str, ...] = ("OPEN", "ACKNOWLEDGED")+ # The ``included`` object type that carries the issue attributes (error type, message, state, ...).+ included_type: str = "issue"+ # Issue attributes Datadog returns as epoch milliseconds. They become ISO strings so they+ # partition and parse like every other timestamp column in this source.+ epoch_ms_fields: tuple[str, ...] = ("first_seen", "last_seen")+ max_results_per_request: int = 100+ # Smallest slice worth splitting further. A slice this small that is still capped is reported+ # loudly instead of split forever.+ min_window_seconds: int = 3600+ # Hard cap on search requests in one sync. Past it the remaining windows are not split, so a busy+ # org gets a partial answer and a warning instead of an unbounded run of requests.+ max_requests_per_sync: int = 60+ # Issue attributes in Datadog's ``IssueAttributes`` schema. Every row carries each of them, empty+ # when Datadog omits it, so the table keeps the same columns whatever the window holds.+ issue_fields: tuple[str, ...] = (+ "error_message",+ "error_type",+ "file_path",+ "first_seen",+ "first_seen_version",+ "function_name",+ "is_crash",+ "languages",+ "last_seen",+ "last_seen_version",+ "platform",+ "regression",+ "service",+ "state",+ )+ # Counts that add up across slices. The other counts are distinct counts, so the same user or+ # session can appear in two slices and only the largest slice value is a safe lower bound.+ additive_count_columns: tuple[str, ...] = ("window_total_count",)+ # Search-result count attribute -> column. The counts cover the queried window only, so the+ # columns say so.+ count_fields: dict[str, str] = field(+ default_factory=lambda: {+ "total_count": "window_total_count",+ "impacted_sessions": "window_impacted_sessions",+ "impacted_users": "window_impacted_users",+ }+ )+++def _epoch_ms_to_iso(value: Any) -> Any:+ """Render epoch milliseconds like the event endpoints' timestamps (UTC ISO 8601, ms, ``Z``)."""+ if isinstance(value, bool) or not isinstance(value, int | float):+ return value+ try:+ dt = datetime.fromtimestamp(int(value) // 1000, UTC).replace(microsecond=(int(value) % 1000) * 1000)+ except (OverflowError, OSError, ValueError):+ return value+ return dt.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"+++def _build_search_body(search: DatadogIssueSearchConfig, from_ms: int, to_ms: int) -> dict[str, Any]:+ """Body of an Error Tracking issue search. ``from`` is inclusive and ``to`` is exclusive."""+ return {+ "data": {+ "type": "search_request",+ "attributes": {+ "query": search.query,+ "persona": search.persona,+ "order_by": search.order_by,+ "states": list(search.states),+ "from": from_ms,+ "to": to_ms,+ },+ }+ }+++def _join_included(response_json: Any, search: DatadogIssueSearchConfig) -> list[dict[str, Any]]:+ """Turn search results into one flat row per issue.++ A result only carries window counts and a link to its issue. The issue attributes sit in the+ ``included`` list, which mixes issue, case, user and team objects, so only the issue type is used.+ """+ if not isinstance(response_json, dict):+ return []++ included = response_json.get("included")+ issue_attributes: dict[Any, dict[str, Any]] = {}+ if isinstance(included, list):+ for inc in included:+ if isinstance(inc, dict) and inc.get("type") == search.included_type:+ attributes = inc.get("attributes")+ issue_attributes[inc.get("id")] = attributes if isinstance(attributes, dict) else {}++ results = response_json.get("data")+ rows: list[dict[str, Any]] = []+ for result in results if isinstance(results, list) else []:+ if not isinstance(result, dict):+ continue+ relationship = (result.get("relationships") or {}).get(search.included_type) or {}+ related = relationship.get("data") if isinstance(relationship, dict) else None+ issue_id = related.get("id") if isinstance(related, dict) else None+ issue_id = issue_id or result.get("id")+ if not issue_id:+ continue++ # Seeding every known attribute keeps the same columns in the table when a window has no value for one.+ row: dict[str, Any] = dict.fromkeys(search.issue_fields)+ row.update(issue_attributes.get(issue_id, {}))+ counts = result.get("attributes")+ counts = counts if isinstance(counts, dict) else {}+ for source_field, column in search.count_fields.items():+ row[column] = counts.get(source_field)+ row["id"] = issue_id+ rows.append(row)+ return rows+++def _merge_issue_rows(+ merged: dict[Any, dict[str, Any]], rows: list[dict[str, Any]], search: DatadogIssueSearchConfig+) -> None:+ """Fold rows from one slice into the per-issue totals.++ Slices do not overlap, so event counts add up. Distinct user and session counts do not, because+ one user can appear in two slices, so they keep the largest slice value. ``first_seen`` and+ ``last_seen`` describe the whole issue and are the same in every slice, so the min and max only+ guard against a stale value.+ """+ count_columns = list(search.count_fields.values())+ for row in rows:+ existing = merged.get(row["id"])+ if existing is None:+ merged[row["id"]] = row+ continue+ for column in count_columns:+ if column in search.additive_count_columns:+ existing[column] = (existing.get(column) or 0) + (row.get(column) or 0)+ else:+ existing[column] = max(existing.get(column) or 0, row.get(column) or 0)+ if row.get("last_seen") is not None:+ existing["last_seen"] = max(existing.get("last_seen") or 0, row["last_seen"])+ if row.get("first_seen") is not None:+ existing["first_seen"] = min(existing.get("first_seen") or row["first_seen"], row["first_seen"])+++@frozen(frozen=False)+class _SearchBudget:+ """Search requests a sync may still start, beyond the one already made for the current window.++ A split reserves both of its requests up front, so the total never passes the configured cap.+ """++ remaining: int+++def _search_window(+ fetch_page: Callable[..., Any],+ url: str,+ search: DatadogIssueSearchConfig,+ from_ms: int,+ to_ms: int,+ merged: dict[Any, dict[str, Any]],+ logger: FilteringBoundLogger,+ budget: _SearchBudget,+) -> None:+ data = fetch_page(url, False, _build_search_body(search, from_ms, to_ms))+ rows = _join_included(data, search)+ result_count = len(data.get("data") or []) if isinstance(data, dict) else 0++ # Both truncation paths below warn instead of raising, unlike the fan-out limit. The search has no+ # pagination, so a busy account would otherwise fail every sync. The table can miss some issues+ # in the window, and the next sync reads the window again.+ if result_count >= search.max_results_per_request:+ if to_ms - from_ms > search.min_window_seconds * 1000:+ if budget.remaining < 2:+ logger.warning(+ "datadog.search_request_cap_reached",+ max_requests=search.max_requests_per_sync,+ from_ms=from_ms,+ to_ms=to_ms,+ )+ else:+ # The API has no pagination, so a full response may hide issues. Halve the window until+ # no slice is full. Earlier half first, so rows arrive in time order.+ budget.remaining -= 2+ midpoint = from_ms + (to_ms - from_ms) // 2+ _search_window(fetch_page, url, search, from_ms, midpoint, merged, logger, budget)+ _search_window(fetch_page, url, search, midpoint, to_ms, merged, logger, budget)+ return+ else:+ logger.warning(+ "datadog.search_window_truncated",+ max_results=search.max_results_per_request,+ from_ms=from_ms,+ to_ms=to_ms,+ )++ _merge_issue_rows(merged, rows, search)+++def search_issue_rows(+ config: "DatadogEndpointConfig",+ fetch_page: Callable[..., Any],+ url: str,+ logger: FilteringBoundLogger,+) -> Iterator[list[dict[str, Any]]]:+ """Read Error Tracking issues for the lookback window, merged into one row per issue."""+ search = config.search+ assert search is not None++ to_ms = int(datetime.now(UTC).timestamp() * 1000)+ from_ms = to_ms - (config.default_lookback_days or 1) * 24 * 3600 * 1000++ # Counts for a split issue only add up across the whole window, so rows are held until every+ # slice has been read. One row per issue keeps this small.+ merged: dict[Any, dict[str, Any]] = {}+ budget = _SearchBudget(remaining=search.max_requests_per_sync - 1)+ _search_window(fetch_page, url, search, from_ms, to_ms, merged, logger, budget)++ rows = list(merged.values())+ for row in rows:+ for column in search.epoch_ms_fields:+ if column in row:+ row[column] = _epoch_ms_to_iso(row[column])+ for start in range(0, len(rows), SEARCH_BATCH_SIZE):+ yield rows[start : start + SEARCH_BATCH_SIZE]diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/settings.pyindex a2625ee0e790..f5115d1cbd50 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/settings.py@@ -1,8 +1,13 @@+from collections.abc import Callablefrom dataclasses import field-from typing import Literal, Optional+from typing import Any, Literal, Optionalfrom posthog.dataclasses import frozen+from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.error_spans import with_span_error_type+from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.error_tracking import (+ DatadogIssueSearchConfig,+)from products.warehouse_sources.backend.types import IncrementalField, IncrementalFieldTypePaginationStyle = Literal["cursor", "page", "offset", "record_id", "none"]@@ -73,6 +78,16 @@ class DatadogEndpointConfig:# this the very first sync would only fetch the last 15 minutes. We seed ``filter[from]`` to# ``now - default_lookback_days`` instead; Datadog clamps it to the account's retention.default_lookback_days: Optional[int] = None+ # Set for the Error Tracking issue search, which walks a time window instead of pages.+ search: Optional[DatadogIssueSearchConfig] = None+ # Stops a page walk after this many pages, on an incremental sync or a newest-first walk only. An+ # incremental sync resumes from the checkpointed cursor, and a newest-first walk drops the oldest+ # rows. An ascending full refresh would keep the oldest rows and lose the newest, so it is not capped.+ max_pages_per_sync: Optional[int] = None+ # Applied to each flattened row, for a column the API does not return in one fixed place.+ row_transform: Optional[Callable[[dict[str, Any]], dict[str, Any]]] = None+ # Tables that are off until the user opts in, because they are high volume or need extra scopes.+ should_sync_default: bool = True@propertydef supports_incremental(self) -> bool:@@ -198,6 +213,87 @@ DATADOG_ENDPOINTS: dict[str, DatadogEndpointConfig] = {timestamp_filter_format="month",default_lookback_days=400,),+ # --- Error tracking (opt-in; these feed the Self-driving inbox) ---+ # Grouped errors across APM traces, logs and RUM, one row per issue. The search has no time+ # filter we could checkpoint (``last_seen`` moves for old issues), so this table is a full+ # refresh over the lookback window. Needs the ``error_tracking_read`` scope.+ "error_tracking_issues": DatadogEndpointConfig(+ name="error_tracking_issues",+ path="/api/v2/error-tracking/issues/search",+ data_path="data",+ pagination="none",+ flatten_attributes=True,+ static_params={"include": "issue"},+ search=DatadogIssueSearchConfig(),+ # ``first_seen`` never changes for an issue, unlike ``last_seen``.+ partition_key="first_seen",+ default_lookback_days=14,+ should_sync_default=False,+ ),+ # Error spans only. APM span volume is far too high to sync unfiltered, so the error filter is+ # applied by Datadog. The spans API allows 300 requests per hour, so a sync reads a bounded+ # number of pages and the next sync continues from the checkpointed ``start_timestamp``.+ # The 1 day first-sync lookback keeps the capped first sync on the freshest day instead of+ # spending its pages on older rows. Later syncs continue from the checkpointed timestamp.+ "error_spans": DatadogEndpointConfig(+ name="error_spans",+ path="/api/v2/spans/events",+ data_path="data",+ pagination="cursor",+ page_size=1000,+ page_size_param="page[limit]",+ static_params={"filter[query]": "status:error"},+ flatten_attributes=True,+ partition_key="start_timestamp",+ incremental_fields=_timestamp_incremental_fields("start_timestamp"),+ default_incremental_field="start_timestamp",+ timestamp_filter_param="filter[from]",+ sort_param="timestamp",+ default_lookback_days=1,+ max_pages_per_sync=100,+ should_sync_default=False,+ row_transform=with_span_error_type,+ ),+ # Error-level logs only, for the same volume reason as ``error_spans``. The ``logs`` table+ # stays unfiltered for users who want every log.+ "error_logs": DatadogEndpointConfig(+ name="error_logs",+ path="/api/v2/logs/events",+ data_path="data",+ pagination="cursor",+ page_size=1000,+ page_size_param="page[limit]",+ static_params={"filter[query]": "status:error"},+ flatten_attributes=True,+ partition_key="timestamp",+ incremental_fields=_timestamp_incremental_fields("timestamp"),+ default_incremental_field="timestamp",+ timestamp_filter_param="filter[from]",+ sort_param="timestamp",+ default_lookback_days=1,+ max_pages_per_sync=100,+ should_sync_default=False,+ ),+ # Firing monitor alerts only. Datadog applies the filter, because recoveries and warnings would+ # triple the rows read on every sync. The desktop toggle creates this table as a full refresh, so+ # it re-reads a bounded lookback window. The sort is newest first so that the page cap drops the+ # oldest alerts, which a previous sync has usually already read.+ "monitor_alerts": DatadogEndpointConfig(+ name="monitor_alerts",+ path="/api/v2/events",+ data_path="data",+ pagination="cursor",+ page_size=1000,+ page_size_param="page[limit]",+ static_params={"filter[query]": "source:alert status:error"},+ flatten_attributes=True,+ partition_key="timestamp",+ timestamp_filter_param="filter[from]",+ sort_param="-timestamp",+ default_lookback_days=7,+ max_pages_per_sync=20,+ should_sync_default=False,+ ),# --- Full refresh ---"dashboards": DatadogEndpointConfig(name="dashboards",@@ -370,4 +466,4 @@ INCREMENTAL_FIELDS: dict[str, list[IncrementalField]] = {# Datadog retains logs / audit logs / events for a limited window, so the first sync can only# reach back as far as the account's retention allows.-LIMITED_RETENTION_ENDPOINTS = {"logs", "audit_logs", "events"}+LIMITED_RETENTION_ENDPOINTS = {"logs", "audit_logs", "events", "error_spans", "error_logs", "monitor_alerts"}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/source.pyindex 91249b1e47f6..3fdee45a852a 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/source.py@@ -504,8 +504,12 @@ Create an API key and an application key in your [Datadog organization settings]- `metrics_read`- `teams_read`- `usage_read` and `billing_read` (usage and cost tables)+- `error_tracking_read` (error tracking issues), `apm_read` (error spans), and `logs_read_data` (logs and error logs)+- `events_read` (monitor alerts)-Logs, audit logs, and events read access is governed by your Datadog account's data retention.""",+Logs, audit logs, and events read access is governed by your Datadog account's data retention.++Error tracking issues, error spans, error logs, and monitor alerts are off by default. Turn them on to feed errors and alerts into the PostHog Self-driving inbox. Error spans and error logs only contain `status:error` records, and monitor alerts only contain firing alerts from the last 7 days.""",iconPath="/static/services/datadog.svg",docsUrl="https://posthog.com/docs/cdp/sources/datadog",fields=cast(@@ -575,6 +579,7 @@ Logs, audit logs, and events read access is governed by your Datadog account's dsupports_incremental=DATADOG_ENDPOINTS[endpoint].supports_incremental,supports_append=DATADOG_ENDPOINTS[endpoint].supports_incremental,incremental_fields=INCREMENTAL_FIELDS.get(endpoint, []),+ should_sync_default=DATADOG_ENDPOINTS[endpoint].should_sync_default,description=("Limited to your Datadog account's retention window on initial sync"if endpoint in LIMITED_RETENTION_ENDPOINTSdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog.pyindex b62033745c76..1f1d7e9bb6c1 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog.py@@ -91,6 +91,28 @@ class TestBuildInitialParams:{"page[limit]": 1000, "sort": "timestamp"},[],),+ # Error-only tables: the error filter is applied by Datadog, never after the fetch.+ (+ "error_spans",+ False,+ None,+ {"filter[query]": "status:error", "page[limit]": 1000, "sort": "timestamp"},+ [],+ ),+ (+ "error_logs",+ False,+ None,+ {"filter[query]": "status:error", "page[limit]": 1000, "sort": "timestamp"},+ [],+ ),+ (+ "error_spans",+ True,+ datetime(2026, 1, 1, tzinfo=UTC),+ {"filter[query]": "status:error", "filter[from]": "2026-01-01T00:00:00.000Z"},+ [],+ ),# Cursor endpoint, incremental continuation: filter[from] is the stored watermark.("logs",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog_error_tracking.py b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog_error_tracking.pynew file mode 100644index 000000000000..b9967aea5746--- /dev/null+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/datadog/tests/test_datadog_error_tracking.py@@ -0,0 +1,351 @@+import dataclasses+from typing import Any++import pytest+from unittest import mock++from products.warehouse_sources.backend.temporal.data_imports.sources.common.testing import (+ DriveResult,+ ScriptedResponse,+ SourceDriver,+)+from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.error_tracking import (+ DatadogIssueSearchConfig,+ _epoch_ms_to_iso,+ _join_included,+)+from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.settings import DATADOG_ENDPOINTS+from products.warehouse_sources.backend.temporal.data_imports.sources.datadog.source import DatadogSource+from products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs.datadog import (+ DatadogSourceConfig,+)+++def _driver() -> SourceDriver:+ return SourceDriver(+ DatadogSource(), DatadogSourceConfig(api_key="api", application_key="app", site="datadoghq.com")+ )+++class TestWalkPageCap:+ @pytest.mark.parametrize(+ ("incremental", "expected_ids", "expected_warnings"),+ [+ # The next incremental sync continues from the checkpointed cursor value.+ (True, ["0", "1"], [("datadog.page_cap_reached",)]),+ # An oldest-first full refresh replaces the table, so a cap would drop the newest rows.+ (False, ["0", "1", "2", "3"], []),+ ],+ )+ def test_page_cap_applies_only_where_the_dropped_rows_come_back(+ self, incremental: bool, expected_ids: list[str], expected_warnings: list[tuple[str]]+ ) -> None:+ capped = dataclasses.replace(DATADOG_ENDPOINTS["error_logs"], max_pages_per_sync=2)+ pages = [+ {"data": [{"id": str(i), "attributes": {}}], "links": {"next": f"https://api.datadoghq.com/p{i + 1}"}}+ for i in range(3)+ ] + [{"data": [{"id": "3", "attributes": {}}], "links": {}}]+ logger = mock.MagicMock()++ with mock.patch.dict(DATADOG_ENDPOINTS, {"error_logs": capped}):+ result = _driver().run(+ "error_logs",+ [ScriptedResponse(json=page) for page in pages],+ logger=logger,+ should_use_incremental_field=incremental,+ incremental_field="timestamp" if incremental else None,+ )++ assert result.raised is None+ assert [row["id"] for row in result.rows] == expected_ids+ assert [call.args for call in logger.warning.call_args_list] == expected_warnings+++class TestSpanErrorType:+ @pytest.mark.parametrize(+ ("attributes", "expected"),+ [+ ({"custom": {"error": {"type": "TimeoutError", "message": "upstream"}}}, "TimeoutError"),+ ({"custom": {"error.type": "KeyError"}}, "KeyError"),+ ({"error": {"type": "ValueError"}}, "ValueError"),+ ({"custom": {"http": {"status_code": "500"}}}, None),+ ],+ )+ def test_sync_writes_the_error_type_wherever_the_span_keeps_it(+ self, attributes: dict[str, Any], expected: str | None+ ) -> None:+ span = {"id": "s1", "type": "spans", "attributes": {"service": "checkout-api", **attributes}}++ result = _driver().run("error_spans", [ScriptedResponse(json={"data": [span], "links": {}})])++ assert result.raised is None+ assert [row["error_type"] for row in result.rows] == [expected]+++def _issue_result(issue_id: str, total: int, sessions: int = 1, users: int = 1) -> dict[str, Any]:+ return {+ "id": issue_id,+ "type": "error_tracking_search_result",+ "attributes": {"total_count": total, "impacted_sessions": sessions, "impacted_users": users},+ "relationships": {"issue": {"data": {"id": issue_id, "type": "issue"}}},+ }+++def _issue_included(issue_id: str, last_seen: int, **attributes: Any) -> dict[str, Any]:+ return {+ "id": issue_id,+ "type": "issue",+ "attributes": {+ "error_type": "ConnectionError",+ "error_message": "Connection refused",+ "service": "checkout-api",+ "state": "OPEN",+ "first_seen": 1_772_593_094_123,+ "last_seen": last_seen,+ **attributes,+ },+ }+++def _issue_response(*issues: tuple[str, int, int]) -> dict[str, Any]:+ """Build a search response from ``(issue id, total count, last_seen)`` tuples."""+ return {+ "data": [_issue_result(issue_id, total) for issue_id, total, _ in issues],+ "included": [_issue_included(issue_id, last_seen) for issue_id, _, last_seen in issues],+ }+++class TestIssueSearch:+ @staticmethod+ def _run(script: list[ScriptedResponse], config_override: Any = None) -> tuple[DriveResult, mock.MagicMock]:+ logger = mock.MagicMock()+ endpoint_patch = {"error_tracking_issues": config_override} if config_override else {}+ with mock.patch.dict(DATADOG_ENDPOINTS, endpoint_patch):+ result = _driver().run("error_tracking_issues", script, logger=logger)+ assert result.raised is None+ return result, logger++ @staticmethod+ def _with_search(**overrides: Any) -> Any:+ base = DATADOG_ENDPOINTS["error_tracking_issues"]+ assert base.search is not None+ return dataclasses.replace(base, search=dataclasses.replace(base.search, **overrides))++ def test_posts_a_search_body_and_shapes_rows(self) -> None:+ result, _ = self._run([ScriptedResponse(json=_issue_response(("issue-1", 12, 1_772_679_494_000)))])++ assert [request.method for request in result.requests] == ["POST"]+ request = result.requests[0]+ assert request.path == "/api/v2/error-tracking/issues/search"+ assert request.param("include") == "issue"+ data = request.json()["data"]+ assert data["type"] == "search_request"+ attributes = data["attributes"]+ assert isinstance(attributes["from"], int)+ assert isinstance(attributes["to"], int)+ assert attributes["from"] < attributes["to"]++ # Attributes the response omits are still present, so the table keeps the same columns.+ assert result.rows == [+ {+ **dict.fromkeys(DatadogIssueSearchConfig().issue_fields),+ "id": "issue-1",+ "error_type": "ConnectionError",+ "error_message": "Connection refused",+ "service": "checkout-api",+ "state": "OPEN",+ "first_seen": "2026-03-04T02:58:14.123Z",+ "last_seen": "2026-03-05T02:58:14.000Z",+ "window_total_count": 12,+ "window_impacted_sessions": 1,+ "window_impacted_users": 1,+ }+ ]+ # A sync must not leave resume state behind that a later run would pick up.+ assert result.saved_states == []++ def test_full_response_halves_the_window_and_merges_by_issue(self) -> None:+ override = self._with_search(max_results_per_request=3)+ result, _ = self._run(+ [+ # The whole window comes back full, so it may hide issues.+ ScriptedResponse(+ json=_issue_response(("issue-1", 1, 1_000), ("issue-2", 1, 1_000), ("issue-3", 1, 1_000))+ ),+ ScriptedResponse(+ json={+ "data": [_issue_result("issue-1", 3, users=5), _issue_result("issue-2", 5)],+ "included": [_issue_included("issue-1", 1_000), _issue_included("issue-2", 2_000)],+ }+ ),+ ScriptedResponse(+ json={+ "data": [_issue_result("issue-1", 4, users=2)],+ "included": [_issue_included("issue-1", 9_000)],+ }+ ),+ ],+ config_override=override,+ )++ assert len(result.requests) == 3+ whole, first, second = (request.json()["data"]["attributes"] for request in result.requests)+ # Earlier half first, and the halves tile the window with no gap or overlap.+ assert first["from"] == whole["from"]+ assert first["to"] == second["from"]+ assert second["to"] == whole["to"]++ by_id = {row["id"]: row for row in result.rows}+ assert set(by_id) == {"issue-1", "issue-2"}+ # Counts of the halves add up, and the full-window response is discarded, not double counted.+ assert by_id["issue-1"]["window_total_count"] == 7+ # A user can appear in both halves, so the distinct count is the larger half, not the sum.+ assert by_id["issue-1"]["window_impacted_users"] == 5+ assert by_id["issue-2"]["window_total_count"] == 5+ assert by_id["issue-1"]["last_seen"] == _epoch_ms_to_iso(9_000)++ def test_full_response_at_the_smallest_window_warns_and_keeps_rows(self) -> None:+ # Splitting stops at the minimum window. Dropping the rows silently would look like a+ # complete sync, so the cap is reported and the rows we got are kept.+ override = self._with_search(max_results_per_request=2, min_window_seconds=30 * 24 * 3600)+ result, logger = self._run(+ [ScriptedResponse(json=_issue_response(("issue-1", 1, 1_000), ("issue-2", 2, 1_000)))],+ config_override=override,+ )++ assert len(result.requests) == 1+ assert {row["id"] for row in result.rows} == {"issue-1", "issue-2"}+ logger.warning.assert_called_once()+ assert logger.warning.call_args.args == ("datadog.search_window_truncated",)+ assert logger.warning.call_args.kwargs["max_results"] == 2++ def test_request_cap_stops_splitting_and_warns(self) -> None:+ # Every response is full, so an unbounded sync would split down to the smallest window.+ override = self._with_search(max_results_per_request=1, max_requests_per_sync=5)+ result, logger = self._run(+ [ScriptedResponse(json=_issue_response(("issue-1", 1, 1_000)))] * 5, config_override=override+ )++ assert len(result.requests) <= 5+ assert {row["id"] for row in result.rows} == {"issue-1"}+ capped = [+ call for call in logger.warning.call_args_list if call.args == ("datadog.search_request_cap_reached",)+ ]+ assert capped+ assert capped[0].kwargs["max_requests"] == 5++ def test_transient_status_is_retried_on_post(self) -> None:+ # The transport retries only GET, so the POST search depends on the retry in fetch_page.+ result, _ = self._run(+ [ScriptedResponse(status=503), ScriptedResponse(json=_issue_response(("issue-1", 1, 1_000)))]+ )+ assert [request.method for request in result.requests] == ["POST", "POST"]+ assert [row["id"] for row in result.rows] == ["issue-1"]+++_SEEDED = dict.fromkeys(DatadogIssueSearchConfig().issue_fields)+++class TestJoinIncluded:+ SEARCH = DatadogIssueSearchConfig()++ @pytest.mark.parametrize(+ ("response", "expected"),+ [+ # No ``included`` at all: the row keeps its id and counts.+ (+ {"data": [_issue_result("issue-1", 4)]},+ [+ {+ **_SEEDED,+ "id": "issue-1",+ "window_total_count": 4,+ "window_impacted_sessions": 1,+ "window_impacted_users": 1,+ }+ ],+ ),+ # No relationship: the result id is the issue id.+ (+ {+ "data": [{"id": "issue-1", "attributes": {"total_count": 2}}],+ "included": [_issue_included("issue-1", 5, error_type="TimeoutError")],+ },+ [+ {+ **_SEEDED,+ "id": "issue-1",+ "error_type": "TimeoutError",+ "error_message": "Connection refused",+ "service": "checkout-api",+ "state": "OPEN",+ "first_seen": 1_772_593_094_123,+ "last_seen": 5,+ "window_total_count": 2,+ "window_impacted_sessions": None,+ "window_impacted_users": None,+ }+ ],+ ),+ # Null attributes on both sides must not raise.+ (+ {+ "data": [{"id": "issue-1", "attributes": None, "relationships": None}],+ "included": [{"id": "issue-1", "type": "issue", "attributes": None}],+ },+ [+ {+ **_SEEDED,+ "id": "issue-1",+ "window_total_count": None,+ "window_impacted_sessions": None,+ "window_impacted_users": None,+ }+ ],+ ),+ # Only issue objects supply attributes; a case or team that reuses the id must not leak in.+ (+ {+ "data": [_issue_result("issue-1", 1)],+ "included": [+ {"id": "issue-1", "type": "case", "attributes": {"title": "Not an issue"}},+ _issue_included("issue-1", 5, error_type="TimeoutError"),+ ],+ },+ [+ {+ **_SEEDED,+ "id": "issue-1",+ "error_type": "TimeoutError",+ "error_message": "Connection refused",+ "service": "checkout-api",+ "state": "OPEN",+ "first_seen": 1_772_593_094_123,+ "last_seen": 5,+ "window_total_count": 1,+ "window_impacted_sessions": 1,+ "window_impacted_users": 1,+ }+ ],+ ),+ ("not a dict", []),+ ],+ )+ def test_join_edge_cases(self, response: Any, expected: Any) -> None:+ assert _join_included(response, self.SEARCH) == expected+++class TestEpochMsToIso:+ @pytest.mark.parametrize(+ ("value", "expected"),+ [+ (1_772_593_094_123, "2026-03-04T02:58:14.123Z"),+ (1_772_593_094_000, "2026-03-04T02:58:14.000Z"),+ (1_772_593_094_123.0, "2026-03-04T02:58:14.123Z"),+ (None, None),+ ("2026-03-04T02:58:14.123Z", "2026-03-04T02:58:14.123Z"),+ (True, True),+ ],+ )+ def test_epoch_ms_to_iso(self, value: Any, expected: Any) -> None:+ assert _epoch_ms_to_iso(value) == expecteddiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 29dc7ad1688c..50b2bcdbedb2 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -35184,6 +35184,40 @@ export namespace Schemas {Databricks: 'Databricks',} as const;+ export type DatadogSignalExtraKindEnum = typeof DatadogSignalExtraKindEnum[keyof typeof DatadogSignalExtraKindEnum];+++ export const DatadogSignalExtraKindEnum = {+ Incident: 'incident',+ ErrorTrackingIssue: 'error_tracking_issue',+ ErrorSpan: 'error_span',+ ErrorLog: 'error_log',+ MonitorAlert: 'monitor_alert',+ } as const;++ export interface DatadogSignalExtra {+ kind: DatadogSignalExtraKindEnum;+ severity?: string | null;+ state?: string | null;+ created?: string | null;+ service?: string | null;+ platform?: string | null;+ file_path?: string | null;+ function_name?: string | null;+ error_type?: string | null;+ resource_name?: string | null;+ first_seen?: string | null;+ last_seen?: string | null;+ is_crash?: string | null;+ window_total_count?: string | null;+ window_impacted_users?: string | null;+ occurrences?: string | null;+ monitor_id?: string | null;+ monitor_type?: string | null;+ priority?: string | null;+ alert_url?: string | null;+ }+/*** * `datasets` - datasets* * `dataset_items` - dataset_items@@ -60682,6 +60716,7 @@ export namespace Schemas {* * `bugsnag` - Bugsnag* * `honeybadger` - Honeybadger* * `raygun` - Raygun+ * * `datadog` - Datadog* * `snyk` - Snyk* * `sonarqube` - SonarQube* * `semgrep` - Semgrep@@ -60737,6 +60772,7 @@ export namespace Schemas {Bugsnag: 'bugsnag',Honeybadger: 'honeybadger',Raygun: 'raygun',+ Datadog: 'datadog',Snyk: 'snyk',Sonarqube: 'sonarqube',Semgrep: 'semgrep',@@ -60840,6 +60876,7 @@ export namespace Schemas {* * `bugsnag` - Bugsnag* * `honeybadger` - Honeybadger* * `raygun` - Raygun+ * * `datadog` - Datadog* * `snyk` - Snyk* * `sonarqube` - SonarQube* * `semgrep` - Semgrep@@ -97737,6 +97774,7 @@ export namespace Schemas {* * `bugsnag` - bugsnag* * `honeybadger` - honeybadger* * `raygun` - raygun+ * * `datadog` - datadog* * `snyk` - snyk* * `sonarqube` - sonarqube* * `semgrep` - semgrep@@ -97792,6 +97830,7 @@ export namespace Schemas {Bugsnag: 'bugsnag',Honeybadger: 'honeybadger',Raygun: 'raygun',+ Datadog: 'datadog',Snyk: 'snyk',Sonarqube: 'sonarqube',Semgrep: 'semgrep',@@ -97988,7 +98027,7 @@ export namespace Schemas {created_date: string | null;}- export type SignalExtra = SessionProblemSignalExtra | LlmEvalSignalExtra | LlmEvalReportSignalExtra | ZendeskTicketSignalExtra | GithubIssueSignalExtra | LinearIssueSignalExtra | JiraIssueSignalExtra | ConversationsTicketSignalExtra | ErrorTrackingSignalExtra | PgAnalyzeIssueSignalExtra | EndpointExecutionFailedSignalExtra | EndpointBreakdownLimitExceededSignalExtra | SignalsScoutSignalExtra | CheckFailedSignalExtra | LogsAlertStateChangeSignalExtra | ReplayVisionScannerFindingSignalExtra | AnalyticsAnomalyInvestigationSignalExtra | HealthCheckSignalExtra | EngineeringAnalyticsCIFlakyCheckSignalExtra | EngineeringAnalyticsCIBrokenDefaultBranchSignalExtra | EngineeringAnalyticsCIDurationRegressionSignalExtra | FreshdeskTicketSignalExtra | FreshserviceTicketSignalExtra | FrontConversationSignalExtra | GorgiasTicketSignalExtra | KustomerConversationSignalExtra | DixaConversationSignalExtra | PlainThreadSignalExtra | GitlabIssueSignalExtra | GiteaIssueSignalExtra | ShortcutStorySignalExtra | SentryIssueSignalExtra | RollbarItemSignalExtra | BugsnagErrorSignalExtra | HoneybadgerFaultSignalExtra | RaygunErrorGroupSignalExtra | SnykScannerFindingSignalExtra | SonarqubeScannerFindingSignalExtra | SemgrepScannerFindingSignalExtra | Rapid7InsightvmScannerFindingSignalExtra | FeaturebaseFeedbackSignalExtra | FrillFeedbackSignalExtra | AhaFeedbackSignalExtra | UservoiceFeedbackSignalExtra | ProductboardFeedbackSignalExtra | CannyFeedbackSignalExtra | AsknicelyFeedbackSignalExtra | RetentlyFeedbackSignalExtra | AppfiguresReviewSignalExtra | AppfollowReviewSignalExtra | JudgemeReviewsReviewSignalExtra | IntercomTicketSignalExtra | HubspotTicketSignalExtra | GoogleSearchConsoleSearchOpportunitySignalExtra;+ export type SignalExtra = SessionProblemSignalExtra | LlmEvalSignalExtra | LlmEvalReportSignalExtra | ZendeskTicketSignalExtra | GithubIssueSignalExtra | LinearIssueSignalExtra | JiraIssueSignalExtra | ConversationsTicketSignalExtra | ErrorTrackingSignalExtra | PgAnalyzeIssueSignalExtra | EndpointExecutionFailedSignalExtra | EndpointBreakdownLimitExceededSignalExtra | SignalsScoutSignalExtra | CheckFailedSignalExtra | LogsAlertStateChangeSignalExtra | ReplayVisionScannerFindingSignalExtra | AnalyticsAnomalyInvestigationSignalExtra | HealthCheckSignalExtra | EngineeringAnalyticsCIFlakyCheckSignalExtra | EngineeringAnalyticsCIBrokenDefaultBranchSignalExtra | EngineeringAnalyticsCIDurationRegressionSignalExtra | FreshdeskTicketSignalExtra | FreshserviceTicketSignalExtra | FrontConversationSignalExtra | GorgiasTicketSignalExtra | KustomerConversationSignalExtra | DixaConversationSignalExtra | PlainThreadSignalExtra | GitlabIssueSignalExtra | GiteaIssueSignalExtra | ShortcutStorySignalExtra | SentryIssueSignalExtra | RollbarItemSignalExtra | BugsnagErrorSignalExtra | HoneybadgerFaultSignalExtra | RaygunErrorGroupSignalExtra | DatadogSignalExtra | SnykScannerFindingSignalExtra | SonarqubeScannerFindingSignalExtra | SemgrepScannerFindingSignalExtra | Rapid7InsightvmScannerFindingSignalExtra | FeaturebaseFeedbackSignalExtra | FrillFeedbackSignalExtra | AhaFeedbackSignalExtra | UservoiceFeedbackSignalExtra | ProductboardFeedbackSignalExtra | CannyFeedbackSignalExtra | AsknicelyFeedbackSignalExtra | RetentlyFeedbackSignalExtra | AppfiguresReviewSignalExtra | AppfollowReviewSignalExtra | JudgemeReviewsReviewSignalExtra | IntercomTicketSignalExtra | HubspotTicketSignalExtra | GoogleSearchConsoleSearchOpportunitySignalExtra;export type SignalMatchMetadata = MatchedMetadata | NoMatchMetadata;@@ -98037,6 +98076,7 @@ export namespace Schemas {* * `bugsnag` - bugsnag* * `honeybadger` - honeybadger* * `raygun` - raygun+ * * `datadog` - datadog* * `snyk` - snyk* * `sonarqube` - sonarqube* * `semgrep` - semgrepdiff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 86f059f0d11a..686fd86c5d18 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -4008,6 +4008,7 @@ export const SignalsSourceConfigsCreateBody = () => zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -4029,7 +4030,7 @@ export const SignalsSourceConfigsCreateBody = () => zod.object({'google_search_console',]).describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([@@ -4118,6 +4119,7 @@ export const SignalsSourceConfigsUpdateBody = () => zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -4139,7 +4141,7 @@ export const SignalsSourceConfigsUpdateBody = () => zod.object({'google_search_console',]).describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([@@ -4219,6 +4221,7 @@ export const SignalsSourceConfigsPartialUpdateBody = () => zod.object({'bugsnag','honeybadger','raygun',+ 'datadog','snyk','sonarqube','semgrep',@@ -4241,7 +4244,7 @@ export const SignalsSourceConfigsPartialUpdateBody = () => zod.object({]).optional().describe(- '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `datadog` - Datadog\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'),source_type: zod.enum([diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.jsonindex 887fa4c7064e..8cc780b2528e 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json@@ -13,7 +13,7 @@"type": "boolean"},"source_product": {- "description": "* `session_replay` - Session replay\n* `llm_analytics` - LLM analytics\n* `github` - GitHub\n* `linear` - Linear\n* `jira` - Jira\n* `zendesk` - Zendesk\n* `conversations` - Conversations\n* `error_tracking` - Error tracking\n* `pganalyze` - pganalyze\n* `signals_scout` - Signals scout\n* `signals_check` - Report check\n* `logs` - Logs\n* `health_checks` - Health checks\n* `endpoints` - Endpoints\n* `replay_vision` - Replay Vision\n* `analytics` - Product analytics\n* `freshdesk` - Freshdesk\n* `freshservice` - Freshservice\n* `front` - Front\n* `gorgias` - Gorgias\n* `kustomer` - Kustomer\n* `dixa` - Dixa\n* `plain` - Plain\n* `gitlab` - GitLab\n* `gitea` - Gitea\n* `shortcut` - Shortcut\n* `sentry` - Sentry\n* `rollbar` - Rollbar\n* `bugsnag` - Bugsnag\n* `honeybadger` - Honeybadger\n* `raygun` - Raygun\n* `snyk` - Snyk\n* `sonarqube` - SonarQube\n* `semgrep` - Semgrep\n* `rapid7_insightvm` - Rapid7 InsightVM\n* `featurebase` - Featurebase\n* `frill` - Frill\n* `aha` - Aha\n* `uservoice` - UserVoice\n* `productboard` - Productboard\n* `canny` - Canny\n* `asknicely` - AskNicely\n* `retently` - Retently\n* `appfigures` - Appfigures\n* `appfollow` - AppFollow\n* `judgeme_reviews` - Judge.me\n* `intercom` - Intercom\n* `hubspot` - HubSpot\n* `engineering_analytics` - Engineering analytics\n* `google_search_console` - Google Search Console",+ "description": "* `session_replay` - Session replay\n* `llm_analytics` - LLM analytics\n* `github` - GitHub\n* `linear` - Linear\n* `jira` - Jira\n* `zendesk` - Zendesk\n* `conversations` - Conversations\n* `error_tracking` - Error tracking\n* `pganalyze` - pganalyze\n* `signals_scout` - Signals scout\n* `signals_check` - Report check\n* `logs` - Logs\n* `health_checks` - Health checks\n* `endpoints` - Endpoints\n* `replay_vision` - Replay Vision\n* `analytics` - Product analytics\n* `freshdesk` - Freshdesk\n* `freshservice` - Freshservice\n* `front` - Front\n* `gorgias` - Gorgias\n* `kustomer` - Kustomer\n* `dixa` - Dixa\n* `plain` - Plain\n* `gitlab` - GitLab\n* `gitea` - Gitea\n* `shortcut` - Shortcut\n* `sentry` - Sentry\n* `rollbar` - Rollbar\n* `bugsnag` - Bugsnag\n* `honeybadger` - Honeybadger\n* `raygun` - Raygun\n* `datadog` - Datadog\n* `snyk` - Snyk\n* `sonarqube` - SonarQube\n* `semgrep` - Semgrep\n* `rapid7_insightvm` - Rapid7 InsightVM\n* `featurebase` - Featurebase\n* `frill` - Frill\n* `aha` - Aha\n* `uservoice` - UserVoice\n* `productboard` - Productboard\n* `canny` - Canny\n* `asknicely` - AskNicely\n* `retently` - Retently\n* `appfigures` - Appfigures\n* `appfollow` - AppFollow\n* `judgeme_reviews` - Judge.me\n* `intercom` - Intercom\n* `hubspot` - HubSpot\n* `engineering_analytics` - Engineering analytics\n* `google_search_console` - Google Search Console","enum": ["session_replay","llm_analytics",@@ -46,6 +46,7 @@"bugsnag","honeybadger","raygun",+ "datadog","snyk","sonarqube","semgrep",diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.jsonindex 22d349c83e6e..76517048c0cc 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json@@ -17,7 +17,7 @@"type": "string"},"source_product": {- "description": "* `session_replay` - Session replay\n* `llm_analytics` - LLM analytics\n* `github` - GitHub\n* `linear` - Linear\n* `jira` - Jira\n* `zendesk` - Zendesk\n* `conversations` - Conversations\n* `error_tracking` - Error tracking\n* `pganalyze` - pganalyze\n* `signals_scout` - Signals scout\n* `signals_check` - Report check\n* `logs` - Logs\n* `health_checks` - Health checks\n* `endpoints` - Endpoints\n* `replay_vision` - Replay Vision\n* `analytics` - Product analytics\n* `freshdesk` - Freshdesk\n* `freshservice` - Freshservice\n* `front` - Front\n* `gorgias` - Gorgias\n* `kustomer` - Kustomer\n* `dixa` - Dixa\n* `plain` - Plain\n* `gitlab` - GitLab\n* `gitea` - Gitea\n* `shortcut` - Shortcut\n* `sentry` - Sentry\n* `rollbar` - Rollbar\n* `bugsnag` - Bugsnag\n* `honeybadger` - Honeybadger\n* `raygun` - Raygun\n* `snyk` - Snyk\n* `sonarqube` - SonarQube\n* `semgrep` - Semgrep\n* `rapid7_insightvm` - Rapid7 InsightVM\n* `featurebase` - Featurebase\n* `frill` - Frill\n* `aha` - Aha\n* `uservoice` - UserVoice\n* `productboard` - Productboard\n* `canny` - Canny\n* `asknicely` - AskNicely\n* `retently` - Retently\n* `appfigures` - Appfigures\n* `appfollow` - AppFollow\n* `judgeme_reviews` - Judge.me\n* `intercom` - Intercom\n* `hubspot` - HubSpot\n* `engineering_analytics` - Engineering analytics\n* `google_search_console` - Google Search Console",+ "description": "* `session_replay` - Session replay\n* `llm_analytics` - LLM analytics\n* `github` - GitHub\n* `linear` - Linear\n* `jira` - Jira\n* `zendesk` - Zendesk\n* `conversations` - Conversations\n* `error_tracking` - Error tracking\n* `pganalyze` - pganalyze\n* `signals_scout` - Signals scout\n* `signals_check` - Report check\n* `logs` - Logs\n* `health_checks` - Health checks\n* `endpoints` - Endpoints\n* `replay_vision` - Replay Vision\n* `analytics` - Product analytics\n* `freshdesk` - Freshdesk\n* `freshservice` - Freshservice\n* `front` - Front\n* `gorgias` - Gorgias\n* `kustomer` - Kustomer\n* `dixa` - Dixa\n* `plain` - Plain\n* `gitlab` - GitLab\n* `gitea` - Gitea\n* `shortcut` - Shortcut\n* `sentry` - Sentry\n* `rollbar` - Rollbar\n* `bugsnag` - Bugsnag\n* `honeybadger` - Honeybadger\n* `raygun` - Raygun\n* `datadog` - Datadog\n* `snyk` - Snyk\n* `sonarqube` - SonarQube\n* `semgrep` - Semgrep\n* `rapid7_insightvm` - Rapid7 InsightVM\n* `featurebase` - Featurebase\n* `frill` - Frill\n* `aha` - Aha\n* `uservoice` - UserVoice\n* `productboard` - Productboard\n* `canny` - Canny\n* `asknicely` - AskNicely\n* `retently` - Retently\n* `appfigures` - Appfigures\n* `appfollow` - AppFollow\n* `judgeme_reviews` - Judge.me\n* `intercom` - Intercom\n* `hubspot` - HubSpot\n* `engineering_analytics` - Engineering analytics\n* `google_search_console` - Google Search Console","enum": ["session_replay","llm_analytics",@@ -50,6 +50,7 @@"bugsnag","honeybadger","raygun",+ "datadog","snyk","sonarqube","semgrep",diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.jsonindex f68a90d04c5a..8b1388d83672 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json@@ -17,7 +17,7 @@"type": "string"},"source_product": {- "description": "* `session_replay` - Session replay\n* `llm_analytics` - LLM analytics\n* `github` - GitHub\n* `linear` - Linear\n* `jira` - Jira\n* `zendesk` - Zendesk\n* `conversations` - Conversations\n* `error_tracking` - Error tracking\n* `pganalyze` - pganalyze\n* `signals_scout` - Signals scout\n* `signals_check` - Report check\n* `logs` - Logs\n* `health_checks` - Health checks\n* `endpoints` - Endpoints\n* `replay_vision` - Replay Vision\n* `analytics` - Product analytics\n* `freshdesk` - Freshdesk\n* `freshservice` - Freshservice\n* `front` - Front\n* `gorgias` - Gorgias\n* `kustomer` - Kustomer\n* `dixa` - Dixa\n* `plain` - Plain\n* `gitlab` - GitLab\n* `gitea` - Gitea\n* `shortcut` - Shortcut\n* `sentry` - Sentry\n* `rollbar` - Rollbar\n* `bugsnag` - Bugsnag\n* `honeybadger` - Honeybadger\n* `raygun` - Raygun\n* `snyk` - Snyk\n* `sonarqube` - SonarQube\n* `semgrep` - Semgrep\n* `rapid7_insightvm` - Rapid7 InsightVM\n* `featurebase` - Featurebase\n* `frill` - Frill\n* `aha` - Aha\n* `uservoice` - UserVoice\n* `productboard` - Productboard\n* `canny` - Canny\n* `asknicely` - AskNicely\n* `retently` - Retently\n* `appfigures` - Appfigures\n* `appfollow` - AppFollow\n* `judgeme_reviews` - Judge.me\n* `intercom` - Intercom\n* `hubspot` - HubSpot\n* `engineering_analytics` - Engineering analytics\n* `google_search_console` - Google Search Console",+ "description": "* `session_replay` - Session replay\n* `llm_analytics` - LLM analytics\n* `github` - GitHub\n* `linear` - Linear\n* `jira` - Jira\n* `zendesk` - Zendesk\n* `conversations` - Conversations\n* `error_tracking` - Error tracking\n* `pganalyze` - pganalyze\n* `signals_scout` - Signals scout\n* `signals_check` - Report check\n* `logs` - Logs\n* `health_checks` - Health checks\n* `endpoints` - Endpoints\n* `replay_vision` - Replay Vision\n* `analytics` - Product analytics\n* `freshdesk` - Freshdesk\n* `freshservice` - Freshservice\n* `front` - Front\n* `gorgias` - Gorgias\n* `kustomer` - Kustomer\n* `dixa` - Dixa\n* `plain` - Plain\n* `gitlab` - GitLab\n* `gitea` - Gitea\n* `shortcut` - Shortcut\n* `sentry` - Sentry\n* `rollbar` - Rollbar\n* `bugsnag` - Bugsnag\n* `honeybadger` - Honeybadger\n* `raygun` - Raygun\n* `datadog` - Datadog\n* `snyk` - Snyk\n* `sonarqube` - SonarQube\n* `semgrep` - Semgrep\n* `rapid7_insightvm` - Rapid7 InsightVM\n* `featurebase` - Featurebase\n* `frill` - Frill\n* `aha` - Aha\n* `uservoice` - UserVoice\n* `productboard` - Productboard\n* `canny` - Canny\n* `asknicely` - AskNicely\n* `retently` - Retently\n* `appfigures` - Appfigures\n* `appfollow` - AppFollow\n* `judgeme_reviews` - Judge.me\n* `intercom` - Intercom\n* `hubspot` - HubSpot\n* `engineering_analytics` - Engineering analytics\n* `google_search_console` - Google Search Console","enum": ["session_replay","llm_analytics",@@ -50,6 +50,7 @@"bugsnag","honeybadger","raygun",+ "datadog","snyk","sonarqube","semgrep",