Guide to APM metrics

SigNoz processes span data and generates metrics from it. This guide will help you understand how SigNoz generates metrics from span data. The metrics generated by SigNoz are the following:

Aggregates Request, Error and Duration (R.E.D) metrics from span data.

Metrics generated by this processor:

  • signoz_calls_total
  • signoz_latency_sum
  • signoz_latency_count
  • signoz_latency_bucket
  • signoz_db_latency_sum
  • signoz_db_latency_count
  • signoz_external_call_latency_sum
  • signoz_external_call_latency_count

Request counts are computed as the number of spans seen per unique set of dimensions, including Errors. For example, the following metric shows 142 calls:

signoz_calls_total{http_status_code="200",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET"} 142

Multiple metrics can be aggregated if, for instance, a user wishes to view call counts just on service_name and operation.

Error counts are computed from the Request counts which have an "Error" Status Code metric dimension. For example, the following metric indicates 220 errors:

signoz_calls_total{http_status_code="503",operation="/checkout",service_name="frontend",span_kind="SPAN_KIND_CLIENT",status_code="STATUS_CODE_ERROR"} 220

Duration is computed from the difference between the span start and end times and inserted into the relevant latency histogram time bucket for each unique set dimensions. For example, the following latency buckets indicate the vast majority of spans (9K) have a 100ms latency:

signoz_latency_bucket{http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="2"} 327
signoz_latency_bucket{http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="6"} 751
signoz_latency_bucket{http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="10"} 1195
signoz_latency_bucket{http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="100"} 10180
signoz_latency_bucket{http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="250"} 10180
...

Each metric will have the following dimensions because they are common across all spans:

  • Service name
  • Operation
  • Span kind
  • Status code
  • HTTP status code

DB Latency is computed from the difference between the span start and end times and inserted into the relevant latency histogram time bucket for each unique set dimensions. The average DB latency is computed by dividing the sum of the DB latency by the count of the DB latency.

Each metric will have the following dimensions because they are common across all spans:

  • Service name
  • Operation
  • Span kind
  • Status code
  • Database system
  • Database name

External Call Latency is computed from the difference between the span start and end times and inserted into the relevant latency histogram time bucket for each unique set dimensions. The average external call latency is computed by dividing the sum of the external call latency by the count of the external call latency.

Each metric will have the following dimensions because they are common across all spans:

  • Service name
  • Operation
  • Span kind
  • Status code
  • External service address
  • HTTP status code