Errors

The Errors metric tracks the number of client-side errors encountered by users on your site or app. This includes form validation issues, JavaScript errors, network problems, and more.

Metric model

  • Name
    metric
    Type
    string
    Description

    Always errors for this metric.

  • Name
    value
    Type
    integer
    Description

    Number of error events in the current period.

  • Name
    previous
    Type
    integer
    Description

    Number of error events in the previous period.

  • Name
    change
    Type
    float
    Description

    Percentage change compared to previous period.

  • Name
    formattedValue
    Type
    string
    Description

    Readable version of the current value.

  • Name
    formattedPrevious
    Type
    string
    Description

    Readable version of the previous value.

  • Name
    period.id
    Type
    string
    Description

    Time range identifier (e.g., 7d).

  • Name
    period.name
    Type
    string
    Description

    Name of the selected period.

  • Name
    periodRange.current.start
    Type
    string
    Description

    ISO 8601 timestamp of the current period start.

  • Name
    periodRange.current.end
    Type
    string
    Description

    ISO 8601 timestamp of the current period end.

  • Name
    periodRange.previous.start
    Type
    string
    Description

    ISO 8601 timestamp of the previous period start.

  • Name
    periodRange.previous.end
    Type
    string
    Description

    ISO 8601 timestamp of the previous period end.

  • Name
    performance.duration
    Type
    float
    Description

    Time taken to compute in milliseconds.

  • Name
    performance.formatted
    Type
    string
    Description

    Formatted duration string (e.g., 707 ms).


GET/api/metrics/errors

Retrieve errors metric

This endpoint returns the number of error events during the specified time range.

Optional query parameters

Request

GET
/api/metrics/errors
curl -G http://localhost:3000/api/metrics/errors \
  -H "Authorization: Bearer {token}" \
  -d period=7d

Response

{
  "metric": "errors",
  "value": 1896,
  "previous": 1119,
  "change": 69.44,
  "formattedValue": "1.896",
  "formattedPrevious": "1.119",
  "period": {
    "id": "7d",
    "name": "Last 7 days"
  },
  "periodRange": {
    "current": {
      "start": "2025-03-16T08:50:55.030Z",
      "end": "2025-03-23T08:50:55.029Z"
    },
    "previous": {
      "start": "2025-03-09T08:50:55.030Z",
      "end": "2025-03-16T08:50:55.029Z"
    }
  },
  "performance": {
    "duration": 707.33,
    "formatted": "707 ms"
  }
}

Use cases

  • Identify JavaScript or API issues affecting user experience
  • Track stability of new releases
  • Alert on major spikes or regressions in frontend errors

Was this page helpful?