Hello, I’m using Grafana Cloud and on my node that I want to monitor logs from, when running ./alloy-linux-amd64 run config.alloy
I am getting error:
level=error msg="final error sending batch"
component_path=/remotecfg/self_monitoring_logs_linux.default
component_id=loki.write.grafana_cloud_loki component=client
host=logs-prod-024.grafana.net status=401 tenant=""
error="server returned HTTP status 401 Unauthorized (401):
{\"status\":\"error\",\"error\":\"authentication error: invalid token\"}"
What surprises me is that all configurations have been made using the Grafana Cloud provided script for both Alloy and Collector.
I cannot test the credentials because Grafana Cloud disables access to them:
My config.alloy
as follows:
cat config.alloy
remotecfg {
url = "https://fleet-management-prod-0XX.grafana.net"
id = "atl"
poll_frequency = "60s"
basic_auth {
username = "1308XXX"
password = "glc_eyJvIjoiMTQ3NTcxMyIsIm4iXXXXXXXXXXXXXXXXwibSI6eyJyIjoicHJvZC1zYS1lYXN0LTEifX0="
}
}
prometheus.remote_write "metrics_service" {
endpoint {
url = "https://prometheus-prod-XXX-1.grafana.net/api/prom/push"
basic_auth {
username = "254XXXX"
password = "glc_eyJvIjoiMTQ3NTcxMyIsIm4iXXXXXXXXXXXXXXXXwibSI6eyJyIjoicHJvZC1zYS1lYXN0LTEifX0="
}
}
}
loki.write "grafana_cloud_loki" {
endpoint {
url = "https://logs-prod-Xx.grafana.net/loki/api/v1/push"
basic_auth {
username = "126xxxxx"
password = "glc_eyJvIjoiMTQ3NTcxMyIsIm4iXXXXXXXXXXXXXXXXwibSI6eyJyIjoicHJvZC1zYS1lYXN0LTEifX0="
}
}
}
local.file_match "local_files" {
path_targets = [{"__path__" = "/opt/atlassian/jira/logs*.*"}]
sync_period = "5s"
}