Metrics

Observability Last updated: Nov 15, 2024 â€ĸ Reading time: 8 min

CloudNexus Metrics provides high-resolution, multi-dimensional time-series data for all compute, storage, and networking resources. Metrics are automatically collected at 1-minute intervals (standard) or 15-second intervals (high-resolution) and are available for querying, alerting, and dashboarding.

â„šī¸ Information
Metrics retention is tiered based on resolution. Standard metrics are retained for 1 year, while high-resolution metrics are retained for 30 days unless you opt into the Premium Telemetry tier.

Overview

Every resource provisioned in your CloudNexus account automatically ships metrics to the Observability pipeline. No agents are required for infrastructure-level metrics. For application-level metrics, we support OpenTelemetry, Datadog, and Prometheus Exporter formats.

Metrics are indexed by resource tags, making it trivial to filter by environment=production, service=api-gateway, or region=us-east-1.

Supported Metric Types

Metric Name Type Unit Description
cpu.utilization Gauge Percentage Overall CPU usage across all cores (0-100)
memory.usage_bytes Gauge Bytes Total physical memory consumed by the instance
network.rx_bytes Counter Bytes Bytes received on all network interfaces
disk.io_ops Counter Operations Read/write IOPS for attached block volumes
lb.request_count Counter Requests HTTP requests processed by the load balancer
latency.p99 Summary Milliseconds 99th percentile request latency

Querying Metrics

Metrics can be queried via the CloudNexus CLI, REST API, or the built-in PromQL-compatible query language in the Console.

CLI Example

Terminal bash
# Query CPU utilization for all production instances over the last 24 hours
nexus metrics query \
  --metric "cpu.utilization" \
  --filter "environment:production" \
  --interval "24h" \
  --aggregation "avg" \
  --output json

REST API

cURL http
curl -X POST https://api.cloudnexus.io/v3/metrics/query \\
  -H "Authorization: Bearer $NX_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "metric": "memory.usage_bytes",
    "dimensions": {"instance_id": ["i-8f3a9c2d"]},
    "start": "2024-11-14T00:00:00Z",
    "end": "2024-11-15T00:00:00Z",
    "resolution": "1m"
  }'

Resolution Tiers

CloudNexus offers two data resolution tiers to balance cost and granularity:

Tier Collection Interval Retention Cost
Standard 1 minute 1 year Included in all plans
High-Resolution 15 seconds 30 days $0.04 / GB-month
âš ī¸ Warning
High-resolution metrics increase ingestion volume by ~4x. Enable only for critical workloads to avoid unexpected overage charges.

Data Retention & Lifecycle

Metrics are automatically tiered to optimize storage costs:

💡 Tip
Use the nexus metrics lifecycle configure command to set custom retention policies per project. Teams can also export metrics to S3 for long-term archival at a fraction of the cost.

Best Practices

To maximize the value of CloudNexus Metrics while controlling costs:

  1. Tag resources consistently using team, service, and environment labels.
  2. Use dashboards to visualize trends before creating alerts. Avoid alerting on raw metrics; use aggregated functions like avg_over_time() or rate().
  3. Enable high-resolution collection only for stateful services, databases, and critical API endpoints.
  4. Review your ingestion volume in the Billing dashboard weekly. Set budget alerts to prevent overages.