tornado_prometheus/__init__.py
def classify_status_code(self, status_code):
        """
        Prometheus recomends to have lower number of cardinality,
        each combination creates a new metric in datastore,
        to reduce this risk we store only the class of status code
        """
        if 200 <= status_code < 300:
            return "2xx"

        if 300 <= status_code < 400:
            return "3xx"

        if 400 <= status_code < 500:
            return "4xx"

        return "5xx"

        Prometheus recomends to have lower number of cardinality,
        each combination creates a new metric in datastore,
        to reduce this risk we store only the class of status code
        
Prometheus recomends to have lower number of cardinality,
each combination creates a new metric in datastore,
to reduce this risk we store only the class of status code
Prometheus recomends to have lower number of cardinality each combination creates a new metric in datastore to reduce this risk we store only the class of status code
def classify_status_code(self, status_code):
        if 200 <= status_code < 300:
            return "2xx"
        if 300 <= status_code < 400:
            return "3xx"
        if 400 <= status_code < 500:
            return "4xx"
        return "5xx"
def classify_status_code ( self , status_code ) : if 200 <= status_code < 300 : return "2xx" if 300 <= status_code < 400 : return "3xx" if 400 <= status_code < 500 : return "4xx" return "5xx"
Prometheus recomends to have lower number of cardinality,
each combination creates a new metric in datastore,
to reduce this risk we store only the class of status code
Prometheus recomends to have lower number of cardinality each combination creates a new metric in datastore to reduce this risk we store only the class of status code
"""
        Prometheus recomends to have lower number of cardinality,
        each combination creates a new metric in datastore,
        to reduce this risk we store only the class of status code
        """
self
status_code