observability capa

observability-analytics

First-party web analytics — events, cookieless visitor identity, rollups, queries

First-party web analytics — events, cookieless visitor identity, rollups, queries

Tierobservability
Roleunclassified (baselined)
Pathcrates/observability/analytics
Edition2021
Targetsobservability_analytics
Public items116 across 16 modules
Tests108

What it is for

First-party web analytics — the reusable engine behind self-hosted website analytics: an event model, cookieless visitor identity, rollups, and queries. No third-party trackers, no cookies.

Capabilities

disclosure::probe (other)

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
fn grade_topology(hand : & & Run, driver : & Run) -> Verdict
fn grade_trust(driver : & Run) -> Verdict
fn grade_activation(hand : & & Run, driver : & Run) -> Verdict
fn check_calibration(calibration : & Run, expectations : & (Context, & str, Expectation),) -> Result <(), Refusal>
fn check_cohort(runs : & Run) -> Result <Vec <& Run>, Refusal>
fn grade(hand : & & Run, driver : & Run, min_hand : usize) -> BTreeMap <String, Verdict>

CanaryObservation

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub struct CanaryObservation

CanaryOutcome

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub enum CanaryOutcome

Context

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub enum Context

Driver

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub enum Driver
Driver :: fn as_str(self) -> & 'static str

