Read local .prom file

How can i read a .prom file and scrape it with prometheus to send It to grafana Cloud?
I tried this:

local.file "stats" {
  filename = "/etc/metrics_stats/stats.prom"
}
prometheus.scrape "stats" {
  targets = [local.file.stats.content]
  forward_to = [prometheus.relabel.stats.receiver]
}

But It gives the error:

Error: /etc/alloy/config.alloy:27:14: local.file.stats.content target::ConvertFrom: conversion from 'alloytypes.OptionalSecret' is not supported

Try the textfile collector under prometheus.unix, see prometheus.exporter.unix | Grafana Alloy documentation.

I don’t use textfile collector, but from reading about it it seems that it would have to be configured with a directory.