Prometheus
Ingesting Meters with Prometheus Remote Write
Amberflo supports ingesting metrics directly from Prometheus using its native remote write functionality. This enables real-time ingestion of usage data as meter events, allowing you to monitor and allocate infrastructure costs with precision.
This approach works particularly well for environments where Prometheus is already deployed, such as in Kubernetes clusters, but it is not limited to Kubernetes. You can send any relevant Prometheus metrics from your infrastructure or applications.
Why Use Prometheus for Meter Ingestion?
- Low-lift integration: No custom agent or Amberflo library required. Simply configure remote_write in Prometheus.
- Real-time metering: Prometheus pushes events directly to Amberflo as they are generated.
- Flexible attribution: Use dimensions like namespace, node, tenant, or application to enable fine-grained usage tracking and cost allocation.
- Custom metrics: Supports ingestion of both built-in system metrics and any custom metrics sent to Prometheus from your IT environment.
Example Use Case: Kubernetes
Prometheus is often used to monitor Kubernetes clusters. With Amberflo, you can ingest metrics such as:
- Kube-state metrics: For example, pod states, resource requests, and limits.
- Node metrics: CPU, memory, disk, and I/O usage from underlying nodes.
- Kubelet metrics: Container-level metrics like actual resource consumption.
- Custom application metrics: Data sent to Prometheus by in-cluster apps.
Amberflo uses the namespace label as the customerId by default, which allows for accurate cost allocation by namespace (or by other dimensions if preferred).
To use Prometheus remote write with Amberflo, you need the following:
You provide:
- Any Prometheus-monitored system (e.g. a Kubernetes cluster)
- Prometheus deployed and collecting metrics
- Outbound internet access from Prometheus
Amberflo provides:
- An API to accept the remote write
- Ability to set custom ingestion schema for metric data
Prometheus Remote Write Configuration
Below is an example configuration snippet to enable remote_write in your Prometheus setup:
remote_write:
- url: https://app.amberflo.io/ingest/prometheus
name: amberflo
write_relabel_configs:
- source_labels: [__name__, pod]
separator: ":"
regex: 'kube_pod_info:coredns(.+)'
action: keep
- action: replace
source_labels: [namespace]
target_label: customerId
- regex: 'customerId|node|pod|helm_sh_chart|__name__'
action: labelkeep
headers:
x-api-key: XXX-XXX-XXXThis configuration:
- Keeps only relevant metrics based on name and pod.
- Maps the Prometheus namespace label to Amberflo’s customerId.
- Limits which labels are sent to Amberflo for ingestion.
- Authenticates using your Amberflo API key.