Skip to content

List a project's alert rules

Each with its status, in sort order: state (the default: firing, error, noData, pending, ok, disabled, then name), name, or changed (the latest stateSince first; rules without one last). total counts the rules the filters keep. limit is 1-100 (default 25). 404 while alerting isn't offered (the console hides Alerting then).

GET
https://obs.ezghcloud.com/v1/organizations/{orgId}/projects/{projectId}/obs/alert-rules

Authorization

  • apiKeyoptionalHTTP
  • oauthoptionalHTTP
  • sessionCookieoptionalAPI key in cookie

Path parameters

  • orgIdstringrequired
    format: uuid
  • projectIdstringrequired
    format: uuid

Query parameters

  • limitoptionalinteger

    The page size. Out of range is 400, never a clamp.

    maximum: 100, minimum: 1
    Default: 25
  • cursoroptionalstring

    The previous page's nextCursor. Bound to the organization, the list and its filters.

  • stateoptionalarray ofstring

    Only rules in these states (repeatable): ok, pending, firing, noData, error, disabled.

  • enabledoptionaltrueorfalse

    true or false.

  • qoptionalstring

    Only rules whose name contains this (case-insensitive).

  • kindoptionalarray ofstring

    Only rules whose condition is of these kinds (repeatable).

  • contactPointoptionalstring

    Only rules that notify this contact point.

    format: uuid
  • labeloptionalarray ofstring

    Only rules whose static labels match (repeatable): name=value, name!=value, name=~regex or name!~regex (anchored RE2; a missing label is empty).

  • sortoptionalstateornameorchanged

    state (default), name or changed.

Returns

200

A page of alert rules.

