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

  1. aliceinwire commented on Sep 29, 2026

    @aliceinwire
    Member

    I’d suggest adding an explicit client label for dashboard vs kci-dev, while keeping os=unknown for CLI requests. Using os=kci-dev mixes application identity with the OS dimension and would make the Grafana OS panel misleading. device=cli looks appropriate.

  2. alanpeixinho commented on Sep 30, 2026

    @alanpeixinho
    ContributorAuthor

    I’d suggest adding an explicit client label for dashboard vs kci-dev, while keeping os=unknown for CLI requests. Using os=kci-dev mixes application identity with the OS dimension and would make the Grafana OS panel misleading. device=cli looks appropriate.

    Noted.
    Do you think it would make sense to also send OS information on kci-dev user-agent?
    If you consider this as a good approach, I will be happy to open a PR on kci-dev.

  3. aliceinwire commented on Oct 1, 2026

    @aliceinwire
    Member

    Yes, I think adding coarse OS information to the kci-dev User-Agent would be useful. The User-Agent is centralized in kcidev/libs/common.py, so this should be a small change.

    I’d keep it limited to the OS family, for example kci-dev/0.1.11 (Linux) or (macOS), without distro, kernel version, architecture, or other details. We should also normalize the OS names rather than exposing the raw platform.system() value, since for example it reports Darwin for macOS.

    On the dashboard side, we should then parse that OS information while still classifying the client as kci-dev and the device as cli.

  4. alanpeixinho commented on Oct 1, 2026

    @alanpeixinho
    ContributorAuthor

    Including an extra point here.
    We should also keep version client for kci-dev, helping us track the update dynamics.

  5. alanpeixinho commented on Oct 1, 2026

    @alanpeixinho
    ContributorAuthor

    PR to add OS in kci-dev user agent kernelci/kci-dev#318

  6. aliceinwire commented on Oct 2, 2026

    @aliceinwire
    Member

    wrote review, waiting for replay

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