Skip to main content

exd telemetry contexts

Context-attribute presence and value distribution for a flag.

Synopsis

exd telemetry contexts --flag <key>
[--namespace <slug>] [--environment <env>]
[--since <duration> | --from <ts> --to <ts>]
[--source <uri>]...
[--format human|json]
[--limit <n>]
[--fail-on-error]

See common flags for shared options.

Description

For each attribute the flag's predicates touch, reports:

  • Presence rate — fraction of records where the attribute was set.
  • Top-N values — most-common observed values (subject to truncation rules in the capabilities manifest; private attributes never appear here).
  • Missing-value count — records where the attribute was absent.

Useful for spotting "we declared a predicate on user.tier but the SDK never sends it" — the predicate's atoms silently evaluate to "not matched" and the rule never fires.

Use cases

  • Diagnose a never-firing rule. rules reports T005; contexts reveals which input attribute is missing:

    exd telemetry contexts --flag onboarding-banner --since 7d
  • Pre-deploy SDK readiness check. Before adding a new predicate on user.subscription_tier, confirm the SDK already populates it:

    exd telemetry contexts --flag onboarding-banner --since 24h
  • Find typos. A predicate on user.contry (typo for country) is is_not_set 100% of the time — clear signal of a name mismatch.

  • Audit value cardinality. Top-N distinct values for user.country should be a short list of country codes; thousands of distinct values is a sign of malformed input.

Subcommand-specific flags

FlagRequiredNotes
--flag <key>yesThe flag whose context attributes to analyze.

Result fields (--format json)

result.attributes is an array:

FieldTypeNotes
namestringDotted attribute name.
presence_ratefloat0.01.0.
present_countintegerRecords where the attribute was set.
missing_countintegerRecords where the attribute was absent.
top_valuesarray[{value, count}], truncated.
top_values_truncated_atinteger or nullThe cardinality cap applied.

Diagnostics

  • T006 context attribute always missing (presence_rate == 0.0 for an attribute referenced by the flag's predicates)

Example

$ exd telemetry contexts --flag onboarding-banner --since 7d
Context attributes for 'onboarding-banner' (last 7d, n=1,388,210)

attribute presence_rate top values (count, %)
user.id 100.0% (high cardinality — 1.3M distinct)
user.country 99.4% US (834,210, 60.1%) DE (152,001, 11.0%) FR (94,332, 6.8%) ...
user.tier 87.2% free (901,221, 64.9%) pro (188,442, 13.6%) enterprise (21,300, 1.5%)
user.subscription 0.0% ← T006

T006 warning: 'user.subscription' is referenced by rule[2] but never populated.
Either the SDK isn't sending the attribute, or the predicate name is wrong.

Exit codes

See telemetry exit codes.

See also

  • rules — per-rule fire counts; contexts is the natural drill-down for T005.
  • exd schema — the declared attribute shape (what the flag expects).
  • T006.