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?
2 Likes
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
Same issue here. Have you figured it out?
I’m also using hetzner. My exact reproducible steps from a clean install of a Ubuntu 24.04.1 LTS:
I followed these steps:
- Clicked on this page Instrument a Node.js application | Grafana Cloud documentation . I updated
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=${DEPLOYMENT_ENV},service.version=${IMAGE_TAG:-latest},service.instance.id=${HOSTNAME}"
and this is only deviation from that page
- I checked out “Next steps”. I created a free Grafana cloud and went straight to step 3. “3. For production, set up an OpenTelemetry Collector”
- In “Grafana alloy” section of the page it says “Consult the Grafana Alloy documentation”
- I clicked that link and I checked “Recommended setup” section of the page, which again linked to another resource: “Grafana Labs recommends instrumentation of the OpenTelemetry (OTLP) with Grafana Alloy Grafana Cloud integration tile to configure Alloy.”
- So I clicked to see how can I add this “integration tile”
- I followed the steps on that page
- This leads to this
- Service is up and running on the machine
mario@Ubuntu-2404-noble-amd64-base:~$ systemctl status alloy
● alloy.service - Vendor-agnostic OpenTelemetry Collector distribution with programmable pipelines
Loaded: loaded (/usr/lib/systemd/system/alloy.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/alloy.service.d
└─env.conf
Active: active (running) since Tue 2025-04-08 11:42:56 CEST; 20min ago
Docs: https://grafana.com/docs/alloy
Main PID: 3383552 (alloy)
Tasks: 17 (limit: 76975)
Memory: 51.2M (peak: 52.0M)
CPU: 3.107s
CGroup: /system.slice/alloy.service
└─3383552 /usr/bin/alloy run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
- curl is working. service is healthy
mario@Ubuntu-2404-noble-amd64-base:~$ curl -X POST https://prometheus-prod-24-prod-eu-west-2.grafana.net/api/prom/push \
-u ID:GLC_KEY \
-H "Content-Type: application/x-protobuf" \
--data-binary @/dev/null
getting snappy decoded length: snappy: corrupt input
mario@Ubuntu-2404-noble-amd64-base:~$ curl -X POST https://logs-prod-012.gramario@Ubuntu-2404-noble-amd64-base:~$ curl -X POST https://logs-prod-012.grafana.net/loki/api/v1/push \
-u ID:GLC_KEY \
-H "Content-Type: application/json" \
-d '{}'
error at least one valid stream is required for ingestion
mario@Ubuntu-2404-noble-amd64-base:~$ curl http://localhost:12345/-/ready
curl http://localhost:12345/-/healthy
Alloy is ready.
All Alloy components are healthy.
What does alloy journal log says? (journalctl -u alloy)
Just a quick note on the Scenarios you linked here. I’m working on getting them into the core Alloy docs so they are easier to find and hopefully.. eventually easier to understand. The PR for the first draft at adding doc info for this is here: Add scenarios to Alloy docs by clayton-cornell · Pull Request #2826 · grafana/alloy · GitHub Hopefully it’ll be merged this week.
Sorry for late response. Here is the sample of logs from journalctl -u alloy
Apr 08 12:40:04 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:04.45148171Z level=info msg="Starting HTTP server" component_path=/ component_id=otelcol.receiver.otlp.de>
Apr 08 12:40:04 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:04.645773688Z level=info msg="Starting GRPC server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:40:04 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:04.645931993Z level=info msg="Starting HTTP server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:40:31 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:31.964266352Z level=info msg="Starting GRPC server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:40:31 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:31.964419697Z level=info msg="Starting HTTP server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:40:32 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:32.213431971Z level=info msg="Starting GRPC server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:40:32 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:40:32.213575875Z level=info msg="Starting HTTP server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:42:39 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:42:39.564206337Z level=info msg="Starting GRPC server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 12:42:39 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T10:42:39.564363212Z level=info msg="Starting HTTP server" component_path=/ component_id=otelcol.receiver.otlp.d>
Apr 08 14:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T12:39:28.074117284Z level=info msg="series GC completed" component_path=/ component_id=prometheus.remote_write.>
Apr 08 14:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T12:39:28.074270539Z level=info msg="Creating checkpoint" component_path=/ component_id=prometheus.remote_write.>
Apr 08 14:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T12:39:28.10785808Z level=info msg="WAL checkpoint complete" component_path=/ component_id=prometheus.remote_wri>
Apr 08 15:43:27 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T13:43:27.991516159Z level=info msg="reporting Alloy stats" date=2025-04-08T15:43:27.991+02:00
Apr 08 15:43:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T13:43:28.124895615Z level=info msg="usage report sent with success"
Apr 08 16:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T14:39:28.109340624Z level=info msg="series GC completed" component_path=/ component_id=prometheus.remote_write.>
Apr 08 18:12:56 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:12:56.845734747Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:13:07 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:13:07.281754918Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:21:40 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:21:40.562263263Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:26:32 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:26:32.730458538Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:31:12 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:31:12.437615723Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:31:59 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:31:59.978571756Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:36:04 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:36:04.777117417Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:37:15 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:37:15.610378925Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:38:37 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:38:37.669571432Z level=info msg="Exporting failed. Will retry the request after interval." component_path=/ >
Apr 08 18:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:39:28.11089764Z level=info msg="series GC completed" component_path=/ component_id=prometheus.remote_write.m>
Apr 08 18:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:39:28.111059585Z level=info msg="Creating checkpoint" component_path=/ component_id=prometheus.remote_write.>
Apr 08 18:39:28 Ubuntu-2404-noble-amd64-base alloy[3424749]: ts=2025-04-08T16:39:28.132680706Z level=info msg="WAL checkpoint complete" component_path=/ component_id=prometheus.remote_wr>
Visting UI on :12345 port also says everything is healthy