You can enable metrics configuration by exposing your Agent data via environmental variables in your Docker container or Kubernetes cluster.
To get the Nobl9 Agent metrics, you need to have a monitoring solution that can scrape a Prometheus-compliant metrics endpoint.
This endpoint returns an
OK response to a standard
GET request if the Agent is "healthy." The
OK response means that the Agent code has completed initialization and is running.
This endpoint returns Prometheus-scrapable metrics data in response to a standard
GET request. It is a text-based endpoint handled by the Golang Prometheus libraries.
Exposing the Agent to Metrics
To scrape Agent's metrics, you need to define the
N9_METRICS_PORT as an environmental variable while deploying your Agent through Kubernetes YAML or a Docker invocation generated in the UI:
Here's a shortened example of Kubernetes deployment YAML with the defined
- name: agent-container
- name: N9_METRICS_PORT
Here's an example of Docker deployment command with the defined
docker run -d --restart on-failure \
--name nobl9-agent-example \
-e N9_CLIENT_ID="unique_client_id" \
-e N9_CLIENT_SECRET="unique_client_secret" \
-e N9_METRICS_PORT="9090" \
N9_METRICS_PORTis a variable specifying the TCP port to which the
/healthendpoints are exposed.
9090is the default value, and you can change it to adjust to the port that you’re using on your infrastructure.
If you don't want the Agent metrics to be exposed, comment out or delete the
You can find the list of available Agent Metrics in the Agent documentation.
After deploying the Nobl9 Agent, you can check if the Agent completed the initialization and is running by exposing the
/health endpoint. You can then get the following response:
You can also expose the
/metrics endpoint, for example, using Prometheus. The metrics exposed by Nobl9 have the
n9 prefix, for example:
For more metrics use cases, refer to the Agent Metrics documentation.