/** * Read-only access to the per-pattern series the engine's Datadog metric * output publishes (`pipelines/run/output/metric/datadog/config.yaml`). * * Names. The output posts each counter as Datadog distribution points named * `log10x._`: `log10x.emitted_events_summaryVolume` * (lines that left the Receiver, any route except drop) and * `log10x.emitted_events_summaryBytes`, plus the `log10x.all_events_*` pair. * Datadog merges the points every node sends for a tag set, so * `sum:{...}.as_count()` is the fleet's exact total; count series with * no host tag would keep one point per second and lose the rest. * * Tags. The output's `tagFields` are message_pattern, tenx_hash, * tenx_user_service, severity_level, routeState, k8s_container and * k8s_namespace; tenx_env and tenx_app ride as runtime attributes. Datadog * normalizes metric tag keys to lowercase * (docs.datadoghq.com/getting_started/tagging/), so routeState is queried as * `routestate`. The team label (`tenx_team`) appears once the k8s team label * ships; callers include it only when the series carry it. * * The generic DatadogBackend in metrics-backend.ts answers PromQL and reads a * fixed recent window; the weekly report needs explicit from/to and the same * query text the monitors use, so it reads Datadog's query API directly. * Every request here is a GET. */ export declare const DD_VOLUME_METRIC = "log10x.emitted_events_summaryVolume"; export declare const DD_BYTES_METRIC = "log10x.emitted_events_summaryBytes"; export declare const DD_TAGS: { readonly pattern: "message_pattern"; readonly hash: "tenx_hash"; readonly service: "tenx_user_service"; readonly severity: "severity_level"; readonly route: "routestate"; readonly container: "k8s_container"; readonly namespace: "k8s_namespace"; readonly env: "tenx_env"; readonly team: "tenx_team"; }; /** * Route values whose lines left the Standard index. The emitted series never * carries `drop` (its aggregator filters dropped lines out), and `sample` and * `compact` lines still reach Standard. */ export declare const HELD_ROUTES: ReadonlySet; /** An API and application key pair, or a personal access token sent as a Bearer token. */ export type DatadogMetricsCreds = { site: string; apiKey: string; appKey: string; pat?: undefined; } | { site: string; pat: string; apiKey?: undefined; appKey?: undefined; }; /** * Credentials from the environment, read the way the Datadog logs connector * reads them (DD_* first, DATADOG_* as fallback): DD_PAT when set, else the * DD_API_KEY and DD_APP_KEY pair. Undefined when neither is complete. The * site defaults to US1, as the connector's SDK does. */ export declare function datadogMetricsCredsFromEnv(siteOverride?: string): DatadogMetricsCreds | undefined; export declare function datadogApiBase(site: string): string; export interface DdSeries { tags: Record; /** Sum of the non-null points: the total over the window for an `.as_count()` query. */ total: number; /** Earliest non-zero point, unix seconds; null when every point is zero. */ firstNonZeroSec: number | null; } /** * Run one Datadog metrics query over [fromSec, toSec] (GET /api/v1/query) * and return one row per group with the window total. */ export declare function ddQueryWindow(creds: DatadogMetricsCreds, query: string, fromSec: number, toSec: number, timeoutMs?: number): Promise; /** * Tag keys present on a metric (GET /api/v2/metrics/{name}/all-tags). * Used to include the team tag only once the series carry it. */ export declare function ddMetricTagKeys(creds: DatadogMetricsCreds, metric: string, timeoutMs?: number): Promise>; /** Datadog scope from tag filters; `*` when empty. */ export declare function ddScope(filters: Array): string; export interface DdPointSeries { tags: Record; /** [unix seconds, value], null points left out. */ points: Array<[number, number]>; } /** * Run one Datadog metrics query over [fromSec, toSec] (GET /api/v1/query) * and return each group's points. */ export declare function ddQueryPoints(creds: DatadogMetricsCreds, query: string, fromSec: number, toSec: number, timeoutMs?: number): Promise;