> ## 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.

# Configure services

> Set up service discovery, presentations, and SLOs in Palo Alto Networks Cortex XCOR.

> [!NOTE]
>
> This feature isn't available to all Palo Alto Networks Cortex XCOR users and
> might not be visible in your app. For information about enabling this feature in your
> environment, contact [Cortex XCOR Support](https://docs-xcor.paloaltonetworks.com/support.md).

Configure [service discovery jobs](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md), merge rules, and
presentations on the **Service Configuration** page in Palo Alto Networks Cortex XCOR so that
[Services](https://docs-xcor.paloaltonetworks.com/observe/services) show the right metrics, monitors,
dashboards, and SLOs. All users can view service configurations and preview changes.
Only users with
[SysAdmin permissions](https://docs-xcor.paloaltonetworks.com/administer/accounts-teams/teams.md#add-a-role-to-a-team) can
save new or edit existing service configurations.

> [!NOTE]
>
> Prefer a guided lab? Take [Configuring Services with Lens](https://docs-xcor.paloaltonetworks.com/academy/courses/configuring-services-with-lens.md) to walk through discovery,
> merge rules, presentations, and pod mapping step by step.

## Before you start

To open the [Service Configuration](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#view-service-configuration)
page, in the navigation menu, click ** Go to admin view**
and then select
**Platform > Service Configuration**.
Gather details about the services your teams expect to see:

* Important service names and naming patterns
* Technologies in use, such as gRPC, HTTP, Istio, or Kubernetes
* Rough count of services
* Metric sources, such as Prometheus exporters or OpenTelemetry

## Configure discovery

Discovery jobs match metrics and events to services. Follow the procedures for enablement, label
mapping, and apply in that order before moving to merge rules.

### Apply staged changes

On the **Service Configuration** page, edits accumulate until you apply them. After each
edit, click **Stage changes**. When a set of changes is ready, click
**Review & apply changes**, then and then follow the procedures described in
[Preview and apply discovery](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#preview-and-apply-changes).
Repeat this cycle after discovery jobs, merge rules, and presentations.

### Review discovery jobs

*Discovery jobs* are templates that match metrics and events to a discovered service.
On the **Discovery jobs** tab, enable jobs whose **Services discovered** count looks
reasonable for your environment. Jobs in the **Managed by** column are managed by
Cortex XCOR and aren't editable.
[Create your own jobs](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#create-a-discovery-job) when
defaults don't match your metric prefixes or labels, or
[edit or delete a job](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#edit-or-delete-a-discovery-job)
when an existing job needs changes.

Don't enable every default job at once if default label mappings don't match your
metrics.

### Customize service label mappings

When a job discovers too many or too few services, update **Service mapping** in the
job's [edit form](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#edit-or-delete-a-discovery-job).

* Use [**Service label**](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#create-a-discovery-job) when
  the metric in **Metric name** already includes a service name label.
* Use [**Pod mapping**](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#create-a-discovery-job) as an
  advanced option when metrics lack a service label but include a pod or instance
  label that can join with a label in
  [Global mappings](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#global-mappings). Review the
  **Global mapping** button on **Service Configuration** before pod mapping when your
  metrics use pod labels. Pod mapping can overmatch. Pair it with a
  [**Suppress** rule](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#create-a-merge-rule) when needed.

For metrics discovery jobs, optionally use
[Edit SLO config](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#edit-slo-config) to map availability
and latency metrics before you apply discovery changes.

Label names vary across environments. The same concept might appear as `pod`,
`pod_name`, `kubernetes_pod_name`, or `k8s_pod_name`. Review your metrics in
[Metrics Explorer](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/explorer.md) before choosing a mapping.

### Preview and apply discovery

After you [apply staged changes](#apply-staged-changes) for discovery jobs, the preview
uses `+`, `-`, and `*` for added, inactivated, and modified services. A removal can
mean a service was merged, reassigned, or excluded by a rule.

After you run discovery, review
[Configuration Status](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#configuration-status) on
**Service Configuration** for discovery job errors or conflicts.

## Clean up the service list

Discovery surfaces every name that matches your rules, including legacy naming
schemes, environment suffixes, and ephemeral workloads. Use
[*merge rules*](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#use-merge-rules-to-correct-or-remove-services)
on the **Merge rules** tab to shape the list into the services your teams recognize.

Merge rules apply from top to bottom of the list. A service matches the first rule
that applies to it and won't match additional rules. Drag rules to change their
order. [Create a merge rule](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#create-a-merge-rule)
using one of these types:

* **Merge:** Combine services that differ only by environment suffix. For example,
  merge `payments-prod`, `payments-dev`, and `payments-load` into `payments` so teams
  use one [service page](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md) instead of separate pages per
  environment.
* **Ignore:** Exclude short-lived containers or batch jobs that change too often to
  keep on the list. Match the naming pattern with a
  [regular expression](https://docs-xcor.paloaltonetworks.com/investigate/querying/regular-expressions.md) in the rule's
  **Regex** field.
* **Suppress:** Stop a discovery job from creating new service names while still
  attaching its metrics to services already on the list.

A common suppress pattern example might be where cAdvisor compute metrics have no
app label, so the **Compute Metrics** discovery job uses `namespace` as the service
label. That label includes many values that aren't services. Suppress that job and
list the real service names as **Global Suppression Exceptions** so the job only
attaches metrics to services already discovered by another job.

[Apply staged changes](#apply-staged-changes) after creating or editing rules.

## Configure presentations

Presentations are templates for how service data displays on a
[service page](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md). Cortex XCOR provides
default presentations in [**Cortex XCOR Managed**](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#presentations).
Create your own in
[**Custom Presentations**](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#create-a-presentation).

When you import a dashboard, map its service variable to the
[`lens_service`](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/derived-telemetry/derived-labels)
derived label so panels filter to the current service.

Each presentation card displays **Number of Services** and **Number of panels**.
Adjust matching conditions if those counts don't match expectations, or click a card to
[edit a presentation](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md#edit-a-presentation).

[Apply staged changes](#apply-staged-changes) after editing presentations.

## Connect monitors, dashboards, and SLOs

After discovery and presentations are stable, connect operational resources to
each service.

### Connect monitors and dashboards

On a [service page](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md), click **Manage** next to
**Dashboards** or **All monitors** to add
[owned dashboards and monitors](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md#own-dashboards-and-monitors)
or [connected resources](https://docs-xcor.paloaltonetworks.com/observe/services/extending-services.md#view-connected-resources).
Owned resources affect the service's [status](https://docs-xcor.paloaltonetworks.com/observe/services#service-status) on the
**Services** list. Add a **Description**, runbook links, and a
[notification policy](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/policies.md) in
[Edit service information](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md#edit-service-information).

### Create SLOs

After service pages show the metrics you want to measure, create
[service level objectives](https://docs-xcor.paloaltonetworks.com/observe/slo.md) (SLOs). On a
[service page](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md), click **+ Add** and select **SLO**.
The service is already selected as the owner.

For queryless RPC and gRPC SLOs, burn rate alerts, and other creation paths, see
[Create a new SLO](https://docs-xcor.paloaltonetworks.com/investigate/alerts/manage-slos.md#create-a-new-slo).

## Configure org-wide label filters

*Org-wide label filters* define PromQL labels that users can filter on from
[service pages](https://docs-xcor.paloaltonetworks.com/observe/services/service-pages.md#filter-metrics). Each filter
limits which label values Cortex XCOR resolves for that label and can inject the
label into supported queries.

Users with
[SysAdmin permissions](https://docs-xcor.paloaltonetworks.com/administer/accounts-teams/teams.md#add-a-role-to-a-team) create,
edit, and delete org-wide label filters. Other users can view the list on the
**Variables** tab.

1. Open [Service Configuration](#before-you-start).
2. Select the **Variables** tab.
3. Review configured filters in the table. Use **Search variables** to find a
   label by name.

### Add an org-wide label filter

1. On the **Variables** tab, click **Add variable**.
2. Configure the following fields:
   * **Label name**: A valid PromQL label. Cortex XCOR uses the label to resolve
     values and inject the label into queries.
   * **Series selector**: A PromQL series selector that limits the resolved label
     values. The list below the fields updates as you edit the label name and
     series selector.
   * **Default value**: An optional default when the filter is applied.
3. Click **Save** in the drawer.
4. [Apply staged changes](#apply-staged-changes) so the filter is available on
   service pages.

### Edit or delete an org-wide label filter

To edit a filter, click **Edit variable** in the row for that label, update the
fields, and save the drawer. To delete a filter, click **Delete variable** in the
row, confirm the deletion, and [apply staged changes](#apply-staged-changes).

If a derived label uses the same PromQL label name as an org-wide filter, queries
honor both the derived label mapping and the filter. See
[Derived labels](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/derived-telemetry/derived-labels.md)
for details.

## Verify the result

To verify your changes, in the navigation menu, select
**Services Services**
to open the **Services** list. Confirm the following:

* Service names match what your teams expect.
* The **Presentations** column lists the presentations attached to each service.
* Clicking a service name opens [visualization panels](https://docs-xcor.paloaltonetworks.com/observe/dashboards/panels)
  for compute metrics, RPC metrics, and any custom presentations you configured.
* Monitors, dashboards, and SLOs appear in the sidebar and main column.

For end-user investigation workflows after setup, see
[Service exploration](https://docs-xcor.paloaltonetworks.com/observe/services/service-exploration.md).

## Troubleshooting

If setup doesn't look right, return to the relevant section on this page. For
field-level reference, see
[Manage service configuration](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md).

| Symptom | Sections to review |
| - | - |
| Too many services | [Review discovery jobs](#review-discovery-jobs), [Customize service label mappings](#customize-service-label-mappings), [Clean up the service list](#clean-up-the-service-list) |
| Too few services | [Review discovery jobs](#review-discovery-jobs), [Customize service label mappings](#customize-service-label-mappings), [Preview and apply discovery](#preview-and-apply-discovery) |
| Names differ across metrics, traces, and logs | [Customize service label mappings](#customize-service-label-mappings), [Clean up the service list](#clean-up-the-service-list). The [`lens_service`](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/derived-telemetry/derived-labels) derived label on metrics won't match trace service names until discovery and merge rules produce a consistent name. |
| Changes missing from service pages | [Preview and apply discovery](#preview-and-apply-discovery), [Configure presentations](#configure-presentations). Enable **Include inactive services** on the [Services](https://docs-xcor.paloaltonetworks.com/observe/services) list to review phased-out services. |


## Related topics

- [Cortex XCOR guides](https://docs-xcor.paloaltonetworks.com/overview/guides.md)
- [Services](https://docs-xcor.paloaltonetworks.com/observe/services.md)
- [Manage service configuration](https://docs-xcor.paloaltonetworks.com/administer/service-discovery.md)
- [Kubernetes Collector installation to retrieve metrics](https://docs-xcor.paloaltonetworks.com/ingest/metrics-traces/collector/install/kubernetes.md)
- [Improve investigation quality](https://docs-xcor.paloaltonetworks.com/investigate/investigations/feedback.md)


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