Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ include::cli:partial$cbcli/nav.adoc[]
**** xref:rest-api:rest-manage-log-collection.adoc[Collecting Logs]
**** xref:rest-api:rest-client-logs.adoc[Logging Client-Side Errors]

*** xref:rest-api:application-telemetry.adoc[]

** xref:rest-api:rest-bucket-intro.adoc[Buckets API]
*** xref:rest-api:rest-bucket-create.adoc[Creating and Editing Buckets]
*** xref:rest-api:setting-minimum-replicas.adoc[Setting a Replica-Minimum]
Expand Down
10 changes: 10 additions & 0 deletions modules/manage/pages/monitor/set-up-prometheus-for-monitoring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,13 @@ The `http_sd_configs` section contains its own copy of the `basic_auth` and `tls

You can change the list that the discovery API returns by adding query parameters to the URL in the `http_sd_configs` section.
See xref:rest-api:rest-discovery-api.adoc[Prometheus Discovery API].

[#app-telemetry]
== Include Application Telemetry in Prometheus Metrics

You can enable application telemetry to have Couchbase Server collect metrics from your applications that use the Couchbase SDKs.
When you enable application telemetry, Couchbase Server collects telemetry data from your applications.
It the reports the collected data as metrics through the same Prometheus endpoint that it uses to report its own metrics.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "It the reports" should be "It then reports" (or similar).

Suggested change
It the reports the collected data as metrics through the same Prometheus endpoint that it uses to report its own metrics.
It then reports the collected data as metrics through the same Prometheus endpoint that it uses to report its own metrics.

Copilot uses AI. Check for mistakes.
Enabling this feature lets you use Prometheus to monitor the health of both your Couchbase Server cluster and your applications that use the Couchbase SDKs.

See xref:rest-api:application-telemetry.adoc[] to learn how to enable application telemetry.
222 changes: 222 additions & 0 deletions modules/rest-api/pages/application-telemetry.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
= Application Telemetry
:description: pass:q[You can enable application telemetry that lets Couchbase Server periodically collect information from your clients that use the Couchbase SDK.]
:page-topic-type: reference
:page-toclevels: 3

[abstract]
{description}

== Description

Having Couchbase Server collect telemetry information from your applications that use the Couchbase SDKs can help you troubleshoot client issues.
This telemetry data is useful to diagnose issues such as poor performance or timeouts.

When you enable application telemetry, Couchbase Server advertises to SDK clients that it can collect telemetry data.
When an SDK client connects to a cluster with application telemetry enabled, it opens a WebSocket connection to a node in the cluster.
Couchbase Server uses this connection to periodically gather telemetry data from the client in Prometheus format.

Couchbase Server reports the collected telemetry data through the same Prometheus metrics endpoint it uses to publish its own metrics.
See xref:manage:monitor/set-up-prometheus-for-monitoring.adoc[] to learn how to set up Prometheus to collect metrics from your Couchbase Server cluster.

NOTE: A Couchbase Server cluster only supports application telemetry when all of its nodes are running version 8.0 or later.
Earlier versions of Couchbase Server do not support application telemetry.
You cannot have the cluster collect application telemetry if the cluster is running in mixed mode with some nodes running a version earlier than 8.0.
If you enable application telemetry on a cluster running in mixed mode with pre-8.0 nodes, the cluster does not advertise its ability to collect telemetry to clients.

== HTTP Methods

This API endpoint supports the following methods:

* <<#get-status>>
* <<#configure-telemetry>>


[#get-status]
== Get Application Telemetry Status

The following method gets the current state of application telemetry for the cluster.

----
GET /settings/appTelemetry
----

=== curl Syntax

[source,bash]
----
curl -sS -u $USER:$PASSWORD \
-X GET 'http[s]://{host}:{port}/settings/appTelemetry'
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This curl example uses {host}/{port} placeholders, but most REST API docs use {HOST}/{PORT}. Consider switching to the established placeholder casing (and matching whatever is documented in user-pw-host-port-params.adoc) to keep examples consistent.

Suggested change
-X GET 'http[s]://{host}:{port}/settings/appTelemetry'
-X GET 'http[s]://{HOST}:{PORT}/settings/appTelemetry'

Copilot uses AI. Check for mistakes.
----

.Path and curl Parameters
:priv-link: get-privs
include::partial$user-pw-host-port-params.adoc[]


[#get-privs]
=== Required Privileges

Your user account must have at least 1 of the following roles to get the application telemetry status:

* xref:learn:security/roles.adoc#full-admin[Full Admin]
* xref:learn:security/roles.adoc#cluster-admin[Cluster Admin]
* xref:learn:security/roles.adoc#read-only-admin[Read-Only Admin]

[#get-status-responses]
=== Responses

`200 OK`::
Returned when the call is successful.
The response body contains a JSON object with the following fields:

+
* `enabled`: whether application telemetry is enabled or not.
* `maxScrapeClientsPerNode`: the maximum number of clients from which a single node can scrape telemetry data at the same time.
* `scrapeIntervalSeconds`: how often clients scrape telemetry data from the nodes, in seconds.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response-field description for scrapeIntervalSeconds says "how often clients scrape telemetry data from the nodes", but earlier the page describes Couchbase Server scraping/pulling telemetry data from SDK clients. Update this description so the directionality is consistent (nodes/server scrape clients).

Suggested change
* `scrapeIntervalSeconds`: how often clients scrape telemetry data from the nodes, in seconds.
* `scrapeIntervalSeconds`: how often each node scrapes telemetry data from connected clients, in seconds.

Copilot uses AI. Check for mistakes.

`403 Forbidden`::
Returned if you do not have the proper roles to call this API.
See <<#get-privs>>.


[#gey-state-example]
Comment on lines +81 to +82
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anchor ID looks like a typo: gey-state-example (missing the 't' in 'get'). If this is meant to be "get-state-example", rename it to avoid broken/unclear anchors.

Suggested change
[#gey-state-example]
[#get-state-example]

Copilot uses AI. Check for mistakes.
=== Examples

The following example gets the cluster's current application telemetry setting from the local node and pipes the result through `jq`.

[source,bash]
----
curl -sX GET -u Administrator:password \
'http://localhost:8091/settings/appTelemetry' | jq
----

Running the previous command returns a JSON object similar to the following:

[source,json]
----
{
"enabled": false,
"maxScrapeClientsPerNode": 1024,
"scrapeIntervalSeconds": 60
}
----


[#configure-telemetry]
== Configure Application Telemetry

By sending a POST request to the `/settings/appTelemetry` endpoint, you can:

* Enable or turn off application telemetry.
* Set the limit on the number of clients a single node can scrape telemetry data from at the same time.
* Set how often the nodes scrape telemetry data from clients.

.Configure Application Telemetry
----
POST /settings/appTelemetry
----


=== curl Syntax

[source,bash]
----
curl -sS -u $USER:$PASSWORD \
-X POST http://{host}:{port}/settings/encryptionKeys \
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The POST curl syntax points at /settings/encryptionKeys, but this page and the endpoint definition above describe /settings/appTelemetry. Update the example URL so it posts to the correct endpoint.

Suggested change
-X POST http://{host}:{port}/settings/encryptionKeys \
-X POST http://{host}:{port}/settings/appTelemetry \

Copilot uses AI. Check for mistakes.
[-d enabled=[true|false]] \
[-d maxScrapeClientsPerNode=<integer>] \
[-d scrapeIntervalSeconds=<integer>]
----

.Path and curl Parameters
:priv-link: config-privs
include::partial$user-pw-host-port-params.adoc[]


.REST Parameters
`enabled` (boolean, optional)::
Set to `true` to enable application telemetry or `false` to disable it.

`maxScrapeClientsPerNode` (integer, optional)::
Set the maximum number of clients from which a single node can scrape telemetry data at the same time.
If the number of client telemetry connections reaches this threshold, the node rejects new telemetry connections until the number of connect clients drops.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in this sentence: "number of connect clients" should be "number of connected clients".

Suggested change
If the number of client telemetry connections reaches this threshold, the node rejects new telemetry connections until the number of connect clients drops.
If the number of client telemetry connections reaches this threshold, the node rejects new telemetry connections until the number of connected clients drops.

Copilot uses AI. Check for mistakes.

+
Valid values are from `1` to `1024`.

+
The default value is `1024`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any sentinel values like 0 which indicate unlimited?

How would a user know when the limit is being hit?

@avsej or @timofey-barmin may know this off the top of their heads.

You can set `maxScrapeClientsPerNode` to a lower value to reduce potential overhead on your nodes from collecting telemetry data.
However, lowering it too far could result in clients being unable to find a node for their telemetry connection.
When clients cannot find a node to connect to, their telemetry data is not collected.

`scrapeIntervalSeconds` (integer, optional)::
Sets how often the nodes scrape telemetry data from clients, in seconds.

+
Valid values are `60` to `600`.

+
The default value is `60`.
You can increase this value to reduce the overhead on your nodes of collecting telemetry data.
However, setting it too high could result in a loss of telemetry data when clients close their connections.

[#config-privs]
=== Required Privileges
Your user account must have at least 1 of the following roles to configure application telemetry:

* xref:learn:security/roles.adoc#full-admin[Full Admin]
* xref:learn:security/roles.adoc#cluster-admin[Cluster Admin]

=== Responses

`200 OK`::
Returned when the call is successful.
A successful call also returns a JSON object with the new application telemetry settings.
This object has the same format as the <<#get-status-responses,response from the GET method>>.

`403 Forbidden`::
Returned if you do not have the proper roles to call this API.
See <<#config-privs>> for a list of the required roles.

[#config-examples]
=== Examples

The following example enables telemetry, sets the maximum number of clients a node can scrape telemetry data from at the same time to `512`, and sets the scrape interval to `90` seconds.
It pipes the result through `jq` to make it easier to read.

[source,bash]
----
curl -X POST -u Administrator:password \
http://localhost:8091/settings/appTelemetry \
-d enabled=true \
-d maxScrapeClientsPerNode=512 \
-d scrapeIntervalSeconds=90 | jq
----

If successful, the previous command returns the following JSON object containing the new state of application telemetry for the cluster:

[source,json]
----
{
"enabled": true,
"maxScrapeClientsPerNode": 512,
"scrapeIntervalSeconds": 90
}
----

== See Also

* xref:manage:monitor/set-up-prometheus-for-monitoring.adoc[]

* See the SDK Telemetry from the Server section of the Collecting Information and Logging page in the documentation for the SDK you use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhere in here we should mention the SDK-API level required to get AppTelemetry from the SDK. @RichardSmedley might have a good way to communicate this.

To get details, most users will need to update both their SDK, and the cluster, and enable it. As currently written, the SDK side requirement is possibly missed.

Another requirement which we may want to mention is that this feature requires the management port to be exposed from cluster to client (typically port 8091/18091, but can be different with alt-address).

For example:

** xref:cxx-sdk:howtos:collecting-information-and-logging.adoc#sdk-telemetry-from-the-server[C++ SDK]
** xref:go-sdk:howtos:collecting-information-and-logging.adoc#sdk-telemetry-from-the-server[Go SDK]
** xref:java-sdk:howtos:collecting-information-and-logging.adoc#sdk-telemetry-from-the-server[Java SDK]
** xref:kotlin-sdk:howtos:collecting-information-and-logging.adoc#sdk-telemetry-from-the-server[Python SDK]
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python SDK link uses the kotlin-sdk component in the xref target. This should likely be python-sdk (or the link text should be changed to Kotlin) to avoid a broken/misdirected cross-reference.

Suggested change
** xref:kotlin-sdk:howtos:collecting-information-and-logging.adoc#sdk-telemetry-from-the-server[Python SDK]
** xref:python-sdk:howtos:collecting-information-and-logging.adoc#sdk-telemetry-from-the-server[Python SDK]

Copilot uses AI. Check for mistakes.




6 changes: 3 additions & 3 deletions modules/rest-api/partials/user-pw-host-port-params.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ The name of a user who has one of the roles listed in <<{priv-link}>>.
`PASSWORD`::
The password for the `user`.

`HOST`::
Hostname or IP address of a Couchbase Server.
`host`::
Hostname or IP address of a Couchbase Server node.

`PORT`::
`port`::
Port number for the REST API.
Comment on lines +8 to 12
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter-name placeholders were changed to host/port, but many existing REST API pages still use {HOST}/{PORT} in their curl examples (for example, disk-usage-limits.adoc). This makes the shared parameter list inconsistent with the rest of the docs; consider reverting to HOST/PORT (or documenting both) and aligning placeholder casing across pages.

Copilot uses AI. Check for mistakes.
Defaults are 8091 for unencrypted and 18901 for encrypted connections.