Expand description
Anonymous, opt-out product analytics for mesh-llm.
§What this is
A narrow PostHog reporter for questions we cannot answer any other way:
which platforms mesh-llm runs on, which commands people actually use,
whether serve sessions survive, and how big real meshes get.
§What it is not
It is not the [telemetry] config section. That one is operator-facing
OTLP: the operator points it at their own collector and nothing leaves
their network. This crate is the only code in mesh-llm that reports to a
vendor, and it is deliberately kept in one reviewable place.
§Design constraints
- Closed vocabulary.
EventandPropertiesadmit no free-formString. Text only enters throughLabel::sanitize, whose grammar rejects paths, prose, and anything over-long. A prompt cannot reach the wire through this API even by mistake. - No key, no reporting. The project key is compiled in by the release pipeline. Source and development builds have none and are inert.
- Never load-bearing. Capture is non-blocking, delivery is best effort, and no failure here changes a command’s behavior or exit code.
- Anonymous by construction. The identifier is a random UUID with no derivation from the machine, and it is not the published mesh identity.
Structs§
- Consent
Inputs - Inputs to the consent decision, gathered from the environment.
- Install
Id - An install identifier, and whether this process created it.
- Label
- A grammar-checked string property.
- Pending
Version - A read transition that has not been written back yet.
- Properties
- Properties attached to one event.
- Status
- How
initresolved, formesh-llm analytics status.
Enums§
- Build
Channel - How this binary was built.
- Config
Preference - What the config file says about analytics.
- Disposition
- Why analytics is on or off.
- Event
- The closed set of events mesh-llm reports.
- Value
- A single property value. Deliberately not
From<String>. - Version
Transition - What changed about the build version since the last run.
Constants§
- DEFAULT_
POSTHOG_ HOST - Default ingestion host. PostHog US cloud.
- ENV_
ANALYTICS - Environment override for the analytics opt-out.
- ENV_
DO_ NOT_ TRACK - The cross-vendor opt-out convention (https://consoledonottrack.com).
- ENV_
INTERNAL_ HELPER - Environment variable marking a process mesh-llm spawned as an internal helper rather than something a person ran.
- ENV_
POSTHOG_ HOST - Runtime override for the ingestion host, for self-hosted PostHog.
- ENV_
POSTHOG_ KEY - Runtime override for the ingestion project key.
- ENV_
SELF_ UPDATE_ MARKER - Environment variable the self-updater sets on the binary it
execs. - INSTALL_
ID_ FILE - File name inside the mesh-llm state directory.
- LIB_
NAME - Library name reported to PostHog, so events from the node are separable from anything the website or console might send later.
- NOTICE
- The disclosure text shown once per install.
- NOTICE_
MARKER_ FILE - Marker recording that the disclosure has been shown.
- VERSION_
FILE - File name inside the mesh-llm state directory.
Functions§
- base_
properties - Build the base property set for this process.
- bucket_
count - Bucket a count so a precise fingerprint never leaves the machine.
- bucket_
duration_ secs - Bucket a duration in seconds into coarse session lengths.
- bucket_
gigabytes - Bucket a byte size into human power-of-two ranges.
- capture
- Queue one event. Never blocks; drops the event if the queue is full.
- exec_
env - How this process was started, as a fixed string.
- ingestion_
host - The ingestion host, preferring the runtime override.
- init
- Initialize analytics for this process.
- load
- Read the install identifier without creating one.
- load_
or_ create - Load the install identifier from
dir, generating it on first use. - project_
key - The ingestion project key, preferring the runtime override.
- shutdown
- Deliver queued events, giving up after [
SHUTDOWN_BUDGET]. - state_
dir - The default state directory,
~/.mesh-llm.