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

# MarkLogic

> MarkLogic cluster, database, forest, host, server, request, transaction, storage, and health metrics.

The MarkLogic integration requires CXDOT Collector 1.9.0 or greater.

[MarkLogic](https://www.progress.com/marklogic) is a multi-model database for
operational and transactional applications. Use the MarkLogic integration with the CXDOT
Collector to collect cluster, database, forest, host, server, request, transaction, and
storage metrics from MarkLogic servers running in your environment.

The MarkLogic integration supports MarkLogic 11.0 or greater.

## Supported telemetry types

The MarkLogic integration supports these telemetry types:

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

## Prerequisites

The MarkLogic integration has the following prerequisites:

* Make the
  [MarkLogic Management REST API](https://docs.marklogic.com/11.0/REST/management)
  reachable from the CXDOT Collector. The default port is `8002`.
* Create a MarkLogic monitoring user with the `manage-user` role. If you collect
  database and forest health metrics, assign the `manage-admin` role instead.
* Configure the Management REST API to accept HTTP Digest or HTTP Basic
  authentication.

## Configure

The MarkLogic integration is enabled by default. You can configure targets either by
annotating 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 MarkLogic pods in Kubernetes, add a CXDOT integration annotation to
   the pod template. The annotation key must end with the container name, and its value
   can reference credentials stored in a Kubernetes Secret in the same namespace. For
   example, add the following annotation to your MarkLogic workload:

   ```yaml theme={null}
   spec:
     template:
       metadata:
         annotations:
           integrations.cxdot.paloaltonetworks.com/marklogic: |
             schema_version: v1.14
             marklogic:
               endpoints:
                 - endpoint: ${target.host}:${target.port.manage}
               username: cxdot
               password: ${k8s_secret:marklogic-monitor/password}
       spec:
         containers:
           - name: marklogic
             image: marklogicdb/marklogic-db:11.2.0-ubi
             ports:
               - name: manage
                 containerPort: 8002
   ```

   The Collector replaces `${target.host}` with the pod IP address,
   `${target.port.manage}` with the container port named `manage`, and
   `${k8s_secret:marklogic-monitor/password}` with the `password` key of the
   `marklogic-monitor` Secret. To allow the Collector to read the Secret, add the pod's
   namespace to `apiServer.metadataServer.secretAllowlist` in the Helm values for your
   CXDOT Collector.

2. Optional: To collect from MarkLogic servers outside your Kubernetes cluster, configure
   static targets. In cluster mode, the leader-elected
   cluster Collector scrapes static targets. For more information, see
   [architecture](https://docs-xcor.paloaltonetworks.com/ingest/xcor/collector/install/kubernetes/architecture.md).
   Make the password available to the cluster Collector process. For example, add the
   following to `values.yaml` for your CXDOT Collector Helm chart:

   ```yaml theme={null}
   clusterCollector:
     extraEnv:
       - name: MARKLOGIC_PASSWORD
         valueFrom:
           secretKeyRef:
             name: marklogic-monitor
             key: password

   collection:
     cxdot:
       integrations:
         marklogic:
           endpoints:
             - endpoint: marklogic.example.com:8002
           auth_type: digest
           username: cxdot
           password: "${env:MARKLOGIC_PASSWORD}"
   ```

   A nonempty `endpoints` list disables annotation discovery for that integration
   instance. The CXDOT Collector collects from only the listed targets.

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

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         marklogic:
           enabled: true
         marklogic/external:
           endpoints:
             - endpoint: marklogic.example.com:8002
           auth_type: digest
           username: cxdot
           password: "${env:MARKLOGIC_PASSWORD}"
   ```

   The `marklogic/external` key defines a named integration instance for static
   targets. The bare `marklogic` key continues to discover pods. Make the
   `MARKLOGIC_PASSWORD` environment variable available to both Collector processes.

4. Optional: Collect database and forest health metrics after you assign the
   monitoring user the `manage-admin` role. For example, add the following to
   `values.yaml` for your CXDOT Collector Helm chart:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         marklogic:
           enable_health_metrics: true
   ```

5. Optional: Disable the integration. For example, add the following to `values.yaml`
   for your CXDOT Collector Helm chart:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         marklogic:
           enabled: false
   ```

Metrics from each discovered pod include that pod's Kubernetes metadata. For more
information, see
[autodiscovery](https://docs-xcor.paloaltonetworks.com/ingest/xcor/collector/discover/kubernetes.md).

### Validate

To validate the MarkLogic integration, follow these steps:

1. In
   [Live Telemetry Analyzer](https://docs-xcor.paloaltonetworks.com/investigate/analyze/telemetry-analyzer.md),
   filter for `__name__=cxdot.integration.target.health` and
   `cxdot.integration.name=marklogic`. Confirm that each reachable target reports `1`
   for `cxdot.integration.target.health`. A value of `0` means the Collector hit an error
   collecting from that target. The `server.address` and `server.port` attributes
   identify each target.

2. In
   [Metrics Explorer](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/explorer.md),
   run the following query while MarkLogic handles active requests:

   ```text theme={null}
   max by ("server.address", "server.port") ({"marklogic.cluster.request.active.count"})
   ```

   Confirm that the query returns a value greater than `0` for each target.

## Configuration reference

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

### Optional settings

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

* **`endpoints`**
  Type: `array of object`. Optional. Default: `[]`.
  MarkLogic Management REST API targets. Each entry can contain a `host:port` value or a full
  HTTP or HTTPS base URL. When this list isn't empty, the integration collects from exactly
  these targets instead of targets found through annotation discovery.

* **`endpoints[].endpoint`**
  Type: `string`. Required.
  MarkLogic Management REST API target as a `host:port` value or a full HTTP or HTTPS base URL.
  A `host:port` value uses HTTP.

* **`auth_type`**
  Type: `string`. Optional. Default: `digest`.
  Authentication method for the targets in `endpoints`. Set to `digest` for HTTP Digest
  authentication or `basic` for HTTP Basic authentication. Allowed values: `basic`, `digest`.

* **`username`**
  Type: `string`. Optional.
  MarkLogic username for the targets in `endpoints`.

* **`password`**
  Type: `string`. Optional.
  MarkLogic password for the targets in `endpoints`. The Collector masks this value in
  diagnostic output, logs, and errors.

* **`collection_interval`**
  Type: `duration`. Optional. Default: `15s`.
  Time between metric collections from each MarkLogic target.

* **`timeout`**
  Type: `duration`. Optional. Default: `10s`.
  Maximum time allowed to collect metrics from one MarkLogic target. The value must not exceed
  `collection_interval`.

* **`enable_health_metrics`**
  Type: `boolean`. Optional. Default: `false`.
  Whether to collect database and forest health states. If true, the integration queries
  `/manage/v2?view=health`, and the configured user must have the `manage-admin` role. If false,
  the integration doesn't query that endpoint or collect database and forest health metrics.

* **`resource_filters`**
  Type: `array of object`. Optional. Default: `[]`.
  The integration collects metrics for a resource only if it matches at least one inclusion rule
  and no exclusion rule. Exclusion rules take precedence over inclusion rules.

* **`resource_filters[].resource_type`**
  Type: `string`. Required.
  MarkLogic resource type to filter. Allowed values: `database`, `forest`, `host`, `server`.

* **`resource_filters[].pattern`**
  Type: `regex`. Required.
  Go regular expression matched against the resource name from the beginning.

* **`resource_filters[].include`**
  Type: `boolean`. Optional. Default: `true`.
  Whether matching resources are eligible for per-resource metric collection. If true, matching
  resources are eligible. If false, matching resources are excluded.

* **`resource_filters[].group`**
  Type: `string`. Optional. Default: empty string.
  Match only resources in this MarkLogic group. Leave empty to match resources in every group.

* **`tls`**
  Type: `object`. Optional.
  TLS certificate and client authentication settings for HTTPS MarkLogic Management REST API
  targets.

* **`tls.ca_file`**
  Type: `string`. Optional.
  Path to a PEM-encoded certificate authority (CA) certificate file used to verify the MarkLogic
  server certificate. If omitted, the Collector uses the system certificate authority pool.

* **`tls.ca_pem`**
  Type: `string`. Optional.
  PEM-encoded certificate authority certificate content used to verify the MarkLogic server
  certificate.

* **`tls.cert_file`**
  Type: `string`. Optional.
  Path to the PEM-encoded client certificate file to present when the MarkLogic target requires
  mutual TLS authentication.

* **`tls.cert_pem`**
  Type: `string`. Optional.
  PEM-encoded client certificate content to present when the MarkLogic target requires mutual
  TLS authentication.

* **`tls.cipher_suites`**
  Type: `array of string`. Optional.
  TLS cipher suites that the Collector can use, in preference order. If omitted, the Collector
  uses the secure defaults from the Go TLS library. For supported names, see
  [https://go.dev/src/crypto/tls/cipher\_suites.go](https://go.dev/src/crypto/tls/cipher_suites.go).

* **`tls.curve_preferences`**
  Type: `array of string`. Optional.
  Elliptic curves that the Collector can use for an elliptic curve Diffie-Hellman ephemeral
  handshake, in preference order. If omitted, the Collector uses the Go TLS library defaults.

* **`tls.include_system_ca_certs_pool`**
  Type: `boolean`. Optional.
  Whether to add certificates from the system certificate authority pool to the configured
  certificate authorities. If true, the Collector trusts both sources. If false, the Collector
  trusts only the configured certificate authorities.

* **`tls.insecure`**
  Type: `boolean`. Optional.
  Whether to disable transport security. If true, the Collector uses an unencrypted connection.
  If false, the endpoint scheme controls whether the connection uses TLS.

* **`tls.insecure_skip_verify`**
  Type: `boolean`. Optional.
  Whether to skip verification of the MarkLogic server certificate. If true, the connection is
  encrypted but isn't authenticated and is vulnerable to man-in-the-middle attacks. If false,
  the Collector verifies the certificate.

* **`tls.key_file`**
  Type: `string`. Optional.
  Path to the PEM-encoded client private key file used with `cert_file` for mutual TLS
  authentication.

* **`tls.key_pem`**
  Type: `string`. Optional.
  PEM-encoded client private key content used with `cert_pem` for mutual TLS authentication.

* **`tls.max_version`**
  Type: `string`. Optional.
  Maximum TLS protocol version the Collector can use. If omitted, the Collector uses the maximum
  version supported by the Go TLS library.

* **`tls.min_version`**
  Type: `string`. Optional.
  Minimum TLS protocol version the Collector can use. If omitted, the minimum version is TLS
  1.2.

* **`tls.reload_interval`**
  Type: `duration`. Optional.
  How often the Collector reloads certificate and key files. If omitted, the Collector doesn't
  reload the files.

* **`tls.server_name_override`**
  Type: `string`. Optional.
  Server name to verify in the MarkLogic certificate instead of the endpoint hostname. Use this
  setting when the certificate name differs from the endpoint hostname.

* **`tls.tpm`**
  Type: `object`. Optional.
  Trusted platform module settings for the TLS private key.

* **`tls.tpm.auth`**
  Type: `string`. Optional.
  Authorization value for the trusted platform module key.

* **`tls.tpm.enabled`**
  Type: `boolean`. Optional.
  Whether to use a trusted platform module for the TLS private key. If true, the Collector loads
  the key from the configured device or socket. If false, the Collector uses the configured key
  file or in-memory key.

* **`tls.tpm.owner_auth`**
  Type: `string`. Optional.
  Owner authorization value for the trusted platform module.

* **`tls.tpm.path`**
  Type: `string`. Optional.
  Path to the trusted platform module device or Unix domain socket, such as `/dev/tpm0` or
  `/dev/tpmrm0`.


## Related topics

- [CXDOT Collector integrations](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/collector.md)
- [Sumo Logic destination plugin](https://docs-xcor.paloaltonetworks.com/ingest/pipeline/plugins/destination-plugins/sumologic.md)
- [Use Markdown in Cortex XCOR](https://docs-xcor.paloaltonetworks.com/overview/concepts/markdown.md)
- [Document dashboards with Markdown panels](https://docs-xcor.paloaltonetworks.com/observe/dashboards/panels/markdown.md)
- [Metrics Explorer](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/explorer.md)


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