<a id="telemetry-reporter"></a>

# Configure Telemetry Reporter for Confluent Platform

#### IMPORTANT
**Confluent Health+ is in the End-of-Life (EOL) process.**

Health+ is deprecated and users should plan to migrate to Unified Stream Manager (USM). While Health+
remains operational for existing users, it is scheduled to be retired, or to sunset, on December 31, 2026.
Starting with Confluent Platform version 8.1, Health+ is discontinued for new deployments and Unified Stream Manager is
the recommended alternative for all users.

To begin your migration planning, see [Unified Stream Manager (USM) in Confluent Platform](../usm/overview.md#usm-overview).

The Confluent Telemetry Reporter is a plugin that runs inside each Confluent Platform service to
push metadata about the service to Confluent. Telemetry Reporter enables product features
based on the metadata, like Health+. Data is sent over HTTP using an encrypted connection.

For a list of available metrics, see [Telemetry Reporter Metrics Reference for Confluent Platform](telemetry-reporter-metrics.md#telemetry-reporter-metrics).

#### IMPORTANT
- If [Self-Balancing](../clusters/sbc/index.md#sbc) is enabled on the cluster, Telemetry Reporter
  is enabled and runs by default as a requirement of Self-Balancing Clusters. The Self-Balancing
  algorithm consumes from the [Telemetry Reporter internal topic \_confluent-telemetry-metrics](../clusters/sbc/configuration-options.md#sbc-internal-topics).
- If Self-Balancing is not enabled on the cluster, the Telemetry Reporter can be fully
  disabled using the `confluent.reporters.telemetry.auto.enable=false`
  property setting in the server configuration file at
  `$CONFLUENT_HOME/etc/kafka/server.properties`.
- No data is sent to Confluent Cloud if you set `confluent.telemetry.enabled`
  to `false`.

<a id="telemetry-reporter-installation"></a>

## Installation

Confluent Telemetry Reporter is installed as part of the full Confluent Platform installation.
If you choose to install packages individually, ensure that Telemetry Reporter is
installed by using `yum install confluent-telemetry` or the equivalent package
manager command for your environment.

## Enable telemetry reporting to Confluent Cloud

Prerequisites
: - Internet connectivity either directly or through a proxy
  - Confluent Platform 6.0 or higher

### Create a Cloud API key and secret

The following steps show how to create an API key and secret to authenticate
with Confluent Cloud.

Cloud API keys are distinct from Kafka cluster API keys. For Telemetry Reporter,
you must use a Cloud API Key, not a Kafka cluster API key. Using a cluster key
causes an authentication error.

### Confluent CLI

1. Log in to Confluent Cloud by using the `confluent login` command.
2. Use the [confluent iam service-account create](https://docs.confluent.io/confluent-cli/current/command-reference/iam/service-account/confluent_iam_service-account_create.html)
   command to create a service account for your telemetry data.
   ```bash
   confluent iam service-account create <telemetry-sa-name> --description "<telemetry-sa-description>"
   ```

   Your output should resemble:
   ```none
   +-------------+---------------------------+
   | ID          | sa-abc123                 |
   | Name        | telemetry-sa              |
   | Description | telemetry service account |
   +-------------+---------------------------+
   ```

   Note the service account ID, which you use in the next step.
3. Use the [confluent api-key create](https://docs.confluent.io/confluent-cli/current/command-reference/api-key/confluent_api-key_create.html)
   command to create a Cloud API key for the service account.
   ```bash
   confluent api-key create --resource cloud --service-account <sa-id> --description "<api-key-description>"
   ```

   Your output should resemble:
   ```none
   It may take a couple of minutes for the API key to be ready.
   Save the API key and secret. The secret is not retrievable later.
   +---------+------------------------------------------------------------------+
   | API Key | UZ7UB0BEMH7ZZL4T                                                 |
   | Secret  | PcFU4EUD0bbSFaz3jnx2jhYmcuPVZShdowwhOkrYUhusFONqQtfU0tMtT8gkZSde |
   +---------+------------------------------------------------------------------+
   ```

### Confluent Cloud Console

1. Log in to Confluent Cloud Console and navigate to
   [Cloud API keys](https://confluent.cloud/settings/api-keys).
2. Click **Add key**, and on the **Create key** page, click
   **Granular access** and **Next**.
3. Click **Create a new one** to create a service account for your
   telemetry data.
4. Enter a name and description for the service account, for example,
   “telemetry-sa” and “telemetry service account”.
5. Click **Next**.
6. In the **Create key** page, enter a description for the service
   account’s API key, for example, “telemetry-sa api key”.
7. Click **Download and continue** to download a text file that contains
   your API key and secret.

### Configure Health+

To configure Health+, you must configure the Telemetry Reporter plugin on every service that you want to include
in Health+. The process for configuring Telemetry Reporter for [ksqlDB](../_glossary.md#term-ksqlDB) and [Connect](../_glossary.md#term-Kafka-Connect) is the
same as for the [broker](../_glossary.md#term-Kafka-broker). You must set `telemetry.enabled` to `true` and specify the API key
`telemetry.api.key` and secret `telemetry.api.secret` for each component.

You have a number of options for configuring Health+.

### Control Center

1. Open Control Center in a browser. The default URL is [http://localhost:9021/](http://localhost:9021/).
2. On the **Home** page, click your cluster.
3. In the navigation menu, click **Health+** to open the overview page.
4. Click **Get started** to set up Health+ for your cluster.
5. In the **Enable your cluster to communicate with Health+** section,
   enter your API key and secret.
   ![Enable Health+ page in Confluent Control Center](images/c3-health-plus-api-key-secret.png)
   - If you used the Confluent CLI to generate the key and secret,
     enter them in the **confluent.telemetry.api.key** and
     **confluent.telemetry.api.secret** text boxes.
   - If you used Confluent Cloud Console to generate the key and secret, click
     **Upload key and secret** and navigate to the file that you
     downloaded previously.
6. Click **Continue**.
7. ### (Optional) Add additional Confluent Platform services, such as ksqlDB or Connect.

   - For any Confluent Platform components other than Confluent Server, enable Telemetry Reporting by
     adding the following lines to the corresponding configuration file for
     the service. The default location for a component’s configuration file is
     `$CONFLUENT_HOME/etc/<component_name>/<component_name>.properties`.
     ```properties
     metric.reporters=io.confluent.telemetry.reporter.TelemetryReporter
     confluent.telemetry.enabled=true
     confluent.telemetry.api.key=<api_key>
     confluent.telemetry.api.secret=<api_secret>
     ```

     #### NOTE
     Confluent Server doesn’t require the `metric.reporters` setting, but all other Confluent Platform components do require it.
   - Save the file and restart the service to deploy the new configuration.
     Use the `confluent local services <component_name> stop` and
     `confluent local services <component_name> start` commands to restart
     the service.
8. Navigate to the [Health+](https://confluent.cloud/health-plus)
   page in Confluent Cloud Console to verify that your data is being received.
   The tile for your Confluent Platform cluster should show **Running**.
9. Click **Finish**.
10. Click the tile for your cluster to see your telemetry data on the
    [Monitor Using Health+ Dashboard for Confluent Platform](health-plus-monitoring-dashboard.md#health-plus-monitoring-dashboard).

### Ansible Playbooks for Confluent Platform

If you use Ansible Playbooks for Confluent Platform to manage your Confluent Platform installation, add the following
configuration overrides to all Confluent Platform roles and deploy the changes. This includes
adding overrides for ksqlDB, Connect, and any other Confluent Platform roles for which you want
to receive metrics in Health+.

```properties
telemetry_enabled: true
telemetry_api_key: <api_key>
telemetry_api_secret: <api_secret>
```

### Confluent for Kubernetes

When you use Confluent for Kubernetes (CFK) to manage Confluent Platform, you can enable telemetry as
described in [the Confluent for Kubernetes documentation](https://docs.confluent.io/operator/current/co-monitor-cp.html#telemetry-reporter).

The Telemetry Reporter settings are in the
[CFK values file](https://docs.confluent.io/operator/current/co-deploy-cfk.html#co-values-file)
and are managed globally for all Confluent Platform components.

### Custom deployment

For Confluent Server, enable Telemetry Reporter by adding the following lines to the
server configuration file. The default location for the server configuration
file is `$CONFLUENT_HOME/etc/kafka/server.properties`. Replace
`<api_key>` and `<api_secret>` with the key and secret you generated
previously.

```properties
confluent.telemetry.enabled=true
confluent.telemetry.api.key=<api_key>
confluent.telemetry.api.secret=<api_secret>
```

Save the server configuration and restart Confluent Server.

If restarting Confluent Server is undesirable, you can add these configurations by
using dynamic configuration with the `kafka-config` CLI. For more
information, see [Enable Telemetry without a restart](#telemetry-reporter-no-restart).

For all Confluent Platform components other than Confluent Server, enable Telemetry Reporting by
adding the following lines to the corresponding configuration file for
the service. The default location for a component’s configuration file is
`$CONFLUENT_HOME/etc/<component_name>/<component_name>.properties`.

```properties
metric.reporters=io.confluent.telemetry.reporter.TelemetryReporter
confluent.telemetry.enabled=true
confluent.telemetry.api.key=<api_key>
confluent.telemetry.api.secret=<api_secret>
```

Save the file and restart the service to deploy the new configuration.
Use the `confluent local services <component_name> stop` and
`confluent local services <component_name> start` commands to restart
the service.

#### NOTE
Confluent Server doesn’t require the `metric.reporters` setting, but all other Confluent Platform components do require it.

<a id="telemetry-reporter-config-proxy"></a>

## Configuration with a proxy

Confluent Telemetry Reporter supports routing telemetry data through an
authenticated HTTP proxy. In these environments, set the following
parameters in the properties file of the broker to enable telemetry data to egress
through a proxy.

```properties
confluent.telemetry.proxy.url=http://<proxy_server_ip>:<proxy_server_port>
confluent.telemetry.proxy.username=<proxy-username>
confluent.telemetry.proxy.password=<proxy-password>
```

## What data is sent and how is it used?

When you have Confluent Telemetry Reporter enabled for a specific Confluent Platform
component, Confluent collects metrics about the Confluent Platform component that include:

- Runtime performance metrics
- The Kafka version
- The Confluent Platform version
- A unique identifier that’s valid for the applicable Confluent Platform component
- A unique identifier for the Kafka cluster
- A unique identifier for your organization.

The data is sent using an encrypted connection to Confluent servers once per
minute, by default. The resulting data is used by Confluent to offer Health+
to its customers and to maintain and improve Confluent Products and Services.

For this data to be sent, enable the transmission by setting configuration
flags in every Confluent Platform component. You can stop sending data at any time by
removing these configuration flags.

Telemetry Reporter requires an Amazon Root certificate to successful submit
metrics to Confluent. The required CA Root Certificate is: `C=US; O=Amazon; CN=Amazon RSA 2048 M02`

You can find this certificate in the default TrustStore included with Java. If you
made adjustments to the default TrustStore that remove the above certificate, you must add it
back to use Telemetry Reporter.

The default TrustStore is typically a file named `cacerts`. It’s located in the `lib/security`
directory within the Java installation directory.

<a id="telemetry-reporter-dynamic-config"></a>

## Dynamic Configuration

Currently, dynamic configuration applies only to Kafka brokers.

To understand how to apply dynamic configs for your cluster, see
[Kafka Dynamic Configurations](../kafka/dynamic-config.md#kafka-dynamic-configurations).

<a id="telemetry-reporter-no-restart"></a>

### Enable Telemetry without a restart

If you’re using Confluent Server, you can enable the Telemetry Reporter without a restart
by using the following command. Replace `<api_key>` and `<api_secret>` with
the key and secret you generated previously.

```bash
$CONFLUENT_HOME/bin/kafka-configs --bootstrap-server localhost:9092 \
--alter --entity-type brokers --entity-default \
--add-config confluent.telemetry.enabled=true, \
confluent.telemetry.api.key=<api_key>, \
confluent.telemetry.api.secret=<api_secret>
```

### Supported dynamic configuration properties

- `confluent.telemetry.enabled`
- `confluent.telemetry.api.key`
- `confluent.telemetry.api.secret`
- `confluent.telemetry.proxy.url`
- `confluent.telemetry.proxy.username`
- `confluent.telemetry.proxy.password`

<a id="telemetry-reporter-disable"></a>

## Disable Telemetry

For all Confluent Platform components that have telemetry enabled, set the
`confluent.telemetry.enabled` config to `false` and restart the
component.

```properties
confluent.telemetry.enabled=false
```

If you’re using Confluent Server, you can disable Telemetry Reporter without a restart
by using the following command. Replace `<api_key>` and `<api_secret>` with
the key and secret you generated previously.

```bash
  $CONFLUENT_HOME/bin/kafka-configs --bootstrap-server localhost:9092 \
  --alter --entity-type brokers --entity-default \
  --add-config confluent.telemetry.enabled=false, \
  confluent.telemetry.api.key=<api_key>, \
  confluent.telemetry.api.secret=<api_secret>
```
