Prometheus.exporter.blackbox Alloy

Hi! I’ve been trying to make my prometheus.exporter.blackbox block to work but i’m having trouble doing it. I don’t have any errors and the alloy.service is up so it doesn’t seem to be a syntax issue. I can confirm I have connection to the ip addres and that ping works!
This is the current alloy configuration I’m using as well as the config file for the blackbox exporter. Any help would be apreciated!

Alloy Config:
prometheus.exporter.blackbox “default” {
config_file = “/etc/alloy/blackbox_modules.yml”
target {
name = “grafanaLoki”
address = “10.11.40.37”
// module = “icmp_probe”
}
}

prometheus.scrape “blackbox” {
targets = prometheus.exporter.blackbox.default.targets
forward_to = [prometheus.remote_write.default.receiver]
}*

Blackbox config:
modules:
icmp_example:
prober: icmp
timeout: 1m
icmp:
preferred_ip_protocol: “ip4”
source_ip_address: “10.145.30.12”

Hello @bgaspar , here’s an example that works for me (sending the up metric labeled with this job, to Grafana). Please let me know your results.

prometheus.exporter.blackbox "integrations_blackbox" {
  config = "{modules: { icmp_test: { prober: icmp, timeout: 5s}}}"
  target {
    name    = "quickpizza"
    address = "https://quickpizza.grafana.com"
    module  = "icmp_test"
  }
}

discovery.relabel "integrations_blackbox" {
	targets = prometheus.exporter.blackbox.integrations_blackbox.targets

	rule {
		target_label = "job"
		replacement  = "integrations/blackbox"
	}
}

// Configure a prometheus.scrape component to collect blackbox metrics.
prometheus.scrape "integrations_blackbox" {
  targets    = discovery.relabel.integrations_blackbox.output
  forward_to = [prometheus.remote_write.metrics_service.receiver]
  job_name   = "integrations/blackbox"
}