LLM MeasurementGitHub
Guides

How do I see LLM usage per user without a metric label for every user?

Keep user IDs out of your metric labels.

Configure keyed rankings

With the v0.7.4 collector, map a user attribute and enable token-weighted rankings:

connectors:
  genaisketch:
    fields:
      user_key:
        from_attributes: [enduser.id, user.id]
        canonicalization: text_v1
        domain: user:v1
    topk: 20
    topk_keys:
      - field: user_key
        weight: tokens

Add this fragment to a complete configuration with a private random hashing key of at least 32 bytes and a trace pipeline. Supply the key through GENAI_SKETCH_SECRET; published example keys are rejected. Keep one key for compatible summary history and keep user IDs out of slices. Distinct counts become metrics; rankings go to logs and summaries.

topk sets displayed candidates; the profile sets capacity. See the ranking guide.

Security

See the security reference.

Try the sample

Linux or macOS; needs curl, gh, shasum and tar. The installer checks the release before unpacking it.

curl -fsSLo fleetdiff-source.tar.gz https://github.com/llm-measurement/fleetdiff/archive/refs/tags/v0.14.1.tar.gz
tar -xzf fleetdiff-source.tar.gz
cd fleetdiff-0.14.1
sh scripts/install.sh v0.14.1 ./release
./release/fleetdiff diagnose - < examples/diagnose/unsafe.yaml

What you'll see

Example output from this synthetic sample; your values will reflect your input.

The example check finds an enduser.id metric label and an unsafe model-operation filter in a synthetic collector configuration. fleetdiff points to the YAML settings that need changing.

2 problems to fix:
  connectors.genaisketch.operation_filter.llm_operations (line 10): Keep only model operations (chat, generate_content, text_completion, embeddings), each once. Tool and agent operations count as model attempts if included.
  connectors.genaisketch.slices[0].keys (line 12): enduser.id is a metric label; remove it from slices and use a hashed field instead.

Exit code 3 means the configuration has a blocking finding. It is the expected result for this example.

Why per-user labels grow so quickly

Metrics backends store each observed combination of label, tag or dimension values as its own series, and hosted services often bill for those combinations. For one metric, series ≈ users × other label combinations when each user appears across those combinations. Model, route, status and instance labels multiply the count further. The exact number depends on which combinations occur; histogram buckets and multiple metrics add more series.

  • Prometheus: two users with different user_id label values create two time series, even when the metric name and other labels match.
  • Grafana Cloud: those per-user series increase the active-series count, one of its metrics billing inputs alongside data points per minute.
  • Datadog: under cardinality-based custom-metrics billing, a different user tag creates a distinct custom metric for each metric name and remaining tag combination, including host.
  • CloudWatch: changing a UserId dimension creates a separate metric, even when the metric name and other dimensions match.

Keep the answers without identity labels

Use aggregate counters for token usage and model attempts, with a small, capped set of model or route labels. Keep the top token-consuming users in a fixed-capacity ranking outside metric labels. Track the number of distinct users as a scalar estimate, also without a user label. This preserves both questions: how many users were active, and which users accounted for most tokens.

Source and reproduction: released synthetic diagnosis fixtures. Verification record.

What the numbers mean

diagnose reads your collector configuration; your metrics backend reports live series counts.
Measurement notes

evijay+fleetdiff@gmail.com · Questions · Ran it on your data? Tell us what it found · Security issues (private)