Skip to content

Count kci-dev as its own analytics client #2144

Description

@alanpeixinho

Problem

kci-dev sends User-Agent: kci-dev/<version> and nothing else. get_client_info does not recognize it, so those requests are browser=unknown, os=unknown, and device=desktop. They also increment dashboard_unique_visitors_total, which has no client label, so CLI installs and dashboard users are one number.

In the week of 21–28 Sep 2026, unknown was 65% of OS requests and 50% of browser requests. Much of that is this CLI.

Proposal

In get_client_info, before the other guesses, match a User-Agent that starts with kci-dev followed by / or the end of the string. Set browser=kci-dev, os=kci-dev, device=cli. Do not guess Linux: the User-Agent has no OS.

Add a client label (dashboard or kci-dev) to dashboard_unique_visitors_total and dashboard_unique_visitors_by_endpoint_total.

In monitoring/dashboard.json, filter the unique-visitor stat to client="dashboard" and add a CLI unique-visitor stat for client="kci-dev". The browser, OS, and device panels already group by those labels, so kci-dev and cli show up without new queries. No Prometheus scrape change. The metric labels are the Prometheus change.

Tests

  • kci-dev/0.1.11 → browser kci-dev, os kci-dev, device cli, unique visitor only on client="kci-dev"
  • a normal browser User-Agent is unchanged and increments only client="dashboard"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions