1

我在使用 Instana 监控我的 GitLab 安装时遇到了一些问题。GitLab 和附带的 nginx 运行良好,只有监控不起作用。

Instana 识别 nginx,但无法获取任何信息,因为它无法从 /nginx_status 位置获取数据。

我将 /nginx_status 的附加配置添加到 /etc/gitlab/gitlab.rb 并使用 gitlab-ctl reconfigure 安装它(正如 gitlab 文档所说)。基本上 gitlab 工作正常并公开状态页面http://git-test:9999/nginx_status

我的配置文件 /var/opt/gitlab/nginx/conf/nginx.conf 现在在其末尾有一个额外的包含 /var/opt/gitlab/nginx/conf/nginx-status.conf 。文件内容似乎也很好。

server  {
    listen 10.51.13.169:9999;
    server_name s00228862uv.ads.provinzial.com;
    location /nginx_status {
      stub_status;
      server_tokens off;
      access_log off;
      allow all;
      deny all;
      stub_status on;
    }
    location /metrics {
      vhost_traffic_status_display;
      vhost_traffic_status_display_format prometheus;
      server_tokens off;
      access_log off;
      allow all;
      deny all;
      stub_status on;
    }

    location /rails-metrics {
      proxy_cache off;
      proxy_pass  http://gitlab-workhorse/-/metrics;
      server_tokens off;
      access_log off;
      allow all;
      deny all;
      stub_status on;
    }
}

我现在的问题是 instana 没有获取通过 /nginx_status 公开的信息,说明 nginx 需要配置。

未找到状态 URL。nginx 配置文件被解析,找不到 stub_status 方向。需要配置此指令以收集 nginx 指标。以下片段显示了如何在 nginx 配置文件中配置 stub_status。

在我看来,instana 似乎没有遵循包含,因此没有从 /var/opt/gitlab/nginx/conf/nginx-status.conf 中获取配置。所以基本上 instana 对它要求的信息一无所知。

你们中有人知道我如何将这些状态信息提供给 instana 吗?在此先感谢各位,并致以最诚挚的问候。塞巴斯蒂安

4

1 回答 1

1

您可以删除该服务器中的位置 /nginx_status,并添加一个新的服务器部分,如下所示:

server {
    listen 127.0.0.1:80;
    server_name 127.0.0.1;

    # Required by Instana
    location /nginx_status {
        stub_status on;
        access_log off;
    }
}
于 2020-04-01T16:46:26.303 回答