Overview

There are two primary ways of monitoring PSPDFKit Server: logs and metrics.

Logs

PSPDFKit Server is packaged as a Docker container, which allows you to use standardized Docker tooling to capture logs written by Server to the standard output. In addition, if you deploy Server in the cloud, all major cloud providers offer support for logs emitted by Docker containers running on their infrastructure with their log aggregation systems.

See the following:

Correlating Logs Using a Request ID

Log messages associated with HTTP requests are marked with a request_id=<request-id> label. Logs correlated with the same request have the same request ID. This helps you determine which request triggered a specific response and what errors or warnings were emitted during request processing.

Here’s an example request and response log with a matching request ID:

[info]  2021-02-05 12:00:34.097  POST /api/documents request_id=FmDYakNs2xDF1NkAAASC
[info]  2021-02-05 12:00:34.168  Sent 200 in 70ms request_id=FmDYakNs2xDF1NkAAASC

You can also customize the request_id label by providing your own ID via the X-Request-Id request header. The custom request ID needs to be between 20 and 200 characters long.

Metrics

Similar to how it works with logs, Docker allows you to gather system-level metrics about running containers, like CPU usage, memory consumption, block device IO, etc. AWS, Google Cloud Platform, and Azure all offer solutions to collect these metrics from containers launched on their respective infrastructures.

See the following:

Since version 2020.5.0, Server provides the capability to send internal metrics to any metrics engine supporting the DogStatsD protocol, which is an extension of the popular StatsD protocol. Internal metrics offer more fine-grained insights into Server performance and help to pinpoint specific issues. Check out our Metrics Integration guide for instructions on how to enable internal Server metrics when running on-premises or in the cloud. The list of all exported metrics is available here.