Skip to content

Add an option to disable the persistent installation ID #2309

Open

Description

@sentry-junior

Since 0.14.1 (#1661), sentry_init always creates <database_path>/installation_id and uses its value as event.user.id and the session did whenever no user ID is set. There is no option, API, or build flag to turn this off, so teams with privacy review requirements can't adopt 0.14.1+ without a review, because a persistent identifier is now generated and sent by default.

Current behavior (0.17.6)

Current workaround

Set an explicit empty user.id with sentry_options_set_initial_scope (0.16.8+, #2087). This puts it on the scope before the backend starts and before the first session update, which is sent during init since 0.17.5 (#2242). The installation_id file is still written to disk.

static void
initial_scope(sentry_scope_t *scope, void *data)
{
    (void)data;
    sentry_scope_set_user(scope, sentry_value_new_user("", NULL, NULL, NULL));
}

sentry_options_set_initial_scope(options, initial_scope, NULL);

Proposal

An option such as sentry_options_set_installation_id(options, 0) (naming up to the maintainers) that skips both creating the file and filling in user.id / did.

Related

The Native Data Collected docs page doesn't mention the installation ID.

via Saad Khan.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 13, 2026

    @linear-code
  2. self-assigned this
    on Nov 16, 2026
  3. added a commit that references this issue on Nov 16, 2026
    976fdfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions