how to see all log data in loki?

Viewed 721

i'm using Loki as log management system , and i send log like this :

        logger = logging.getLogger("loki")
        logger.info(
        "download_file",
        extra={"tags": {"module": "download_file", "step": 1, "started_time": time.time()},
               "data": {"user": request.user.pk, "symbols": symbols, 'time_frame': time_frame, "from_date": from_date,
                        "to_date": to_date,
                        "file_id":action.id,
                        "unique_id" : unique_id}
               },
    )

in Grafana dashboard i can see only "module, step, started_time" . i cannot see the 'data' section in dashboard , how i can see them ? or is my log format true and work in Loki or i have to send all metrics in 'tags' section ?

1 Answers

In which dashboard you'd like to see your data?

You can see all your log messages using Grafana Explore

You don't need your data inside the tags. The tags are used as Loki labels. Using step and timestamp as labels will generate a label cardinality explosion and that would have an impact on performance. You can read more on labels here.

Related