【Fixed】Nginx panel not working and show "parse error"

What happen?

my nginx panel not working.

( i’m a rookie, if i mistake a easy error, tell me please and Sorry occupy your time, thank you. )

How to do?

  1. create grafana cloud account;
  2. choice “nginx” in first step, I back my server ssh and update nginx config, running the shell tips ( install agent software? but i not enable GEO plugin )
  3. testing connect, like one minute, show “working”.
  4. now goto panel, the error show again:

parse error : queries require at least one regexp or equality matcher that does not have an empty-compatible value. For instance, app=~".*" does not meet this requirement, but app=~".+" will

Other info

this my nginx log content:

{"msec": "1637667266.517", "connection": "1145396", "connection_requests": "2", "pid": "2600926", "request_id": "c287b7c6e00a442ddf533096432dd94f", "request_length": "345", "remote_addr": "", "remote_user": "", "remote_port": "41896", "time_local": "23/Nov/2021:19:34:26 +0800", "time_iso8601": "2021-11-23T19:34:26+08:00", "request": "POST /api/login?v=70 HTTP/1.1", "request_uri": "/api/login?v=70", "args": "v=70", "status": "403", "body_bytes_sent": "74", "bytes_sent": "354", "http_referer": "", "http_user_agent": "UnityPlayer/2019.4.19f1c1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)", "http_x_forwarded_for": "", "http_host": "api.uiosun.com", "server_name": "api.uiosun.com", "request_time": "0.027", "upstream": "unix:/var/run/php/php8.0-fpm.sock", "upstream_connect_time": "0.000", "upstream_header_time": "0.024", "upstream_response_time": "0.024", "upstream_response_length": "84", "upstream_cache_status": "", "ssl_protocol": "TLSv1.2", "ssl_cipher": "ECDHE-RSA-AES128-GCM-SHA256", "scheme": "https", "request_method": "POST", "server_protocol": "HTTP/1.1", "pipe": ".", "gzip_ratio": ""}
{"msec": "1637667272.892", "connection": "1145396", "connection_requests": "3", "pid": "2600926", "request_id": "890973e4213884c263f1ab42fef12ddf", "request_length": "385", "remote_addr": "", "remote_user": "", "remote_port": "41896", "time_local": "23/Nov/2021:19:34:32 +0800", "time_iso8601": "2021-11-23T19:34:32+08:00", "request": "POST /api/register?v=70 HTTP/1.1", "request_uri": "/api/register?v=70", "args": "v=70", "status": "403", "body_bytes_sent": "74", "bytes_sent": "354", "http_referer": "", "http_user_agent": "UnityPlayer/2019.4.19f1c1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)", "http_x_forwarded_for": "", "http_host": "api.uiosun.com", "server_name": "api.uiosun.com", "request_time": "0.017", "upstream": "unix:/var/run/php/php8.0-fpm.sock", "upstream_connect_time": "0.000", "upstream_header_time": "0.016", "upstream_response_time": "0.016", "upstream_response_length": "84", "upstream_cache_status": "", "ssl_protocol": "TLSv1.2", "ssl_cipher": "ECDHE-RSA-AES128-GCM-SHA256", "scheme": "https", "request_method": "POST", "server_protocol": "HTTP/1.1", "pipe": ".", "gzip_ratio": ""}
{"msec": "1637667339.430", "connection": "1145402", "connection_requests": "1", "pid": "2600926", "request_id": "df9aee5486e5a5dbb1ce4c521ade6657", "request_length": "314", "remote_addr": "", "remote_user": "", "remote_port": "58783", "time_local": "23/Nov/2021:19:35:39 +0800", "time_iso8601": "2021-11-23T19:35:39+08:00", "request": "GET /api/city/saved?v=70 HTTP/1.1", "request_uri": "/api/city/saved?v=70", "args": "v=70", "status": "200", "body_bytes_sent": "4717", "bytes_sent": "4990", "http_referer": "", "http_user_agent": "UnityPlayer/2019.4.19f1c1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)", "http_x_forwarded_for": "", "http_host": "api.uiosun.com", "server_name": "api.uiosun.com", "request_time": "0.031", "upstream": "unix:/var/run/php/php8.0-fpm.sock", "upstream_connect_time": "0.000", "upstream_header_time": "0.028", "upstream_response_time": "0.028", "upstream_response_length": "4723", "upstream_cache_status": "", "ssl_protocol": "TLSv1.2", "ssl_cipher": "ECDHE-RSA-AES128-GCM-SHA256", "scheme": "https", "request_method": "GET", "server_protocol": "HTTP/1.1", "pipe": ".", "gzip_ratio": ""}

this my panel snapshot:

i find other data source, the name is: “grafanacloud-uiosun-usage-insights”, I choice that, now, Total request not zero, but Recent request show “JSONParserErr” – all line:

my environment is:

  • Grafana Cloud (Free Account) – 2021.11.24 created
  • Server: Bandwagonhost 1 CPU & 2G RAM – 5%~10% occupy only
  • System: Linux Ubuntu20 64x
  • Nginx: nginx/1.18.0 (Ubuntu)

I fixed.

in config file (my server), I not set log file path, so never not data has loki.

Hi, I am facing the same issue. Do you know where is the location of the config file or which config file? Thanks

check /ect/grafana-agent.yaml in your server?