Expectation

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub enum Expectation
fn parse_expectations(tsv : & str) -> Result <Vec <ExpectationRow>, String>
fn expectations_for <'a>(rows : & 'a ExpectationRow, canary_set_version : u32, browser_build : & str,) -> Vec <(Context, & 'a str, Expectation)>

ExpectationRow

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub struct ExpectationRow

ProbeEvent

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub struct ProbeEvent
fn topology(events : & ProbeEvent) -> Vec <String>

Quantiles

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub struct Quantiles
fn timing_quantiles(runs : & & Run) -> BTreeMap <String, Quantiles>

Refusal

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub enum Refusal

Run

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub const DEFAULT_MIN_HAND_RUNS: usize
pub struct Run
fn typed_the_script(run : & Run) -> bool
fn pasted(run : & Run) -> bool
fn hand_kinds(hand : & & Run) -> BTreeSet <String>

Verdict

The probe battery's pure half: observations in, verdicts out (sprint 4.55).

Item
pub const VERDICT_POLICY_VERSION: u32
pub enum Verdict

disclosure::retention (other)

Retention for disclosure-lab observations.

Item
pub const ABSOLUTE_GRACE_MINUTES: i64

LabRetention

Retention for disclosure-lab observations.

Item
pub enum LabRetention
LabRetention :: fn is_ingest_gated(self) -> bool
LabRetention :: fn mapping(self) -> RetentionMapping
LabRetention :: fn deadlines(self, received_at : DateTime <Utc>) -> Option <RetentionDeadlines>

RetentionDeadlines

Retention for disclosure-lab observations.

Item
pub struct RetentionDeadlines

RetentionMapping

Retention for disclosure-lab observations.

Item
pub enum RetentionMapping

disclosure::server_identity (other)

The server-identity lever: a per-audience choice of what the Server

Item
fn transition(from : & AudienceClass, to : & AudienceClass) -> Option <ClassTransition>

AudienceAttributes

The server-identity lever: a per-audience choice of what the Server

Item
pub struct AudienceAttributes

AudienceClass

The server-identity lever: a per-audience choice of what the Server

Item
pub enum AudienceClass

AudienceRule

The server-identity lever: a per-audience choice of what the Server

Item
pub struct AudienceRule

ClassTransition

The server-identity lever: a per-audience choice of what the Server

Item
pub struct ClassTransition

ContainmentAttestation

The server-identity lever: a per-audience choice of what the Server

Item
pub struct ContainmentAttestation
ContainmentAttestation :: fn is_complete(& self) -> bool

LeverConfig

The server-identity lever: a per-audience choice of what the Server

Item
pub struct LeverConfig
LeverConfig :: fn classify(& self, attrs : & AudienceAttributes) -> AudienceClass
LeverConfig :: fn select(& self, attrs : & AudienceAttributes) -> Selection

ProvenanceInput

The server-identity lever: a per-audience choice of what the Server

Item
pub struct ProvenanceInput
ProvenanceInput :: fn new(path : impl Into <String>, stable_token : impl Into <String>) -> Self
fn provenance_tag(key : & str, epoch : & str, input : & ProvenanceInput) -> String

Selection

The server-identity lever: a per-audience choice of what the Server

Item
pub struct Selection

SelectionReason

The server-identity lever: a per-audience choice of what the Server

Item
pub enum SelectionReason

ServerIdentityMode

The server-identity lever: a per-audience choice of what the Server

Item
pub enum ServerIdentityMode
ServerIdentityMode :: fn is_cacheable(self) -> bool
ServerIdentityMode :: fn requires_containment(self) -> bool

ProbeSettings

Per-probe settings for the disclosure lab.

Item
pub struct ProbeSettings

disclosure::subject (other)

Subject pseudonymisation for disclosure-lab observations.

Item
fn probe_subject_hash(key : & str, epoch : & str, attributes : & str) -> String

identity (other)

Cookieless visitor identity and request classification.

Item
fn phoenix_today() -> NaiveDate
fn phoenix_date_of(utc : DateTime <Utc>) -> NaiveDate
fn visitor_day_hash(salt : & str, date : NaiveDate, ip : & str, user_agent : & str) -> String
fn classify_source(referrer_host : Option <& str>, utm_source : Option <& str>) -> Source
fn classify_device(viewport_w : Option <i32>) -> DeviceClass

AnalyticsEvent

The first-party pageview event model.

Item
pub struct AnalyticsEvent

DeviceClass

The first-party pageview event model.

Item
pub enum DeviceClass
DeviceClass :: fn as_str(& self) -> & 'static str
DeviceClass :: fn from_str_lossy(s : & str) -> Self
DeviceClass :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

EngagementUpdate

The first-party pageview event model.

Item
pub struct EngagementUpdate

Source

The first-party pageview event model.

Item
pub enum Source
Source :: fn as_str(& self) -> & 'static str
Source :: fn from_str_lossy(s : & str) -> Self
Source :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

ConversionRow

Report result types and date-range helpers for analytics queries.

Item
pub struct ConversionRow

DateRange

Report result types and date-range helpers for analytics queries.

Item
pub struct DateRange
DateRange :: fn last_n_days(n : i64, today : NaiveDate) -> Self
DateRange :: fn days(& self) -> i64
DateRange :: fn previous_window(& self) -> Self

DeviceStat

Report result types and date-range helpers for analytics queries.

Item
pub struct DeviceStat

EventFilter

Report result types and date-range helpers for analytics queries.

Item
pub struct EventFilter
EventFilter :: fn default() -> Self
EventFilter :: fn where_fragment(& self) -> String

GeoCoverage

Report result types and date-range helpers for analytics queries.

Item
pub struct GeoCoverage
GeoCoverage :: fn in_area_rate(& self) -> f64
GeoCoverage :: fn out_of_area_rate(& self) -> f64
GeoCoverage :: fn unknown_rate(& self) -> f64

HeatCell

Report result types and date-range helpers for analytics queries.

Item
pub struct HeatCell

LocationStat

Report result types and date-range helpers for analytics queries.

Item
pub struct LocationStat

MonthRow

Report result types and date-range helpers for analytics queries.

Item
pub struct MonthRow

OutOfAreaCall

Report result types and date-range helpers for analytics queries.

Item
pub struct OutOfAreaCall

OverviewStats

Report result types and date-range helpers for analytics queries.

Item
pub struct OverviewStats
OverviewStats :: fn conversion_rate(& self) -> f64

PageConversionStat

Report result types and date-range helpers for analytics queries.

Item
pub struct PageConversionStat
PageConversionStat :: fn conversion_rate(& self) -> f64

PageStat

Report result types and date-range helpers for analytics queries.

Item
pub struct PageStat

Path404Stat

Report result types and date-range helpers for analytics queries.

Item
pub struct Path404Stat

SourceStat

Report result types and date-range helpers for analytics queries.

Item
pub struct SourceStat
SourceStat :: fn conversion_rate(& self) -> f64

TrendPoint

Report result types and date-range helpers for analytics queries.

Item
pub struct TrendPoint

VisitorEvent

Report result types and date-range helpers for analytics queries.

Item
pub struct VisitorEvent

VisitorRetention

Report result types and date-range helpers for analytics queries.

Item
pub struct VisitorRetention

VisitorStat

Report result types and date-range helpers for analytics queries.

Item
pub struct VisitorStat

query::reports::semantics (other)

Cross-report semantics for the Sprint 28 analytics-reports suite

Item
pub const DEDUP_VISITORS: & str
pub const PHOENIX_LOCAL_OCCURRED_AT: & str
pub const PHOENIX_LOCAL_DATE: & str
pub const RESOLVED_IDENTITY_USER_ID: & str
pub const RESOLVED_IDENTITY_KIND: & str
fn phoenix_offset() -> FixedOffset
fn to_local(utc : DateTime <Utc>) -> NaiveDateTime
fn normalize_path(raw : & str) -> String
fn match_branded(query : & str, terms : & String) -> bool

Period

_No module-level documentation is present in the source._

Item
pub enum Period
Period :: fn as_str(& self) -> & 'static str

Rollup

_No module-level documentation is present in the source._

Item
pub struct Rollup

RollupMetrics

_No module-level documentation is present in the source._

Item
pub struct RollupMetrics

RollupConfig

_No module-level documentation is present in the source._

Item
pub struct RollupConfig
RollupConfig :: fn default() -> Self

storage (other)

Persistence and query surface for first-party analytics.

Item
fn is_excluded_path(path : & str) -> bool

AnalyticsError

Persistence and query surface for first-party analytics.

Item
pub enum AnalyticsError

AnalyticsStore

Persistence and query surface for first-party analytics.

Item
pub trait AnalyticsStore

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

observability_analytics

flowchart TD
  n_observability_analytics["observability_analytics"]
  n_observability_analytics --> n_disclosure["disclosure"]
  n_disclosure --> n_disclosure__probe["probe"]
  n_disclosure --> n_disclosure__retention["retention"]
  n_disclosure --> n_disclosure__server_identity["server_identity"]
  n_disclosure --> n_disclosure__settings["settings"]
  n_disclosure --> n_disclosure__subject["subject"]
  n_observability_analytics --> n_identity["identity"]
  n_observability_analytics --> n_model["model"]
  n_observability_analytics --> n_query["query"]
  n_query --> n_query__reports["reports"]
  n_query__reports --> n_query__reports__semantics["semantics"]
  n_observability_analytics --> n_rollup["rollup"]
  n_rollup --> n_rollup__compute["compute"]
  n_rollup --> n_rollup__config["config"]
  n_rollup --> n_rollup__job["job"]
  n_observability_analytics --> n_storage["storage"]

Public surface

`disclosure::probe`

ItemWhat it is
pub const VERDICT_POLICY_VERSION: u32Bumped whenever a grading rule changes
pub const DEFAULT_MIN_HAND_RUNS: usizeThe ratified minimum number of hand runs before comparative grades exist.
pub enum DriverWho drove the page.
Driver :: fn as_str(self) -> & 'static str
pub struct ProbeEventOne DOM event as the probe page recorded it (AC1's enumerated schema; the per-kind details ride in detail, which grading does not read).
pub enum ContextWhere a canary ran.
pub enum CanaryOutcomeWhat a canary reported.
pub struct CanaryObservation
pub enum ExpectationWhat the expectation seed says a canary should do on a build.
pub struct RunOne run: the observable facts, nothing interpreted.
pub enum VerdictThe one thing a grade may say.
pub enum RefusalWhy a battery cannot be graded.
fn typed_the_script(run : & Run) -> boolWhether a run typed the script it was asked to
fn pasted(run : & Run) -> boolWhether a run put the text in by paste or drop rather than keys
pub struct QuantilesNearest-rank quantiles of inter-event deltas for one event kind.
fn topology(events : & ProbeEvent) -> Vec <String>The normalized topology of a run: event kinds in order, consecutive pointer moves collapsed to one, timing dropped.
fn hand_kinds(hand : & & Run) -> BTreeSet <String>The kinds the hand cohort emits in at least one run.
fn grade_topology(hand : & & Run, driver : & Run) -> VerdictTopology grade: a kind the hand emits that driver never does is missing_event_kind; a kind driver emits that no hand run does is extra_event_kind.
fn grade_trust(driver : & Run) -> VerdictTrust grade, exact per event kind: the first isTrusted: false names its seq and kind.
fn grade_activation(hand : & & Run, driver : & Run) -> VerdictActivation grade: isActive inside the click handler, compared to the hand.
fn check_calibration(calibration : & Run, expectations : & (Context, & str, Expectation),) -> Result <(), Refusal>Calibration check on the cdp-enable-on run: every canary the seed marks expected-positive for the build must have fired; an unsupported expectation is never required.
fn check_cohort(runs : & Run) -> Result <Vec <& Run>, Refusal>Cohort completeness: every required driver present, all runs on one script hash and one browser build, hand runs with DevTools open excluded
fn timing_quantiles(runs : & & Run) -> BTreeMap <String, Quantiles>Nearest-rank p10/p50/p90 per event kind, over every run given
pub struct ExpectationRowOne row of the canary expectation seed (docs/reference/disclosure-lab/ canary-expectations.tsv): what a canary should do on a build.
fn parse_expectations(tsv : & str) -> Result <Vec <ExpectationRow>, String>Parse the seed TSV: a header line, then canary_set_version<TAB>browser_build_pattern<TAB>context<TAB>canary<TAB>expectation
fn expectations_for <'a>(rows : & 'a ExpectationRow, canary_set_version : u32, browser_build : & str,) -> Vec <(Context, & 'a str, Expectation)>The expectations that apply to one run: matching version and a build pattern the run's build contains.
fn grade(hand : & & Run, driver : & Run, min_hand : usize) -> BTreeMap <String, Verdict>Grade one driver's run against the hand cohort: one verdict per signal

`disclosure::retention`

ItemWhat it is
pub const ABSOLUTE_GRACE_MINUTES: i64Grace between the deferrable window and the deadline that nothing extends
pub enum LabRetentionHow long a disclosure observation's raw payload may be kept
pub enum RetentionMappingHow a LabRetention projects onto the estate's day-granular RetentionPolicy
pub struct RetentionDeadlinesThe two deadlines a stored raw payload carries.
LabRetention :: fn is_ingest_gated(self) -> boolWhether the raw payload must never be written at all
LabRetention :: fn mapping(self) -> RetentionMappingHow this projects onto the estate's day-granular retention policy
LabRetention :: fn deadlines(self, received_at : DateTime <Utc>) -> Option <RetentionDeadlines>The deadlines a payload received at received_at carries, if it is stored under a bounded window

`disclosure::server_identity`

ItemWhat it is
pub enum ServerIdentityModeWhat the Server header discloses to a given audience.
ServerIdentityMode :: fn is_cacheable(self) -> boolWhether a response carrying this mode may be stored by a shared cache
ServerIdentityMode :: fn requires_containment(self) -> boolWhether the mode may only be enabled once containment is attested.
pub struct ContainmentAttestationEvidence that bait's containment requirements are met
ContainmentAttestation :: fn is_complete(& self) -> boolWhether every containment requirement is satisfied.
pub struct AudienceAttributesRequest attributes usable for audience dispatch
pub enum AudienceClassThe audience a request belongs to.
pub struct ClassTransitionA change of audience class for the same visitor
pub enum SelectionReasonWhy a particular mode was selected
pub struct SelectionThe outcome of resolving the lever for one request.
pub struct AudienceRuleOne audience-class → mode mapping.
pub struct LeverConfigThe lever's configuration.
pub struct ProvenanceInputProvenance identity inputs
ProvenanceInput :: fn new(path : impl Into <String>, stable_token : impl Into <String>) -> SelfBuild from a request path and a stable, non-IP-derived visitor token.
fn provenance_tag(key : & str, epoch : & str, input : & ProvenanceInput) -> StringThe deterministic, linkable identity for a provenance-mode response
fn transition(from : & AudienceClass, to : & AudienceClass) -> Option <ClassTransition>A change of audience class for the same visitor, if the class actually moved
LeverConfig :: fn classify(& self, attrs : & AudienceAttributes) -> AudienceClassWhich audience a request belongs to
LeverConfig :: fn select(& self, attrs : & AudienceAttributes) -> SelectionResolve the lever for one request

`disclosure::settings`

ItemWhat it is
pub struct ProbeSettingsEvery probe the lab can run, as an explicit on/off switch

`disclosure::subject`

ItemWhat it is
fn probe_subject_hash(key : & str, epoch : & str, attributes : & str) -> String

`identity`

ItemWhat it is
fn phoenix_today() -> NaiveDateToday's date in Phoenix local time.
fn phoenix_date_of(utc : DateTime <Utc>) -> NaiveDateThe Phoenix-local calendar date for a given UTC instant.
fn visitor_day_hash(salt : & str, date : NaiveDate, ip : & str, user_agent : & str) -> StringCookieless daily visitor identity
fn classify_source(referrer_host : Option <& str>, utm_source : Option <& str>) -> SourceClassify a pageview's traffic source
fn classify_device(viewport_w : Option <i32>) -> DeviceClassClassify device from the reported viewport width (CSS pixels): <768 mobile, 768..=1024 tablet, wider (or unknown) desktop.

`model`

ItemWhat it is
pub enum SourceClassified traffic source for a pageview.
Source :: fn as_str(& self) -> & 'static strThe canonical lowercase token, as stored in the database.
Source :: fn from_str_lossy(s : & str) -> SelfParse a stored source token; an unknown value falls back to Other rather than failing — analytics data is never critical-path.
Source :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub enum DeviceClassDevice class, derived from the reported viewport width.
DeviceClass :: fn as_str(& self) -> & 'static strThe canonical lowercase token, as stored in the database.
DeviceClass :: fn from_str_lossy(s : & str) -> SelfParse a stored device token; an unknown value falls back to Desktop.
DeviceClass :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct AnalyticsEventA single first-party pageview event — the cookieless analogue of one row in a consumer's analytics_events table.
pub struct EngagementUpdateThe unload-beacon payload — reports elapsed engagement for an event already recorded by the load beacon.

`query`

ItemWhat it is
pub struct DateRangeAn inclusive date range, in Phoenix-local calendar dates.
DateRange :: fn last_n_days(n : i64, today : NaiveDate) -> SelfThe last n days ending on today inclusive — n = 7 is a one-week window
DateRange :: fn days(& self) -> i64The number of days the range spans, inclusive.
DateRange :: fn previous_window(& self) -> SelfThe equally-long window immediately before this one — for period-over-period deltas.
pub struct OverviewStatsHeadline numbers for the Overview dashboard.
OverviewStats :: fn conversion_rate(& self) -> f64Conversions as a percentage of unique visitors (0 when there are no visitors).
pub struct PageStatOne row of the Pages report.
pub struct PageConversionStatSprint 28 (US-135) — one row of the Reports ▸ Pages report
PageConversionStat :: fn conversion_rate(& self) -> f64Conversions / unique_visitors, as a percentage
pub struct Path404StatSprint 28 (US-135) — one row of the Reports ▸ 404 Dead-ends report
pub struct GeoCoverageSprint 28 (US-136) — service-area coverage report row
GeoCoverage :: fn in_area_rate(& self) -> f64
GeoCoverage :: fn out_of_area_rate(& self) -> f64
GeoCoverage :: fn unknown_rate(& self) -> f64
pub struct OutOfAreaCallSprint 28 (US-136) — one row of the out-of-area call list
pub struct HeatCellSprint 28 (US-137) — one cell of the day-of-week × hour-of-day call heatmap
pub struct MonthRowSprint 28 (US-137) — one month row of the call+form trend
pub struct SourceStatOne row of the Sources report — the channel-comparison table.
SourceStat :: fn conversion_rate(& self) -> f64Conversions as a percentage of this source's unique visitors.
pub struct ConversionRowOne row of the Conversions report — a lead (form or call), attributed
pub struct DeviceStatSprint 27 (US-133) — one row of the device-breakdown report
pub struct TrendPointOne point on the daily trend chart.
pub struct LocationStatOne resolved visitor location — a row of the geography report and a marker on the drillable map (Sprint 22)
pub struct VisitorStatOne row of the visitor drill-in (Sprint 26, US-128)
pub struct VisitorEventOne event in a visitor's drill-in timeline (Sprint 26, US-128).
pub struct VisitorRetentionNew-vs-returning visitor counts for a date range (Sprint 22)
pub struct EventFilterSprint 25 — dashboard-side filter for analytics_events aggregation queries
EventFilter :: fn default() -> Self
EventFilter :: fn where_fragment(& self) -> StringRender the filter as a SQL fragment suitable for appending to an existing WHERE ... clause on analytics_events

`query::reports::semantics`

ItemWhat it is
pub const DEDUP_VISITORS: & strSQL expression that counts unique visitors by day
pub const PHOENIX_LOCAL_OCCURRED_AT: & strSQL expression that converts the occurred_at UTC timestamp to a Phoenix-local naive datetime
pub const PHOENIX_LOCAL_DATE: & strSQL expression giving the Phoenix-local calendar date of occurred_at
pub const RESOLVED_IDENTITY_USER_ID: & strSQL expression that resolves a visitor's user_id, preferring an explicit identity_user_links.user_id over an inferred identity_ip_links.user_id
pub const RESOLVED_IDENTITY_KIND: & strSQL expression that labels how a visitor's identity was resolved: 'user_link' when an explicit binding exists, 'ip_link' when only the probabilistic IP match exists, NULL for anonymous
fn phoenix_offset() -> FixedOffsetThe fixed offset Arizona uses year-round (UTC-7, no DST)
fn to_local(utc : DateTime <Utc>) -> NaiveDateTimeConvert a UTC instant to a Phoenix-local naive datetime
fn normalize_path(raw : & str) -> StringNormalize a URL path for joins across sources (GSC pageanalytics_events.path, redirect lookups, etc.)
fn match_branded(query : & str, terms : & String) -> boolCase-insensitive substring match of a search query against a curated list of branded terms

`rollup`

ItemWhat it is
pub enum Period
Period :: fn as_str(& self) -> & 'static str
pub struct RollupMetrics
pub struct Rollup

`rollup::config`

ItemWhat it is
pub struct RollupConfig
RollupConfig :: fn default() -> Self

`storage`

ItemWhat it is
pub enum AnalyticsErrorAn analytics storage failure
pub trait AnalyticsStoreStorage and query surface for first-party web analytics.
fn is_excluded_path(path : & str) -> boolSprint 28 (US-135) — Hybrid 404 noise filter (Round 3 Q2b consensus, ChatGPT's hybrid adopted)

Re-exports. Exported here, defined elsewhere.

ExportDefined in
PgAnalyticsStorepostgres::PgAnalyticsStore
PgAnalyticsStorestorage::PgAnalyticsStore
ProbeSettingssettings::ProbeSettings
RollupConfigconfig::RollupConfig
probe_subject_hashsubject::probe_subject_hash
{AnalyticsEvent,DeviceClass,EngagementUpdate,Source}model::{AnalyticsEvent,DeviceClass,EngagementUpdate,Source}
{ConversionRow,DateRange,DeviceStat,EventFilter,GeoCoverage,HeatCell,LocationStat,MonthRow,OutOfAreaCall,OverviewStats,PageConversionStat,PageStat,Path404Stat,SourceStat,TrendPoint,VisitorEvent,VisitorRetention,VisitorStat,}query::{ConversionRow,DateRange,DeviceStat,EventFilter,GeoCoverage,HeatCell,LocationStat,MonthRow,OutOfAreaCall,OverviewStats,PageConversionStat,PageStat,Path404Stat,SourceStat,TrendPoint,VisitorEvent,VisitorRetention,VisitorStat,}
{LabRetention,RetentionDeadlines,RetentionMapping,ABSOLUTE_GRACE_MINUTES}retention::{LabRetention,RetentionDeadlines,RetentionMapping,ABSOLUTE_GRACE_MINUTES}
{classify_device,classify_source,phoenix_date_of,phoenix_today,visitor_day_hash,}identity::{classify_device,classify_source,phoenix_date_of,phoenix_today,visitor_day_hash,}
{is_excluded_path,AnalyticsError,AnalyticsStore}storage::{is_excluded_path,AnalyticsError,AnalyticsStore}
{provenance_tag,AudienceAttributes,AudienceClass,AudienceRule,ClassTransition,ContainmentAttestation,LeverConfig,ProvenanceInput,Selection,SelectionReason,ServerIdentityMode,}server_identity::{provenance_tag,AudienceAttributes,AudienceClass,AudienceRule,ClassTransition,ContainmentAttestation,LeverConfig,ProvenanceInput,Selection,SelectionReason,ServerIdentityMode,}

Boundary

Reaches into foundation.

Shares tier observability with 1 other crate: observability-sentinel.

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)observability
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/observability/analytics
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_observability["observability"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-audit-log`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, json, jsonyesalways
thiserror^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio-test^0.4noalways

Build. None.

Depended on by. 2 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_analytics["application-analytics"] -->|uses| SELF
  n_platform_disclosure_lab["platform-disclosure-lab"] -->|uses| SELF
  SELF["observability-analytics"]
  SELF -->|runtime| n_foundation_audit_log["foundation-audit-log"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
postgresdep:sqlxno
flowchart LR
  n_postgres["postgres"] --> n_dep_sqlx["dep:sqlx"]

Targets

KindNameSource
libobservability_analytics`src/lib.rs`

Error model

Error typeNamed by
AnalyticsErrordeclared, no public signature returns it

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

2 workspace crates depend on this one: application-analytics, platform-disclosure-lab.

Verification

KindCount
Unit tests108
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
disclosure::probe26026
disclosure::retention402
disclosure::server_identity1200
disclosure::settings101
disclosure::subject101
identity504
model403
query18017
query::reports::semantics900
rollup300
rollup::config100
storage303

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc101116
Public modules with a //! block1216
pie showData
    title Public items with rustdoc
    "Documented" : 101
    "No rustdoc detected" : 15

Metrics

MetricValue
Rust source files18
Source lines4966
Code lines3588
Public API items116
Public modules16
Tests108
Examples0
Cargo features1
Direct runtime dependencies8
Workspace reverse dependencies2
pie showData
    title Public API by kind
    "constant" : 8
    "enum" : 15
    "function" : 26
    "method" : 29
    "struct" : 37
    "trait" : 1
pie showData
    title Rust source composition
    "Code" : 3588
    "Blank or comment" : 1378

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las observability · Manual