Custom Metrics API Example

A complete, runnable script that injects a dimensional custom metric into Pelanor using Python.

With Custom Metrics, you can inject additional metrics from observability or BI platforms—such as Prometheus or QuickSight—into Pelanor.
Once added, these metrics can be used for:

  • Unit‑economics reports: e.g., add a Daily Active Users metric to view Cost per Active User.
  • Context‑enriched cost reports: e.g., add RAM‑usage data per EC2 instance.

Pelanor automatically collects many metrics (CPU, memory, network utilization, and more) through built‑in integrations. Before adding custom metrics, check with your Pelanor Solution Engineer.

Typical Flow

1

Create a Custom Metric

Declare the metric via the Create Custom Metric endpoint. This step is one‑time only; initial creation can take up to 1–2 hours. Track progress and manage metrics in Economics → Custom Metrics.

2

Push Metric Data

Use the Update Metric endpoint to insert data, referencing the metric ID returned earlier. Set the update frequency (daily, weekly, etc.) according to your SLA and data‑volume needs.

3

Consume the Metric

You can now use the metric in several ways:

  • Add to a report: Customize Columns → Add Metric → Custom Metrics.
  • View in the dashboard: Economics → Custom Metrics, then select the metric.
  • Retrieve via API: call Get Custom Metric Values to fetch the data programmatically.

Examples

Visit the example repo above for a full Python walkthrough of adding a dimensional custom metric to Pelanor.