Log visualization: charts you can trace back to the logs
Choose charts for log data, distinguish event counts from request error rates, and build a Guance dashboard with a traceable DQL query.
The checkout dashboard shows 180 error logs in five minutes, up from 120 in the preceding window. The request metrics show 30 failures out of 3,000 requests, versus 24 out of 1,200 before. The log count rose and the request error proportion fell from 2% to 1%. Both charts can be right. They count different things.
Log visualization turns recorded events into trends, comparisons and views you can investigate. Start by naming the event that contributes to a point, the time range it belongs to and the dimension you want to compare. The checkout numbers here are illustrative.
Decide what a point counts
A count of error logs tells you how many records matched the filter. A request can write several error records as it is retried or passes through multiple services. A lost or sampled-out log leaves no record to count, and duplicate delivery can add one. Dividing error logs by all logs gives the share of collected records marked as errors. For a request error proportion, divide failed requests by all requests for the same service, environment and time window. Use request metrics or completion records with one reliable outcome per request. Leave the proportion undefined when the denominator is zero.
Fields determine what else you can ask. Keep a stable service name, environment and normalized severity. If you chart latency from logs, parse the duration as a number, use one unit and check which records actually include it. The resulting distribution covers those observations. Raw text is still searchable and countable, and structured fields give you consistent dimensions for grouping and filtering. Log formatting best practices
Set the range and bucket before choosing the chart
For an incident, align the chart and the raw logs to the same absolute start and end, including the time zone used to interpret them. Decide which timestamp drives the grouping. An event timestamp can place a late record in an earlier bucket, changing that point after the fact. Check how ingestion or processing sets the stored timestamp before comparing sources.
Use equal, complete buckets for a count trend and label the unit, such as error events per five minutes. The newest bucket may still be filling. When comparing calendar days, check the time zone and day boundaries. A blank or absent bucket can reflect no matching records, delayed or interrupted collection, or a filter that excludes the source. Fill gaps with zero only after deciding what the absence means for that chart.
Give each chart one job
| Question | View | Check before interpreting it |
|---|---|---|
| When did the error volume change? | Time series with one line per service | Bucket width, missing points and the partial last bucket |
| Which services account for most recorded errors? | Ranked bars or a Top List | Ranking measure, time range and omitted groups |
| What share came from each service? | Pie chart or treemap | Whether the groups form a whole and how omitted groups are handled |
| What do we know about this point? | Detail table or filtered log list | Time window, filters and identifiers carried over from the chart |
A single-value card can summarize the current interval. Put the interval and unit beside the number. Use a ranking to choose where to inspect, since high-volume services can rank first even with a lower error proportion. If a chart only shows the top ten services, the other services may still have errors. A percentage calculated from the ten displayed values describes those ten unless you use the full total as the denominator. Guance chart types
Build the log chart and keep a way back to the records
In Guance Log Explorer, confirm the index, source and sample records. Then open a dashboard and create a time series with the same scope in Simple Query or DQL mode. The example assumes that DataKit and any Pipeline processing have placed logs with source checkout in the default index and populated env, status and service as shown.
L("default")::checkout:(count(*) AS error_events)
{ `env` = "prod" AND `status` = "error" }
[1h:5m] BY service
The query counts matching rows per service in five-minute buckets over the last hour. It uses count(*) to include matching records even when an optional field is absent. Check an absolute incident window instead of relying on two successive “last hour” queries to cover the same data. When dashboard variables change the service or environment, apply the same selection when opening a log list. Spot-check one bucket against the raw records to confirm the fields and time range. Log Explorer · DQL chart queries · DQL syntax
Turn the question into a detection rule
A dashboard helps you inspect a spike. In Guance Log Detection, use the same data definition and set the evaluation frequency, lookback window, threshold and alert policy separately. An alert that checks the last five minutes every minute uses overlapping windows. Its evaluation can differ from the dashboard's displayed five-minute buckets. Decide how the rule should handle empty results and late data, and include a service and time range that make the affected records easy to find. If the notification is about customer impact, use the request outcome and traffic signals that support that claim. Guance Log Detection · Log monitoring
Contact us
Join the community
to join the community
Try Guance
Start online and pay only for what you use.
Get startedChoose a Guance plan
