Mechanism to only scrape logs for labelled pods? aka a filter?

Hello,

I’m quite new to Grafana in general, and specifically Loki.

I’ll explain the problem first: I have a finite budget. Logs can and will increase my bill. I need to control how much logs are ingested.

My idea: I could possibly control which pods/deployments/namespaces are scraped based on it’s label.

Example, only scape logs for pods with label ‘deployment=production’. A namespace filter would also work.

I hope you can point me in the right direction.

Regards,
Lee