User Tools

Site Tools


logs_and_metrics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

logs_and_metrics [2026/07/08 18:18] – created carllogs_and_metrics [2026/07/10 07:27] (current) carl
Line 7: Line 7:
  
   * Logs have precise timestamps.  To compare the order of events, you need to look at logs.  Metrics are usually aggregated locally at seconds or minute granularity, making it challenging to establish an order.   Traces are even more precise.   * Logs have precise timestamps.  To compare the order of events, you need to look at logs.  Metrics are usually aggregated locally at seconds or minute granularity, making it challenging to establish an order.   Traces are even more precise.
-  * +  * Metrics have natural key-value dimensions.  A metric can be aggregated by key, while logs have only the values.  Compare ''logger.info("Foo {} happened to user {}.)'' to ''counter("event", "type", "foo", "user", user).record()''. The metric call has named parameters, while the logging call are positional, at lease at the callsite. 
 +  * Additionally, Metrics usually can only have a limited dimensionality and cardinality.   There cannot be too many values, and usually, only a handful of keys per dimension.
logs_and_metrics.txt · Last modified: by carl