Skip to content

: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.

2.6 KB
Raw Blame
//! Metric-name constants for the cohort evaluation surface.
//!
//! These counters are emitted by `cohort-core` itself, from any process that links it (both the
//! stream processor and the backfill seeder do). A dashboard cannot assume a single emitter: scope
//! every query by the job/service label to attribute a series to the process that produced it.

/// Leaves dropped during parse, labelled by `reason` (counter).
pub const FILTER_CATALOG_SKIPPED_LEAVES: &str = "filter_catalog_skipped_leaves_total";
/// Cohorts skipped because their filter tree failed to parse (counter).
pub const FILTER_CATALOG_COHORT_PARSE_ERRORS: &str = "filter_catalog_cohort_parse_errors_total";
/// Teams whose timezone did not parse as an IANA zone and fell back to UTC (counter).
pub const FILTER_CATALOG_TZ_FALLBACK: &str = "filter_catalog_tz_fallback_total";
/// Cohorts whose persisted shape hash failed to parse, labelled by the `kind` whose column it was
/// — `behavioral_filters_shape_hash` or `person_filters_shape_hash` (counter). The cohort loads but
/// reads as `HashUnknown` for that kind, so every reconcile of that kind discards — **alert on a
/// sustained non-zero level**, it signals drift between that kind's Python hash extractor and the
/// Rust bounds. The two extractors are independent, so alert per `kind` rather than on the sum.
pub const FILTER_CATALOG_INVALID_SHAPE_HASH: &str = "filter_catalog_invalid_shape_hash_total";
/// Behavioral conditions analyzed at freeze, labelled by `outcome`: `reads` when the read set
/// narrowed, `missing_bytecode` when the condition kept no program to analyze, otherwise the
/// `FullColumnsReason` that widened it (counter). A catalog whose conditions mostly widen saves
/// nothing, so watch the `reads` share rather than the absolute rate.
pub const FILTER_CATALOG_CONDITION_PROJECTION: &str = "filter_catalog_condition_projection_total";
/// Cohorts classified by composition eligibility at freeze, labelled by `class` (counter).
pub const COHORT_ELIGIBILITY_TOTAL: &str = "cohort_eligibility_total";
/// Cohorts excluded because they sit in a cohort-reference cycle (counter).
pub const COHORT_IN_CYCLE_TOTAL: &str = "cohort_in_cycle_total";
/// Cohort bytecode invoked a symbol with no registered native (counter).
pub const STAGE1_HOGVM_UNKNOWN_FUNCTION: &str = "stage1_hogvm_unknown_function_total";
/// Other VM/program failures during cohort evaluation, labelled by bounded `reason` values.
pub const STAGE1_HOGVM_ERROR: &str = "stage1_hogvm_error_total";
/// `properties`/`person_properties` JSON parse failures, labelled by `field` (counter).
pub const STAGE1_GLOBALS_PARSE_ERROR: &str = "stage1_globals_parse_error_total";