Web Server agent

Prerequisites

  • Docker should be installed (Steps to install docker - https://docs.docker.com/get-docker/)
  • URL of the SixthSense collector which will be provided by Customer Support.
  • Access token from the SixthSense portal. For accessing the token, see Accessing your Access Token.
  • docker registry credentials which ill be provided by Customer Support.
  1. Enable Nginx status module You can skip this step if ngx_http_stub_status_module or ngx_http_api_module is already enabled.

Nginx open source

location /status {
stub_status;
allow 127.0.0.1;
deny all;
}

Nginx Plus

location /status {
api;
allow 127.0.0.1;
deny all;
}
  1. Download Nginx agent Docker image.
docker login gitlab-registry.34.120.183.186.sslip.io
# username and password will be provided by onboarding team
docker pull gitlab-registry.34.120.183.186.sslip.io/sixthsense/sixthsense-mvn-dependency/nginx-agent:v2
  1. Configure the Nginx agent.

Create a .env file containing below properties

Note: For connecting the agent to Onecloud collector, SSL should be set to false, i.e. SSL=false.

SERVICE_NAME=<name of the service>
SS_HOST=<host name of the sixthsense collector>
NGINX_STATUS_URL=<Nginx status URL eg. http://host.docker.internal/status>
AUTHENTICATION=<authentication token from dashboard>
SSL=<boolean, flag if ssl is required>
FETCH_INTERVAL=* * * * * *DEBUG=ss-agent:<level> (level supported: debug, info, warn, error)

Example: Agent Configuration

SERVICE_NAME=nginx_QA_Prod
SS_HOST=grpc-collector-observability.sixthsense.rakuten.com:443
NGINX_STATUS_URL=http://host.docker.internal/status/
AUTHENTICATION=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZWFtSWQiOiJmOTJmMjFhMC0xNDQ2LTRlNjItOTM4ZS1lZWFhN2UwZTc4NDkiLCJiaWxsaW5nX2lkIjoiMzVhNzBlZDUtZjZmMS00ZGViLTg2YmItYjdhYWFiMmQ1ZDQ3IiwiaWF0IjoxNjQ0MjMwODk2LCJhdWQiOiJvYXAiLCJpc3MiOiJzaXh0aC1zZW5zLWF1dGgifQ.O133bsGRnNMuetwcnFm05hpw9uGbzCTPDP5KJhtA7ok
SSL=true
FETCH_INTERVAL=* * * * * *
DEBUG=ss-agent:info
  1. Start the Nginx agent.

Run the agent using the following command.

docker run --env-file ./.env -d --restart always gitlab-registry.34.120.183.186.sslip.io/sixthsense/sixthsense-mvn-dependency/nginx-agent:v2

References: