Disable auto level tagging in grafana explore

When looking at logs in our account at Get started with Explore | Grafana documentation grafana it categorizes them as error, critical, unknown

We use pino for our logging which adds a numeric level to each log message based on severity

  • info - 30
  • warning - 40
  • error - 50
  • etc

Grafana interprets (most) level 30 and 40 logs as ‘unknown’ and 50 as ‘error’. Sometimes, however, it will flag the logs differently based on key words in the payload.

For example

  • a log message that contains terminate or terminating will be flagged as critical
  • log messages that contain ‘error’ (even “no errors” or an empty error property) will be flagged as error.

Where in the settings can we disable this ‘feature’ and have grafana accept our log level labels?

I guess not Grafana, but Loki detects log level, so Grafana just visualize it.

See Grafana Loki configuration parameters | Grafana Loki documentation

# Discover and add log levels during ingestion, if not present already. Levels
# would be added to Structured Metadata with name
# level/LEVEL/Level/Severity/severity/SEVERITY/lvl/LVL/Lvl (case-sensitive) and
# one of the values from 'trace', 'debug', 'info', 'warn', 'error', 'critical',
# 'fatal' (case insensitive).
# CLI flag: -validation.discover-log-levels
[discover_log_levels: <boolean> | default = true]

So try to map your log level values (30, 40, 50. …) into Loki expected log level values (‘trace’, ‘debug’, ‘info’, ‘warn’, ‘error’, ‘critical’, ‘fatal’) and send that to Loki.