Skip to main content
LogFleet’s log-to-metric extraction lets you derive metrics from your logs at the edge, reducing cloud bandwidth by 100-1000x compared to shipping raw logs.

How It Works

Instead of shipping every log line to the cloud:
LogFleet extracts metrics at the edge:

Creating a Metric Config

Via API

Metric Types

Counter

Counts occurrences of a pattern. Useful for counting events.
Use cases:
  • HTTP request counts
  • Error counts by type
  • Event occurrences

Gauge

Captures the current value. Useful for point-in-time measurements.
Use cases:
  • Queue depths
  • Connection counts
  • Temperature readings
  • Memory usage

Histogram

Tracks value distributions. Useful for latencies and sizes.
Use cases:
  • Response times
  • Payload sizes
  • Processing durations

Pattern Syntax

Patterns use regular expressions with capture groups:

Common Patterns

Labels

Labels add dimensions to your metrics, enabling powerful queries:

Static Labels

Fixed values that apply to all matches:

Dynamic Labels

Captured from the log line:

Cardinality Warning

High-cardinality labels (like user IDs or request IDs) can cause performance issues. Stick to labels with bounded values (methods, status codes, environments).

Value Transforms

Transform captured values before recording:

Testing Patterns

Test your patterns before deploying:

Deployment

Metric configs are automatically synced to agents:
  1. Create/update config via API
  2. Agents sync every 60 seconds
  3. New metrics start appearing immediately

Version Control

Configs use optimistic locking. When updating:
If the version doesn’t match, you’ll get 409 Conflict.

Viewing Metrics

Query metrics from the LogFleet dashboard or via API:

Best Practices

Start Simple

Begin with a few key metrics and expand based on needs.

Use Histograms for Latency

Histograms provide percentiles; counters only give averages.

Limit Label Cardinality

Avoid high-cardinality labels that create millions of time series.

Test Patterns

Validate regex patterns against sample logs before deployment.