Raygun Metrics API
Query time-series and histogram metrics for page performance and error rates with flexible bucket, range, and filter parameters. Powers custom dashboards and external observability exports.
Query time-series and histogram metrics for page performance and error rates with flexible bucket, range, and filter parameters. Powers custom dashboards and external observability exports.
openapi: 3.0.3
info:
title: Raygun applications metrics API
version: '3.0'
description: This is a visual representation of the Raygun API V3 specification.<br> To find out more details and how to get started, you can head over to the <a href='https://raygun.com/documentation/product-guides/public-api/' target='_blank'>documentation</a>.
contact:
name: Raygun Support
email: support@raygun.com
servers:
- url: https://api.raygun.com/v3
description: ''
security:
- personal_access_token: []
tags:
- name: metrics
paths:
/metrics/{application-identifier}/pages/time-series:
parameters:
- $ref: '#/components/parameters/application-identifier'
post:
summary: Time-series Page Metrics
operationId: metrics-pages-time-series
responses:
'200':
$ref: '#/components/responses/metrics-time-series'
'400':
$ref: '#/components/responses/problem-details'
'401':
$ref: '#/components/responses/problem-details'
'403':
$ref: '#/components/responses/problem-details'
'404':
$ref: '#/components/responses/problem-details'
'422':
$ref: '#/components/responses/validation-problem-details'
'429':
description: Too Many Requests
description: Returns aggregated time-series metrics data for pages
requestBody:
content:
application/json:
schema:
type: object
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
granularity:
type: string
example: 1h
pattern: ^\d+[mhd]$
aggregation:
type: string
enum:
- count
- average
- median
- sum
- min
- max
- p95
- p99
metrics:
type: array
items:
type: string
enum:
- pageViews
- loadTime
- firstPaint
- firstContentfulPaint
- firstInputDelay
- largestContentfulPaint
- cumulativeLayoutShift
- interactionToNextPaint
filter:
type: string
example: pageIdentifier = abc123
description: 'Filters the result based on an expression. Format: "pageIdentifier = abc123" or "pageIdentifier IN (abc123, def456)"'
required:
- start
- end
- granularity
- aggregation
- metrics
security:
- personal_access_token:
- metrics:pages
tags:
- metrics
/metrics/{application-identifier}/pages/histogram:
parameters:
- $ref: '#/components/parameters/application-identifier'
post:
summary: Histogram Page Metrics
operationId: metrics-pages-histogram
responses:
'200':
$ref: '#/components/responses/metrics-histogram'
'400':
$ref: '#/components/responses/problem-details'
'401':
$ref: '#/components/responses/problem-details'
'403':
$ref: '#/components/responses/problem-details'
'404':
$ref: '#/components/responses/problem-details'
'422':
$ref: '#/components/responses/validation-problem-details'
'429':
description: Too Many Requests
description: Returns pre-bucketed histogram metrics data for pages
requestBody:
content:
application/json:
schema:
type: object
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
metrics:
type: array
items:
type: string
enum:
- loadTime
- firstPaint
- firstContentfulPaint
- firstInputDelay
- largestContentfulPaint
- cumulativeLayoutShift
- interactionToNextPaint
filter:
type: string
example: pageIdentifier = abc123
description: 'Filters the result based on an expression. Format: "pageIdentifier = abc123" or "pageIdentifier IN (abc123, def456)"'
required:
- start
- end
- metrics
examples:
Request single metric:
value:
start: '2019-07-24T14:15:22Z'
end: '2019-08-24T14:15:22Z'
metrics:
- loadTime
Request multiple metrics:
value:
start: '2019-07-24T14:15:22Z'
end: '2019-08-24T14:15:22Z'
metrics:
- loadTime
- firstPaint
Filter on single page:
value:
start: '2019-07-24T14:15:22Z'
end: '2019-08-24T14:15:22Z'
metrics:
- loadTime
filter: pageIdentifier = abc123
Filter on multiple pages:
value:
start: '2019-07-24T14:15:22Z'
end: '2019-08-24T14:15:22Z'
metrics:
- loadTime
filter: pageIdentifier IN (abc123, def456)
security:
- personal_access_token:
- metrics:pages
tags:
- metrics
/metrics/{application-identifier}/errors/time-series:
parameters:
- $ref: '#/components/parameters/application-identifier'
post:
summary: Time-series Error Metrics
operationId: metrics-errors-time-series
responses:
'200':
$ref: '#/components/responses/metrics-time-series'
'400':
$ref: '#/components/responses/problem-details'
'401':
$ref: '#/components/responses/problem-details'
'403':
$ref: '#/components/responses/problem-details'
'404':
$ref: '#/components/responses/problem-details'
'422':
$ref: '#/components/responses/validation-problem-details'
'429':
description: Too Many Requests
description: Returns aggregated time-series metrics data for errors
requestBody:
content:
application/json:
schema:
type: object
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
granularity:
type: string
example: 1h
pattern: ^\d+[mhd]$
aggregation:
type: string
enum:
- count
metrics:
type: array
items:
type: string
enum:
- errorInstances
filter:
type: string
example: errorGroupIdentifier IN (abc123, def456)
description: 'Filters the result based on an expression. Format: "errorGroupIdentifier = abc123" or "errorGroupIdentifier IN (abc123, def456)"'
required:
- start
- end
- granularity
- aggregation
- metrics
security:
- personal_access_token:
- metrics:errors
tags:
- metrics
components:
responses:
metrics-histogram:
description: Histogram metrics
content:
application/json:
schema:
type: array
items:
type: object
properties:
metric:
type: string
buckets:
type: array
items:
type: object
properties:
key:
type: number
description: Lower bound of the bucket.
range:
type: string
description: 'Inclusive lower bound and exclusive upperbound of the bucket. Format: {lower-bound} - {upper-bound}.'
count:
type: integer
description: Number of events that fall in the bucket.
required:
- key
- range
- count
required:
- metric
- buckets
examples:
Single-metric example:
value:
- metric: loadTime
buckets:
- key: 100
range: 100 - 200
count: 4000
- key: 200
range: 200 - 300
count: 5000
Multi-metric example:
value:
- metric: loadTime
buckets:
- key: 100
range: 100 - 200
count: 4000
- metric: firstPaint
buckets:
- key: 80.5
range: 80.5 - 120.5
count: 300
validation-problem-details:
description: Validation problem details
content:
application/json:
schema:
type: object
properties:
type:
type: string
title:
type: string
detail:
type: string
status:
type: integer
traceId:
type: string
errors:
type: object
additionalProperties:
type: array
items:
type: string
required:
- type
- title
- status
- traceId
- errors
headers:
X-Raygun-RequestId:
schema:
type: string
description: The id associated with this request
problem-details:
description: Problem Details
content:
application/json:
schema:
type: object
properties:
type:
type: string
title:
type: string
detail:
type: string
status:
type: integer
traceId:
type: string
required:
- type
- title
- status
- traceId
headers:
X-Raygun-RequestId:
schema:
type: string
description: The id associated with this request
metrics-time-series:
description: Time-series metrics
content:
application/json:
schema:
type: array
items:
type: object
properties:
aggregation:
type: string
metric:
type: string
series:
type: array
items:
type: object
properties:
time:
type: string
format: date-time
value:
type: number
format: double
parameters:
application-identifier:
name: application-identifier
in: path
required: true
schema:
type: string
description: Application identifier
securitySchemes:
personal_access_token:
type: http
scheme: bearer
description: 'Personal Access Token authorization using the Bearer scheme. Example: `Authorization: Bearer {token}`'