# Telemetry in Cortex Framework

Google Cloud Cortex Framework collects anonymous usage statistics during
deployment and synchronization processes.

## Purpose of data collection

- **Feature adoption evaluation**: Monitoring the frequency of framework module and data product deployments informs development priorities.
- **Integration pattern identification**: Tracking connected source system variants (for example, SAP ECC or SAP S/4HANA) enables the verification of compatibility and the prioritization of maintenance for these integrations.

Telemetry is **enabled by default** . To disable it, see
[Disable telemetry](https://docs.cloud.google.com/cortex/docs/telemetry.md.txt#disable-telemetry).

## Data collected

The framework collects configuration identifiers, such as dataset IDs, data
product instance IDs, and repository IDs. User identity attributes, such as
names, emails, or IP addresses, aren't collected.

- **Google Cloud project number**: Identifies the project running the deployment, transmitted in the X-Goog-User-Project header to aggregate usage.
- **Deployment region or location**: The region where target resources are deployed, used to track geographic distribution.
- **Framework version**: The version of the Cortex Framework codebase in use (for example, 7.1.0).
- **Component name**: The high-level architecture component being acted upon (for example, platform, data-product, or foundation).
- **Tool type** : The specific CLI command or utility executed (for example, `deployer`, `knowledge-catalog`, `conversational-agent`, or `gemini` across `uv run cortex-deploy`, `uv run cortex-build-and-deploy`, `uv run cortex-demo`, `uv run cortex-create-kc-data-products`, `uv run cortex-create-ca-agents`, and `uv run cortex-register-gemini-agents`).
- **Target variant** : The deployment target type (for example, `dataform` or `git`), registered data product ID, conversational agent ID, or Gemini app or agent ID.
- **Enabled module types** : The dot-separated module paths enabled in the configuration (for example, `cortex.sap.foundations.sap`).
- **Dataform repository ID**: The user-configured name of the target Dataform repository.
- **BigQuery dataset ID**: The user-configured target BigQuery dataset name.
- **Data product instance ID**: The user-provided ID used during the Knowledge Catalog registration step to identify registered data products.
- **Execution status** : The completion state of the deployment or synchronization step (for example, `deployed`, `post-deploy-success`, `registered`, or `updated`).

## User-Agent header structure

Telemetry parameters are injected into Google Cloud API requests using a
specialized HTTP User-Agent header that is dynamically formatted using the
following pattern:

    gcp-cortex-eng/framework/<version>/<component>/<tool_type>/<variant>[/<optional_extension>]/<status>

For example, when successfully deploying SAP ERP foundations to a
Dataform target:

    gcp-cortex-eng/framework/7.1.0/platform/deployer/dataform/cortex.sap.foundations.sap/deployed

## Data transmission

Cortex Framework uses a zero-payload metadata logging mechanism
(`EventLogger`) rather than transmitting log payloads to external endpoints.

During deploy, sync, agent-creation, registration, or demo commands,
`EventLogger` looks up the target Google Cloud project number using the
Cloud Resource Manager API (`cloudresourcemanager.googleapis.com`) and issues
lightweight authenticated HTTP `GET` requests (with no request body) against
standard [BigQuery](https://docs.cloud.google.com/bigquery/docs.md.txt) or
[Dataform](https://docs.cloud.google.com/dataform/docs.md.txt) REST endpoints. Each request carries
the custom `User-Agent` header and the `X-Goog-User-Project` header with your
project number so Google Cloud API traffic logging can aggregate
anonymous adoption statistics.

Running `uv run cortex-create-kc-data-products`,
`uv run cortex-create-ca-agents`, or `uv run cortex-register-gemini-agents` with
`--dry-run` suppresses telemetry completely.

## Disable telemetry

Cortex Framework respects your privacy settings and supports both
a persistent global opt-out and a per-invocation CLI flag.

### Disable globally

You can manage telemetry globally by updating the persistent user preference
file at `~/.cortex/cortex-framework-consent.properties` using
`uv run cortex-config`. When this file records your opt-out preference
(`enable_telemetry=false`), telemetry API calls are skipped across all
subsequent runs.

- **Permanently opt out (globally disable)**:

```bash
uv run cortex-config telemetry disable
```

- **Permanently opt in (globally enable)**:

```bash
uv run cortex-config telemetry enable
```

- **Check the current status**:

```bash
uv run cortex-config telemetry status
```

### Disable for a single execution

Passing `--disable-telemetry` to a telemetry-emitting CLI (`cortex-deploy`,
`cortex-build-and-deploy`, `cortex-demo`, `cortex-create-kc-data-products`,
`cortex-create-ca-agents`, or `cortex-register-gemini-agents`) disables
telemetry **for that single command invocation only** without modifying
`~/.cortex/cortex-framework-consent.properties` (to persist the opt-out
globally, run `uv run cortex-config telemetry disable`). `uv run cortex-build`
and `uv run cortex-apply-security` also accept `--disable-telemetry` to suppress
the startup telemetry consent notice, although they don't send telemetry
requests:

```bash
export CORTEX_CONFIG_FILE=config/config.yaml

# Cortex deploy
uv run cortex-deploy --config $CORTEX_CONFIG_FILE --disable-telemetry

# Cortex build-and-deploy
uv run cortex-build-and-deploy --config $CORTEX_CONFIG_FILE --disable-telemetry

# Cortex apply security
uv run cortex-apply-security --config $CORTEX_CONFIG_FILE --disable-telemetry

# Cortex demo
uv run cortex-demo --project-id PROJECT_ID --disable-telemetry

# Cortex create Knowledge Catalog data products
uv run cortex-create-kc-data-products \
    --config $CORTEX_CONFIG_FILE \
    --owner-email OWNER_EMAIL \
    --disable-telemetry

# Cortex create conversational analytics agents
uv run cortex-create-ca-agents --config $CORTEX_CONFIG_FILE --disable-telemetry

# Cortex register Gemini agents
uv run cortex-register-gemini-agents --config $CORTEX_CONFIG_FILE --disable-telemetry
```

Replace the following:

- `PROJECT_ID`: the target Google Cloud project ID for deploying demo datasets, for example: `my-cortex-demo-project`.
- `OWNER_EMAIL`: the email address of the data product owner, for example: `data-owner@example.com`.

## What's next

For more information about these commands and their parameters, see the
following CLI references:

- [CLI Cortex Framework config](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-config.md.txt)
- [CLI Cortex Framework deploy](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-deploy.md.txt)
- [CLI Cortex Framework build and
  deploy](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-build-and-deploy)
- [CLI Cortex Framework apply
  security](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-apply-security)
- [CLI Cortex Framework demo
  deploy](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-demo)
- [CLI create Knowledge Catalog data
  products](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-create-kc-data-products)
- [CLI create conversational analytics
  agents](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-create-ca-agents)
- [CLI register Gemini
  agents](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-register-gemini-agents)