hello
Im trying to get grafana agent in flow to collect from local endpoint
agent ui works ok localhost:12345
metrics are visible at localhost:1235/actuator/prometheus
ts=2023-11-30T10:39:24.848534831Z level=error msg=“Creating target failed” component=prometheus.scrape.api scrape_pool=prometheus.scrape.api err=“"localhost:1235/actuator/prometheus" is not a valid hostname\ninstance 0 in group prometheus.scrape.api\ngithub.com/prometheus/prometheus/scrape.TargetsFromGroup\n\t/go/pkg/mod/github.com/grafana/prometheus@v1.8.2-0.20231016083943-46550094220d/scrape/target.go:541\ngithub.com/prometheus/prometheus/scrape.(*scrapePool).Sync\n\t/go/pkg/mod/github.com/grafana/prometheus@v1.8.2-0.20231016083943-46550094220d/scrape/scrape.go:519\ngithub.com/prometheus/prometheus/scrape.(*Manager).reload.func1\n\t/go/pkg/mod/github.com/grafana/prometheus@v1.8.2-0.20231016083943-46550094220d/scrape/manager.go:228\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650”
ts=2023-11-30T09:10:05.121595901Z level=info msg=“finished complete graph evaluation” controller_id=“” trace_id=8da826d6c15e6c085dcaa86e85060e96 duration=1.069815994s
Error: module.git.grafana_cloud:36:1: Failed to build component: building component: unexpected status code 401 Unauthorized
Error: module.git.grafana_cloud:74:14: json_decode unexpected end of JSON input
Error: module.git.grafana_cloud:80:16: json_decode unexpected end of JSON input
Error: module.git.grafana_cloud:88:11: json_decode unexpected end of JSON input
Error: module.git.grafana_cloud:28:1: Failed to evaluate node for config block: decoding River: module.git.grafana_cloud:29:11: json_decode unexpected end of JSON input
Error: module.git.grafana_cloud:63:11: json_decode unexpected end of JSON input
Error: module.git.grafana_cloud:51:11: json_decode unexpected end of JSON input
ts=2023-11-30T09:10:05.12169305Z level=error msg=“failed to start reporter” err=“context canceled”
interrupt received
Error: could not perform the initial load successfully
In case anyone else is trying to figure this out, the error “json_decode unexpected end of JSON input” is likely because your GRAFANA_CLOUD_TOKEN does not have read permissions on the stack. You can fix this by editing the access policy for the token and adding stacks:read.