Skip to main content
Get comprehensive performance metrics, usage statistics, and cost analysis for your serverless endpoints. Monitor execution patterns, resource utilization, and optimize costs with detailed analytics and insights.

Path Parameters

  • endpointId: The unique identifier of the endpoint to get metrics for

Query Parameters

  • timeframe: Time period for metrics (1h, 6h, 24h, 7d, 30d) - defaults to 24h
  • granularity: Data point granularity (1m, 5m, 15m, 1h, 1d) - defaults to 15m
  • metrics: Specific metrics to include (performance, usage, costs, resources, errors)
  • format: Response format (json, csv, prometheus) - defaults to json
  • aggregation: Aggregation method (avg, sum, min, max, p95, p99) for time series data

Example Usage

Basic Performance Metrics

Detailed Metrics with Custom Timeframe

Cost Analysis with Breakdown

Prometheus Format for Monitoring Integration

Batch Metrics for Multiple Endpoints

Response

Comprehensive Metrics Response

Cost Breakdown Response

Prometheus Format Response

Metric Categories

Performance Metrics

  • Latency: Response times with percentiles (p50, p95, p99)
  • Throughput: Requests per second, tokens per second
  • Error Rates: Success rates, failure breakdown by type
  • Cold Starts: Frequency, duration, impact on performance

Usage Metrics

  • Request Volume: Total requests, patterns, trends
  • Compute Utilization: GPU/CPU usage, efficiency scores
  • Data Transfer: Input/output volumes, bandwidth usage
  • Cache Performance: Hit rates, miss rates, efficiency

Cost Metrics

  • Total Costs: Comprehensive cost breakdown
  • Cost Trends: Historical analysis and projections
  • Optimization: Potential savings and recommendations
  • Budget Tracking: Budget vs. actual spending analysis

Resource Metrics

  • Hardware Utilization: GPU, CPU, memory usage
  • Scaling Events: Auto-scaling activities and effectiveness
  • Resource Efficiency: Utilization optimization scores
  • Capacity Planning: Usage patterns and capacity recommendations

Time Series Data

Granularity Options

  • 1m: Minute-level granularity (last 6 hours max)
  • 5m: 5-minute intervals (last 24 hours max)
  • 15m: 15-minute intervals (last 7 days max)
  • 1h: Hourly intervals (last 30 days max)
  • 1d: Daily intervals (unlimited retention)

Aggregation Methods

  • avg: Average values over time period
  • sum: Sum of all values
  • min: Minimum value in period
  • max: Maximum value in period
  • p95: 95th percentile
  • p99: 99th percentile

Error Handling

400 Bad Request

403 Forbidden

429 Rate Limited

SDK Examples

Python SDK

JavaScript SDK

Use Cases

Production Monitoring

  • SLA Monitoring: Track performance against service level agreements
  • Cost Control: Monitor spending and identify optimization opportunities
  • Capacity Planning: Analyze usage patterns for infrastructure planning
  • Performance Optimization: Identify bottlenecks and optimization opportunities

Business Intelligence

  • Usage Analytics: Understand user behavior and usage patterns
  • Cost Attribution: Track costs by team, project, or customer
  • ROI Analysis: Measure return on investment for AI initiatives
  • Trend Analysis: Identify growth patterns and seasonal variations

DevOps and Automation

  • Auto-scaling: Use metrics to trigger scaling decisions
  • Alerting: Set up automated alerts for performance and cost thresholds
  • CI/CD Integration: Include performance metrics in deployment pipelines
  • Resource Optimization: Automatically optimize resource allocation

Research and Development

  • Model Performance: Compare different model versions and configurations
  • A/B Testing: Analyze performance differences between model variants
  • Optimization Research: Identify areas for model and infrastructure improvement
  • Benchmarking: Compare performance against industry standards

Best Practices

Monitoring Strategy

  • Key Metrics: Focus on metrics that align with business objectives
  • Alerting Thresholds: Set appropriate thresholds to avoid alert fatigue
  • Dashboards: Create role-specific dashboards for different stakeholders
  • Historical Analysis: Maintain historical data for trend analysis

Performance Optimization

  • Regular Review: Regularly review metrics to identify optimization opportunities
  • Baseline Establishment: Establish performance baselines for comparison
  • Proactive Monitoring: Monitor trends to prevent issues before they occur
  • Cross-correlation: Analyze relationships between different metrics

Cost Management

  • Budget Tracking: Set up budget alerts and tracking
  • Cost Attribution: Tag resources for accurate cost attribution
  • Optimization Cycles: Regularly review and implement cost optimizations
  • Forecasting: Use historical data for cost forecasting and planning

Data Quality

  • Metric Validation: Validate metric accuracy and completeness
  • Data Retention: Define appropriate data retention policies
  • Access Control: Implement proper access controls for sensitive metrics
  • Documentation: Document metric definitions and calculation methods
Metrics are calculated in real-time and cached for 5 minutes to ensure optimal performance. For the most current data, use granularities of 1m or 5m.
Historical metrics are retained for 90 days. Export important data for longer-term analysis and archival purposes.
Use the batch metrics endpoint to efficiently retrieve metrics for multiple endpoints. Set up automated reporting and alerting to proactively manage performance and costs.