# Telemetry

Tabnine CLI includes optional, built-in telemetry powered by [OpenTelemetry](https://opentelemetry.io/). When enabled, it emits structured traces, metrics, and logs to an OTLP endpoint or local file of your choice — giving you full visibility into agent behavior, performance, and reliability.

Telemetry is **disabled by default** and must be explicitly enabled.

{% hint style="info" %}
\*\*Prerequisites:\*\* Tabnine CLI does not include a built-in telemetry backend.

To use telemetry, you must provide your own [OTLP-compatible](https://opentelemetry.io/ecosystem/vendors/) collector (e.g., Jaeger, Grafana, Datadog) or configure a local output file.
{% endhint %}

#### **What is Collected**

When telemetry is enabled, the following data is emitted:

* **Session metadata** - session ID, timestamps, and duration.
* **Feature usage** - which commands and tools are invoked, how often, and whether they succeed or fail.
* **Performance metrics** - API call latency, token usage (input/output), tool call durations, and memory usage.
* **Environment information** - operating system, Node.js version, CLI version, and process command-line arguments.
* **Error details** - error messages, error types, and HTTP status codes.
* **API request details** - model name, prompt ID, and request text for each API call.
* **Prompt content** - when `logPrompts` is `true` (the default), user prompts and full conversation messages are included in log attributes. See Prompt logging for details on controlling this.

**What is NOT collected**

Tabnine CLI does not intentionally collect personal information or credentials. Your authentication tokens are never included in telemetry payloads.

{% hint style="warning" %}
\*\*Important:\*\* Telemetry may include user-generated content such as prompts, conversation messages, API request text, and process command-line arguments.

These fields are captured as-is, without redaction. If your input contains personal data or sensitive values, that content will be present in the telemetry output.

To limit exposure, disable prompt logging (`logPrompts: false`) and ensure telemetry is only sent to endpoints you trust. See Prompt logging for details
{% endhint %}

#### **Configuration**

Telemetry is configured through the settings file and/or environment variables. Environment variables take precedence over settings file values.

**Settings File**

Add a `telemetry` section to `~/.tabnine/agent/settings.json`:

```json
{
  "telemetry": {
    "enabled": true,
    "otlpEndpoint": "http://localhost:4317",
    "otlpProtocol": "grpc",
    "logPrompts": false
  }
}
```

{% hint style="info" icon="exclamation" %}
Note that this section may look different depending on your choice of variables as described in the options below.
{% endhint %}

**Configuration Reference**

| Setting        | Env Variable                      | Description                                                                                                       | Default                 |
| -------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `enabled`      | `TABNINE_TELEMETRY_ENABLED`       | Enable or disable telemetry. Only `true` and `1` enable it; any other value (including `false`, `0`) disables it. | `false`                 |
| `otlpEndpoint` | `TABNINE_TELEMETRY_OTLP_ENDPOINT` | OTLP collector endpoint URL.                                                                                      | `http://localhost:4317` |
| `otlpProtocol` | `TABNINE_TELEMETRY_OTLP_PROTOCOL` | OTLP transport protocol: `grpc` or `http`.                                                                        | `grpc`                  |
| `outfile`      | `TABNINE_TELEMETRY_OUTFILE`       | Write telemetry to a local file instead of sending to `otlpEndpoint`.                                             | —                       |
| `logPrompts`   | `TABNINE_TELEMETRY_LOG_PROMPTS`   | Include user prompts and messages in log attributes. Only `true` and `1` enable it; any other value disables it.  | `true`                  |

The standard OpenTelemetry variable `OTEL_EXPORTER_OTLP_ENDPOINT` is also supported. Resolution order: `TABNINE_TELEMETRY_OTLP_ENDPOINT` > `OTEL_EXPORTER_OTLP_ENDPOINT` > settings file.

**Disabling Telemetry**

Telemetry is disabled by default. If you have previously enabled it and want to turn it off, set `enabled` to `false` in the settings file:

```json
{
  "telemetry": {
    "enabled": false
  }
}
```

Or via environment variable:

```shell
export TABNINE_TELEMETRY_ENABLED=false
```

**Writing Telemetry to a File**

The simplest way to inspect telemetry output is to write it to a local file:

```json
{
  "telemetry": {
    "enabled": true,
    "outfile": "/tmp/tabnine-telemetry.log"
  }
}
```

When `outfile` is set, telemetry is written to the specified file instead of being sent to an OTLP endpoint.

**Sending Telemetry to a Collector**

You can send telemetry to any [OpenTelemetry-compatible](https://opentelemetry.io/ecosystem/vendors/) backend as seen in this Jaeger example:

{% stepper %}
{% step %}
Start a local Jaeger instance:

```shell
docker run -d --name jaeger \
  -p 16686:16686 \
  -p 4317:4317 \
  jaegertracing/all-in-one:latest
```

{% endstep %}

{% step %}
Configure telemetry to point to the collector:

```json
{
  "telemetry": {
    "enabled": true,
    "otlpEndpoint": "http://localhost:4317"
  }
}
```

{% endstep %}

{% step %}
Open the Jaeger UI at \`<http://localhost:16686\\`> to explore traces.
{% endstep %}
{% endstepper %}

**Using HTTP instead of gRPC**

If your collector expects OTLP over HTTP:

```json
{
  "telemetry": {
    "enabled": true,
    "otlpEndpoint": "http://localhost:4318",
    "otlpProtocol": "http"
  }
}
```

#### **Telemetry Signals**

Tabnine CLI emits three types of OpenTelemetry signals:

**Traces**

Traces capture the full lifecycle of agent interactions:

* User prompt processing
* LLM API calls
* Tool execution (with timing and success/failure)
* Agent loop iterations

**Metrics**

Metrics provide aggregate performance data:

* Token usage (input/output)
* API response times
* Tool call durations and success rates
* Memory usage

**Logs**

Structured log records capture discrete events:

* Session start and end
* Individual tool calls
* API requests and responses
* Errors

**Prompt Logging**

By default, `logPrompts` is `true` — user prompts and full conversation messages are included in log attributes (`prompt`, `gen_ai.input.messages`).

Setting `logPrompts` to `false` removes these attributes:

```json
{
  "telemetry": {
    "enabled": true,
    "logPrompts": false
  }
}
```

Or via environment variable:

```shell
export TABNINE_TELEMETRY_LOG_PROMPTS=false
```

{% hint style="warning" %}
\*\*Privacy note:\*\* Even with \`logPrompts\` set to \`false\`, some prompt context may still appear in other telemetry fields (such as API request text and process command-line arguments). If complete prompt privacy is required, do not send telemetry to untrusted endpoints.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-cli/features/telemetry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
