> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Temporal

> Temporal request, workflow, task, and persistence metrics.

The Temporal integration requires CXDOT Collector 1.4.0 or greater.

[Temporal](https://temporal.io/) is a platform for running workflows and activities.
Use the Temporal CXDOT Collector integration with the CXDOT Collector to collect
request, workflow, task, and persistence metrics from Temporal servers running in
your environment.

## Supported telemetry types

The Temporal CXDOT Collector integration supports these telemetry types:

| Type | Supported |
| - | - |
| Logs | No |
| Metrics | Yes |
| Traces | No |
| Events | No |

## Prerequisites

The Temporal CXDOT Collector integration has the following prerequisites:

* Configure the Temporal frontend, history, matching, and worker server roles that
  you want to monitor to expose a Prometheus metrics endpoint.
* Make each Prometheus metrics endpoint reachable from the collector.

## Configure

The Temporal integration is enabled by default. You can configure targets either by
annotating server pods in your Kubernetes cluster or by listing static endpoints in your
Helm values. To configure the integration, follow these steps:

1. To collect from Temporal server pods in Kubernetes, add a CXDOT integration
   annotation to the pod template of each server role, such as the frontend. The
   annotation key must end with the container name. For example, add the following
   annotation to your Temporal frontend workload:

   ```yaml theme={null}
   spec:
     template:
       metadata:
         annotations:
           integrations.cxdot.paloaltonetworks.com/temporal-frontend: |
             schema_version: v1.14
             temporal:
               endpoints:
                 - endpoint: ${target.host}:${target.port.metrics}
       spec:
         containers:
           - name: temporal-frontend
             image: temporalio/server:1.28.0
             ports:
               - name: metrics
                 containerPort: 9090
   ```

   The Collector replaces `${target.host}` with the pod IP address and
   `${target.port.metrics}` with the container port named `metrics`.

2. Optional: To collect from Temporal servers outside your Kubernetes cluster,
   configure static targets. For example, add the following to the `values.yaml` for
   your CXDOT Collector Helm chart:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         temporal:
           endpoints:
             - endpoint: temporal.example.com:9091
   ```

   When you configure static targets, this integration instance collects from exactly
   those targets and stops reading CXDOT integration annotations.

3. Optional: Configure a second integration instance to collect from both annotated
   pods and static targets. For example, add the following to the `values.yaml` for
   your CXDOT Collector Helm chart:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         temporal: {}
         temporal/external:
           endpoints:
             - endpoint: temporal.example.com:9091
   ```

   The `temporal/external` key defines a named instance for the static targets. The
   bare `temporal` key continues to collect from annotated pods.

For more information about how the CXDOT Collector discovers targets, see
[autodiscovery](https://docs-xcor.paloaltonetworks.com/ingest/xcor/collector/discover/kubernetes.md).

### Validate

To validate the Temporal CXDOT Collector integration, follow these steps:

1. In [Live Telemetry Analyzer](https://docs-xcor.paloaltonetworks.com/investigate/analyze/telemetry-analyzer.md),
   filter for `cxdot.integration.name=temporal`. Confirm that
   `cxdot.integration.target.health` reports `1` for each scrape target you expect.

2. In [Metrics Explorer](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/explorer.md),
   run the following query while Temporal processes workflow operations:

   ```text theme={null}
   sum by ("url.full", "service_name") (rate({"temporal.server.service.requests"}[$__rate_interval]))
   ```

   Confirm that the query returns the expected time series for each server role that
   processes requests.

## Configuration reference

Configure one Temporal integration instance with the following settings. In Helm values, place
these settings under `collection.cxdot.integrations.temporal`. In a Collector configuration
file, place them under `cxdot.integrations.temporal`.

### Optional settings

* **`enabled`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to enable this Temporal integration instance. If true, the Collector collects Temporal
  metrics. If false, the Collector doesn't run this integration instance.

* **`endpoints`**
  Type: `array of object`. Optional. Default: `[]`.
  Temporal server Prometheus endpoints to monitor. Specify a full HTTP or HTTPS URL, or use
  `host:port` format to request the `/metrics` path over HTTP.

* **`endpoints[].endpoint`**
  Type: `string`. Required.
  Temporal server Prometheus endpoint as a full HTTP or HTTPS URL or in `host:port` format. For
  `host:port`, the Collector requests the `/metrics` path over HTTP.

* **`collection_interval`**
  Type: `duration`. Optional. Default: `15s`.
  How often the integration collects metrics from each Temporal endpoint.

* **`timeout`**
  Type: `duration`. Optional. Default: `10s`.
  Maximum time allowed to collect metrics from a Temporal endpoint during one interval. The
  value must be greater than zero.

* **`max_samples`**
  Type: `integer`. Optional. Default: `0`. Minimum: `0`.
  Maximum number of samples accepted from one metric collection. A value of `0`, the default,
  means no limit. A collection that exceeds the limit fails and reports `up` as `0` instead of
  returning an incomplete set of samples.

* **`follow_redirects`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to follow HTTP redirects. If true, the Collector follows redirects. If false, a
  redirect causes the metric collection to fail.

* **`metrics`**
  Type: `object`. Optional.
  Settings that control which Temporal metrics the integration collects and how it names them.

* **`metrics.include`**
  Type: `array of string`. Optional. Default: `[]`.
  Regular expressions for exposed metric names to collect in addition to the integration's
  default metric set.

* **`metrics.exclude`**
  Type: `array of string`. Optional. Default: `[]`.
  Regular expressions for exposed metric names to drop. Exclusions are applied before metric
  renaming and take precedence over `include`.

* **`metrics.rename`**
  Type: `object`. Optional. Default: `{}`.
  Mapping of exposed metric names to new metric names. These mappings take precedence over the
  integration's default metric names.

* **`labels`**
  Type: `object`. Optional.
  Settings that drop metric samples based on their label values, and rename labels.

* **`labels.rename`**
  Type: `object`. Optional. Default: `{}`.
  Label renames, as `{old: new}`. A rename changes the label name without removing the label, so
  distinct time series remain distinct. Renaming a label to a name the time series already has
  overwrites that label's value. Temporal's own label names pass through unchanged unless
  renamed here.

* **`labels.sample_drop_rules`**
  Type: `object`. Optional. Default: `{}`.
  Drops a whole sample when one of its labels matches. Each key is a label name. The value is a
  list of regular expressions matched against the label's value. To drop every sample the label
  appears on with a non-empty value, use `".+"`.


## Related topics

- [Querying delta temporality metrics](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/delta-queries.md)
- [Long-term downsampling](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/downsampling.md)
- [CXDOT Collector integrations](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/collector.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.