I have a vanilla ubuntu 24.04 server on Hetzner cloud.
I have run the install commands at the terminal that I got from the
“Linux Server - Add new connection - Connections - Grafana” page https://.grafana.net/connections/add-new-connection/linux-node?page=alloy
This script below runs fine.
GCLOUD_FM_URL="https://fleet-management-prod-023.grafana.net" GCLOUD_FM_POLL_FREQUENCY="60s" GCLOUD_FM_HOSTED_ID="< MY ID HERE>" ARCH="amd64" GCLOUD_RW_API_KEY="< MY TOKEN HERE>" /bin/sh -c "$(curl -fsSL https://storage.googleapis.com/cloud-onboarding/alloy/scripts/install-linux.sh)"
I seem to have a working Alloy service, but when ever I use the “Test Alloy connection” button I get an error.
I installed web server and am able to see default page.
There is no firewall installed.
Any suggestions on what I should do next to get server connected to Grafana cloud?
1 Like
I also tried the following config.alloy file
local.file "logs" {
files = ["/tmp/test.log"] # Create /tmp/test.log for testing
poll_interval = "10s"
forward_to = [loki.input]
}
loki.write "grafana_cloud" {
endpoint {
url = "https://fleet-management-prod-023.grafana.net/loki/api/v1/push"
basic_auth {
username = "<my ID here>"
password = "<my token here>"
}
}
labels = {
job = "test_logs",
host = env("HOSTNAME"),
}
}
And then I get the following:
so you have both alloy and grafana installed on that ubuntu vm?
@yosiasz I only have the Alloy installed on the Ubuntu VM.
That was installed by the https://storage.googleapis.com/cloud-onboarding/alloy/scripts/install-linux.sh script.
I am assuming that Alloy will route the logs and metrics etc through to my account on Grafana-Cloud.
I also assume that by putting the button to “Test Alloy Connection” that we are all setup to check that the plumbing is in place. If there was still more to do before messages could be sent from the Ubuntu VM to Grafana-Cloud account then the button should be removed.
Is that your entire alloy configuration? Doesn’t look quite right. As your screenshot suggests, alloy is not running. Check the journal log, it should tell you why.
Well I finally got some logs into Grafana cloud
but I think the hello world onboarding could be better.
Forward to the next step of getting some metrics sent to Grafana… Hopefully that will be easier.
For those that follow on!
Here are a few recent config.allloy files that might inspire.
grafana/alloy-scenarios: A collection of working Alloy scenarios
This is what worked for me. Also make sure that the access policy and token have sufficient rights.
livedebugging {
enabled = true
}
local.file_match "local_files" {
path_targets = [{"__path__" = "/temp/logs/*.log", "job" = "python", "hostname" = constants.hostname}]
sync_period = "5s"
}
loki.source.file "log_scrape" {
targets = local.file_match.local_files.targets
forward_to = [loki.write.grafana_cloud.receiver]
tail_from_end = true
}
loki.write "grafana_cloud" {
endpoint {
url = "https://your url here .grafana.net/loki/api/v1/push"
basic_auth {
username = "your ID here"
password = "your token here"
}
}
}
2 Likes
I have the same issue. Tested on Fedora 42 and RHEL 9.5
i get same issue for linux server. alloy.service is active (running) but when i test connection i get the error
" Oops! Something went wrong. Make sure the install instructions were copied correctly and check for any optional configurations. If you’re still running into issues, read the troubleshooting instructions."
What’s in the journal log for alloy?
if i skip to the next step( Set up Grafana Alloy to use the Linux Server integration) it seems that it is working fine. So the issue appears only when trying to test the connection from step 2 when trying to add a new connection - Linux server