Skip to content

Metrics related to Http status code #1146

Closed

Description

@Wonshtrum

We currently have (on Sozu 1.0.5) two "kind" of metrics on http status codes:

  • http.301.redirection, http.400.errors, http.401.errors and alike
  • http.status.1xx, http.status.2xx and alike
    The first category is only incremented for automatic responses generated by Sozu. The second is incremented for every response, generated or forwarded from a backend. This explains why the former uses explicit error numbers and the latter, aggregated ones.

The naming is not really explicit, so may we change it? Maybe http.generated.301 and http.total.1xx?
Additionally, independently of their origin, some of those metrics are stored:

  • per backend, like http.502.errors and http.status.2xx
  • per cluster, like http.503.errors and http.status.5xx
  • per worker, like http.400.errors and http.status.3xx

We can't store all of them with "backend precision", as some errors are generated prior to this knowledge (400 are typically generated before the cluster is known). Should we aggregate the "more precise" status codes on clusters and workers? To have quick access to how many 2xx responses were served for example (currently we have to look into each backend). Should it be done with more metrics directly? or with an option of the metrics get command? If we choose the former should they be named differently? If the latter, should we specify the exact name of the metric to aggregate, a pattern, or does it aggregate all metrics that can be aggregated?

Activity

  1. FlorentinDUBOIS commented on May 2, 2026

    @FlorentinDUBOIS
    Collaborator

    Implemented in PR #1196 (merged). Per-status-code counters http.status.<code> for an 18-code shortlist now exist alongside the bucket counters http.status.{1xx..5xx,other,none}. The keyspace is bounded — codes outside the shortlist contribute only to their bucket. The naming question (originally http.301.redirection + http.status.3xx) is resolved: only http.status.<code> survives. See lib/src/metrics/mod.rs http_status_code_metric_name and doc/configure.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions