/*
 * Per-tier retention (in days) for downsampled metric storage.
 *
 * On Project, this is the default that applies to all services.
 * On Service, this is an optional override — null fields inherit from the project default.
 *
 * Keys are tier identifiers: "raw" (untouched OTel data points), "1m", "5m", "1h", "1d".
 */
export const DEFAULT_METRIC_DOWNSAMPLING_RETENTION_DAYS = {
    raw: 7,
    "1m": 14,
    "5m": 30,
    "1h": 90,
    "1d": 365,
};
export const DEFAULT_METRIC_CARDINALITY_BUDGET = 10000;
/*
 * Resolves the effective retention days for a given tier, falling back through
 * service override → project default → hardcoded default.
 */
export function resolveTierRetentionDays(tier, serviceOverride, projectDefault) {
    const serviceValue = serviceOverride === null || serviceOverride === void 0 ? void 0 : serviceOverride[tier];
    if (typeof serviceValue === "number" && serviceValue > 0) {
        return serviceValue;
    }
    const projectValue = projectDefault === null || projectDefault === void 0 ? void 0 : projectDefault[tier];
    if (typeof projectValue === "number" && projectValue > 0) {
        return projectValue;
    }
    return DEFAULT_METRIC_DOWNSAMPLING_RETENTION_DAYS[tier];
}
//# sourceMappingURL=MetricDownsamplingRetentionDays.js.map