How can I use related log feature

Hi,
I’m trying to

  1. see metrics that from node-exporter and select time when load is high.
  2. see log at that time.

I thought I was able to achieve this by using node-exporter, prometheus, vector → loki.
I set label on loki same as node-exporter’s job label.

{ job = "gateway.node-exporter"; instance = "gateway:9000"; }

Loki, prometheus is working fine but “Related logs” doesn’t show log at the selected metrics.
How can i relate log and metric?

hello @aca2 what version of grafana you are using…?

Are the timestamps aligned?
“Related Logs” works by matching timestamps between metrics and logs. If there’s a clock drift between Prometheus and your log source, logs might fall outside the selected time window.

Can you confirm the labels match exactly?
For example, if the job label in Node Exporter is gateway.node-exporter, then the log stream from Loki also needs to have:

{ job=“gateway.node-exporter”, instance=“gateway:9000” }

Which version of Grafana are you using?
Some versions improve how “Related Logs” works — especially when dealing with multiple data sources.

Is your Vector config correctly applying labels to Loki logs?
Sometimes Vector may not map or forward the labels as expected unless explicitly configured.

Have you tried checking the logs directly in the Explore tab using LogQL?
For example:

{ job="gateway.node-exporter", instance="gateway:9000" }

If you can share your Vector config and maybe a screenshot or example of your Prometheus and Loki labels, we can help you debug it more accurately.