JSON
  • alertRulesarray ofobjectrequired
    25 properties
    • conditionobjectrequired

      Exactly one of promql, logs and traces.

      3 properties
      • logsoptionalobject

        A logs or traces aggregate over [t − window, t); each group whose value satisfies the threshold is an active instance.

        6 properties
        • aggregateobjectrequired

          One aggregation, as a dashboard panel's: {fn, field?}.

          2 properties
          • fnstringrequired
          • fieldoptionalunknown
        • datasetstringrequired
          format: uuid
        • thresholdobjectrequired
          2 properties
          • op>or>=or<or<=or==or!=required
          • valuenumberrequired
        • windowstringrequired

          The aggregate's window, ending at the evaluation time: 1m to 15m in whole minutes.

        • filteroptionalobject

          The dashboard panel's filter: logs' filters (LogFilters) or traces' (TraceFilters), kept as sent (stored as JSON: key order and number spelling may be normalized). Default {}.

        • groupByoptionalarray ofobject

          At most 2 fields; at most 50 groups are evaluated (more is a rule error).

          1 properties
          • fieldunknownrequired
      • promqloptionalobject
        1 properties
        • exprstringrequired

          A PromQL expression returning an instant vector, with its comparison: every series it returns is an active instance. Ranges, subquery ranges and offsets add up to at most 1h along any path; @ isn't allowed.

          maxLength: 8192
      • tracesoptionalobject

        A logs or traces aggregate over [t − window, t); each group whose value satisfies the threshold is an active instance.

        6 properties
        • aggregateobjectrequired

          One aggregation, as a dashboard panel's: {fn, field?}.

          2 properties
          • fnstringrequired
          • fieldoptionalunknown
        • datasetstringrequired
          format: uuid
        • thresholdobjectrequired
          2 properties
          • op>or>=or<or<=or==or!=required
          • valuenumberrequired
        • windowstringrequired

          The aggregate's window, ending at the evaluation time: 1m to 15m in whole minutes.

        • filteroptionalobject

          The dashboard panel's filter: logs' filters (LogFilters) or traces' (TraceFilters), kept as sent (stored as JSON: key order and number spelling may be normalized). Default {}.

        • groupByoptionalarray ofobject

          At most 2 fields; at most 50 groups are evaluated (more is a rule error).

          1 properties
          • fieldunknownrequired
    • contactPointsarray ofstringrequired

      0 to 10 contact point IDs of the project. Default none (the rule still evaluates and keeps state).

      format: uuid
    • createdAtstringrequired

      UTC, millisecond precision: 2026-10-02T10:20:00.000Z.

      format: date-time
    • createdByobjectrequired
      2 properties
      • idstringrequired
      • typestringrequired

        user or bot (org-api's principal type).

    • enabledbooleanrequired

      Off: the rule isn't evaluated and has no instances. Default true.

    • forstringrequired

      How long the condition must hold before an instance fires: 0 to 24h in whole minutes. Default 0.

    • idstringrequired
      format: uuid
    • keepFiringForstringrequired

      How long a firing instance keeps firing after the condition stops holding: 0 to 24h in whole minutes. Default 0.

    • kindstringrequired

      The condition's kind: promql, logs or traces.

    • namestringrequired
      maxLength: 100, minLength: 1
    • noDataokoralertingornoDatarequired

      Logs and traces conditions whose aggregate returns no groups: ok (nothing active), alerting (one active instance) or noData (one instance in the noData state). Default noData. PromQL ignores it: use absent().

    • notifyOnResolvebooleanrequired

      Notify when instances resolve. Default true.

    • onErrorerrororokrequired

      A rule error (the engine refuses the query, more than 1,000 instances, a budget exceeded): error puts the rule in the error state and notifies; ok records it without notifying. Default error. EZGH's own failures never notify.

    • projectIdstringrequired
      format: uuid
    • repeatIntervalstringrequired

      How often a still-firing rule notifies again: 5m to 7d. Default 4h.

    • resourceNamestringrequired
    • slugstringrequired
    • statusobjectrequired

      A rule's evaluation state.

      10 properties
      • countsobjectrequired
        3 properties
        • firingintegerrequired
        • noDataintegerrequired
        • pendingintegerrequired
      • degradedbooleanrequired

        Evaluations are delayed by an EZGH issue (late data or storage unavailable): state is held and nothing resolves or notifies about it.

      • degradedSincestring | nullrequired
        format: date-time
      • errorstring | nullrequired

        The last evaluation's rule error, or null.

      • errorSincestring | nullrequired
        format: date-time
      • lastDurationMsinteger | nullrequired
      • lastEvaluatedAtstring | nullrequired
        format: date-time
      • statestringrequired

        ok, pending, firing, noData, error or disabled (off, or its organization is being deleted). More may be added.

      • stateSincestring | nullrequired

        When the rule entered its state (as obs-alerts recorded it); null when not known yet, or disabled.

        format: date-time
      • warningsarray ofstringrequired

        sampledData, noContactPoints. More codes may be added.

    • updatedAtstringrequired

      UTC, millisecond precision: 2026-10-02T10:20:00.000Z.

      format: date-time
    • updatedByobjectrequired
      2 properties
      • idstringrequired
      • typestringrequired

        user or bot (org-api's principal type).

    • versionintegerrequired
    • annotationsoptionalmap ofstring

      Templates (Prometheus's alerting template language, without query, range or template; at most 4 KiB each, 16 in all), rendered per instance with $labels and $value.

    • descriptionoptionalstring
      maxLength: 1000
    • labelsoptionalmap ofstring

      Static labels on every instance (at most 32). alertname, ezgh_* and __* are reserved.

    • warningsoptionalarray ofstring

      Create and update answers only: sampledData (a traces condition on a dataset with tail sampling sees only kept spans) and noContactPoints (the rule notifies no one).

  • nextCursorstring | nullrequired
  • totalintegerrequired

    The rules the filters keep.

400

invalid_request (with issues), invalid_cursor, or the endpoint's own 400 codes.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

401

unauthenticated: no credential, or one that doesn't check out.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

403

access_denied: the caller's policies don't allow the action; forbidden_origin: a cookie-authenticated write from an origin that isn't allowed; spend_limit_reached.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

404

not_found: unknown, malformed, or in an organization the caller isn't in.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

429

too_many_requests, with Retry-After; or quota_exceeded (a rate, usage or concurrency quota, with quota), never with Retry-After.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

500

internal_error: a bug; the details are in the logs, under the request ID.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

503

unavailable: a dependency the request needs is down. Retry after Retry-After.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close