Skip to main content
Version: 0.10.x

Integrate with Datadog

Lunar Proxy can export metrics to Datadog for monitoring and alerting purposes. To do so, you need to configure Lunar Proxy to expose the metrics, and configure Datadog Agent to scrape the metrics.

1. Configure Lunar Proxy to Expose Metrics

To configure Lunar Proxy to expose metrics, you need to configure a metrics collector diagnosis plugin. This is done by adding the following to your /etc/lunar-proxy/policies.yaml file (see Customize & Configure for more information):

diagnosis:
- enabled: true
name: "Global Metrics Collector"
export: "prometheus"
config:
metrics_collector: {}

The diagnosis plugin should be configured either under the global section or under a specific endpoint in the endpoints section. See the Metrics Collector documentation for more information.

note

Some metrics will only appear if a specific remedy plugin is enabled (see the Metrics section below).


2. Configure Datadog Agent to Scrape Metrics

To configure Datadog Agent to scrape Lunar Proxy metrics, you need to configure the Datadog Agent's conf.d/openmetrics.d/conf.yaml file to include the following:

instances:
- prometheus_url: http://<lunar-proxy-hostname>:3000/metrics
namespace: <lunar-proxy-namespace>
metrics: ["*"]

See the Datadog documentation for more information.


Companion Datadog Dashboard

The following dashboard can be imported into your Datadog account to visualize the metrics exported by Lunar Proxy:

Download the Datadog dashboard JSON from here.

To import the dashboard, follow the instructions here.

note

Some of the metrics will only appear if the relevant plugin is enabled. All metrics require traffic to flow through Lunar Proxy in order to appear.

Metrics

The following metrics are exposed by Lunar Proxy:

Metric NameDescriptionLabelsDepends On
General
lunar_transaction_countThe number of transactions that have passed through Lunar Proxymethod, normalized_url, status_code, request_<header_name>Metrics Collector
lunar_transaction_sumSum of transaction durationsmethod, normalized_url, status_code, request_<header_name>Metrics Collector
lunar_transaction_bucketBuckets of transaction durationsmethod, normalized_url, status_code, request_<header_name>Metrics Collector
Throttling
lunar_remedies_strategy_based_throttling_quota_limitThe quota limit of a strategy-based throttling remedyremedy_nameStrategy-Based Throttling
lunar_remedies_strategy_based_throttling_quota_usedThe quota used of a strategy-based throttling remedyremedy_name, group_idStrategy-Based Throttling
Queue
lunar_remedies_strategy_based_queue_requests_totalThe total number of requests that have been queued and handledpriority, remedy, ttl_passedQueue
lunar_remedies_strategy_based_queue_requests_in_queueThe number of requests that are currently in the queuepriority, remedyQueue
CTRL + M