Skip to main content

Overview

The Session Metrics endpoint provides statistical analysis of session performance, including percentile distributions for session count, duration, and cost. This is useful for understanding typical session patterns and identifying outliers.

Request Parameters

string
Filter sessions by session name (partial match)
number
required
Timezone offset in minutes from UTC
string
default:"p75"
Percentile size for histogram calculationsOptions: p50, p75, p95, p99, p99.9
boolean
default:"false"
Use interquartile range for outlier detection
object
Time range filter for the metrics query
number
Start time in Unix milliseconds
number
End time in Unix milliseconds
object
Advanced filter node for complex queries

Response Fields

object
Session metrics data
array
Histogram data for request counts per session
number
Request count bucket
number
Number of sessions in this bucket
array
Histogram data for session duration in seconds
number
Duration bucket (in seconds)
number
Number of sessions in this bucket
array
Histogram data for session costs
number
Cost bucket (in USD)
number
Number of sessions in this bucket
object
Average metrics across all sessions
array
Average request count per session over time
string
Timestamp
number
Average count
array
Average session duration over time
string
Timestamp
number
Average duration in seconds
array
Average session cost over time
string
Timestamp
number
Average cost in USD

Example Request

Example Response

Understanding Percentiles

The pSize parameter controls which percentile to use for histogram bucketing:
  • p50 (median): Half of sessions fall below this value
  • p75: 75% of sessions fall below this value
  • p95: 95% of sessions fall below this value - useful for SLA monitoring
  • p99: 99% of sessions fall below this value - helps identify outliers
  • p99.9: Captures extreme outliers

Use Cases

  • Performance monitoring: Track session duration trends over time
  • Cost analysis: Understand cost distribution across sessions
  • Capacity planning: Identify typical session patterns for scaling
  • Anomaly detection: Use high percentiles (p95, p99) to spot unusual behavior
  • SLA compliance: Monitor percentile-based service level objectives

Interquartile Range

When useInterquartile is set to true, the metrics use the interquartile range (IQR) method for outlier detection. This provides a more robust statistical view by focusing on the middle 50% of data and reducing the impact of extreme outliers.