# Class TelemetryConstants (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public class TelemetryConstants

Internal telemetry constants shared between OpenTelemetry tracing and metrics.

**Warning:** This is intended to be an internal API and is not intended for external use.
This is public solely for implementation purposes and does not promise any backwards
compatibility.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> TelemetryConstants

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### ATTRIBUTES_KEY_DATABASE_ID

    public static final String ATTRIBUTES_KEY_DATABASE_ID

Attribute key for the Datastore database ID.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_DEFERRED

    public static final String ATTRIBUTES_KEY_DEFERRED

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_DOCUMENT_COUNT

    public static final String ATTRIBUTES_KEY_DOCUMENT_COUNT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_METHOD

    public static final String ATTRIBUTES_KEY_METHOD

Attribute key for the RPC method name (e.g. "Transaction.Run").

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_MISSING

    public static final String ATTRIBUTES_KEY_MISSING

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_MORE_RESULTS

    public static final String ATTRIBUTES_KEY_MORE_RESULTS

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_PROJECT_ID

    public static final String ATTRIBUTES_KEY_PROJECT_ID

Attribute key for the GCP project ID.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_READ_CONSISTENCY

    public static final String ATTRIBUTES_KEY_READ_CONSISTENCY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_RECEIVED

    public static final String ATTRIBUTES_KEY_RECEIVED

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_SERVICE

    public static final String ATTRIBUTES_KEY_SERVICE

String key for the `service` metric attribute (value: `"service"`).

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_STATUS

    public static final String ATTRIBUTES_KEY_STATUS

Attribute key for the gRPC status code (e.g. "OK", "ABORTED", "UNAVAILABLE").

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_TRANSACTIONAL

    public static final String ATTRIBUTES_KEY_TRANSACTIONAL

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### ATTRIBUTES_KEY_TRANSACTION_ID

    public static final String ATTRIBUTES_KEY_TRANSACTION_ID

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### CLIENT_UID_KEY

    public static final AttributeKey<String> CLIENT_UID_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### COMMON_ATTRIBUTES

    public static final Set<AttributeKey<?>> COMMON_ATTRIBUTES

The allowlist of metric attributes that are permitted on every exported data point.

Cloud Monitoring is strict about label schemas: exporting a label that was not present when
the metric descriptor was first created will cause the entire `createTimeSeries` call to
fail. Only `status`, `method`, `service`, and `client_uid` are
accepted; all other attributes must be omitted from every `record*()` call.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<io.opentelemetry.api.common.AttributeKey<?>>` |   |

### DATABASE_ID_KEY

    public static final AttributeKey<String> DATABASE_ID_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### DATASTORE_METER_NAME

    public static final String DATASTORE_METER_NAME

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### DATASTORE_RESOURCE_LABELS

    public static final Set<String> DATASTORE_RESOURCE_LABELS

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### DATASTORE_RESOURCE_TYPE

    public static final String DATASTORE_RESOURCE_TYPE

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### GAX_HISTOGRAM_METRICS

    public static final Set<String> GAX_HISTOGRAM_METRICS

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### GAX_METRICS

    public static final Set<String> GAX_METRICS

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### GAX_METRIC_NAME_MAP

    public static final Map<String,String> GAX_METRIC_NAME_MAP

Mapping from the singular metric names recorded by the GAX library to the pluralized metric
names required by the internal Cloud Monitoring metric descriptors.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### LOCATION_ID_KEY

    public static final AttributeKey<String> LOCATION_ID_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### METHOD_ALLOCATE_IDS

    public static final String METHOD_ALLOCATE_IDS

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_BEGIN_TRANSACTION

    public static final String METHOD_BEGIN_TRANSACTION

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_COMMIT

    public static final String METHOD_COMMIT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_KEY

    public static final AttributeKey<String> METHOD_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### METHOD_LOOKUP

    public static final String METHOD_LOOKUP

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_RESERVE_IDS

    public static final String METHOD_RESERVE_IDS

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_ROLLBACK

    public static final String METHOD_ROLLBACK

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_RUN_AGGREGATION_QUERY

    public static final String METHOD_RUN_AGGREGATION_QUERY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_RUN_QUERY

    public static final String METHOD_RUN_QUERY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_TRANSACTION_COMMIT

    public static final String METHOD_TRANSACTION_COMMIT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METHOD_TRANSACTION_RUN

    public static final String METHOD_TRANSACTION_RUN

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_ATTEMPT_COUNT

    public static final String METRIC_NAME_ATTEMPT_COUNT

Metric name for the count of RPC attempts.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_ATTEMPT_LATENCY

    public static final String METRIC_NAME_ATTEMPT_LATENCY

Metric name for the latency of a single RPC attempt.

See [#METRIC_NAME_OPERATION_LATENCY](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.telemetry.TelemetryConstants#com_google_cloud_datastore_telemetry_TelemetryConstants_METRIC_NAME_OPERATION_LATENCY) for the singular/plural naming rationale. The
built-in Cloud Monitoring export renames this to `attempt_latencies` via an OTel View.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_OPERATION_COUNT

    public static final String METRIC_NAME_OPERATION_COUNT

Metric name for the count of operations.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_OPERATION_LATENCY

    public static final String METRIC_NAME_OPERATION_LATENCY

Metric name for the total latency of an operation (one full RPC call including retries).

**Singular/plural naming:** This constant uses the singular form (`
operation_latency`) to match the name recorded by the GAX layer and used by custom OTel
backends (e.g., an in-memory reader in tests). The built-in Cloud Monitoring export path
renames the metric to the plural form (`operation_latencies`) via an OTel View in DatastoreBuiltInMetricsView. This split is intentional and consistent with other Google Cloud
client libraries.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_SHORT_ATTEMPT_COUNT

    public static final String METRIC_NAME_SHORT_ATTEMPT_COUNT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_SHORT_ATTEMPT_LATENCIES

    public static final String METRIC_NAME_SHORT_ATTEMPT_LATENCIES

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_SHORT_ATTEMPT_LATENCY

    public static final String METRIC_NAME_SHORT_ATTEMPT_LATENCY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_SHORT_OPERATION_COUNT

    public static final String METRIC_NAME_SHORT_OPERATION_COUNT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_SHORT_OPERATION_LATENCIES

    public static final String METRIC_NAME_SHORT_OPERATION_LATENCIES

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_SHORT_OPERATION_LATENCY

    public static final String METRIC_NAME_SHORT_OPERATION_LATENCY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_TRANSACTION_ATTEMPT_COUNT

    public static final String METRIC_NAME_TRANSACTION_ATTEMPT_COUNT

Metric name for the number of attempts a transaction took.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_NAME_TRANSACTION_LATENCY

    public static final String METRIC_NAME_TRANSACTION_LATENCY

Metric name for the total latency of a transaction.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### METRIC_PREFIX

    public static final String METRIC_PREFIX

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### PROJECT_ID_KEY

    public static final AttributeKey<String> PROJECT_ID_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### RESOURCE_LABEL_DATABASE_ID

    public static final String RESOURCE_LABEL_DATABASE_ID

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### RESOURCE_LABEL_LOCATION

    public static final String RESOURCE_LABEL_LOCATION

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### RESOURCE_LABEL_PROJECT_ID

    public static final String RESOURCE_LABEL_PROJECT_ID

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### SERVICE_KEY

    public static final AttributeKey<String> SERVICE_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### SERVICE_VALUE

    public static final String SERVICE_VALUE

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### STATUS_KEY

    public static final AttributeKey<String> STATUS_KEY

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.AttributeKey<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |