generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 119
Update metrics docs, add run-container guide #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
61a125f
Update metrics docs, add run-container guide
nginx-seanmoloney c486596
Apply suggestion to update metadata for how-to guide.
nginx-seanmoloney e449dc4
Apply suggestion to update markdown format, and code block
nginx-seanmoloney 27d6bd6
Apply suggestion to update locating config file
nginx-seanmoloney 14c7195
Apply suggestion to title
nginx-seanmoloney aeb7db4
Apply suggestion to title
nginx-seanmoloney 9ee6466
Apply suggestion to sentence.
nginx-seanmoloney b5d1854
Apply suggestion to use correct note element
nginx-seanmoloney af7c5b7
Apply suggestion
nginx-seanmoloney 99daffb
Apply suggestion
nginx-seanmoloney 6a40c4d
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney 6302f0e
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney cf726ce
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney 683c2ea
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney 20a940e
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney dc76859
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney ee50b27
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 2b2c581
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 07dbd71
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney c8c3e3a
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney ff61880
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 49c039d
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 03f08f5
docs: Change Container to container, based on PR feedback
nginx-seanmoloney 341d617
Merge branch 'agent-release-3.0' into update-export-metrics-docs
JTorreG 7943667
Update content/agent/otel/configure-otel-metrics.md
JTorreG 58194d4
Apply suggestions from code review
JTorreG 5bd7093
docs: improve layout
JTorreG ffad0cc
Merge branch 'agent-release-3.0' into update-export-metrics-docs
JTorreG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
title: "Running the NGINX Agent in a Container" | ||
weight: 300 | ||
docs: DOCS-000 | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
--- | ||
|
||
## Overview | ||
|
||
This guide serves as a step-by-step guide to running the NGINX Agent in a container. It covers the basic setup needed to get the NGINX Agent up and running efficiently and securely. | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Before you begin | ||
|
||
Before you begin this guide ensure: | ||
|
||
> **Note**: This guide uses docker but the Agent will also work with other application containers. | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- **Installed Docker:** Ensure Docker is installed and configured on your system. [You can download Docker here](https://www.docker.com/products/docker-desktop/). | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- **NGINX Agent Image:** You need access to the Docker image for the NGINX Agent. Find the appropriate image in your organization's registry or on Docker Hub if publicly available. | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- **NGINX Configuration File:** Prepare and validate your NGINX configuration files that the Agent will monitor. | ||
- **Credentials:** Acquire any necessary authentication tokens or credentials required for the NGINX Agent. | ||
|
||
1. Pull the NGINX Agent Container Image | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
The NGINX Agent container image must be downloaded from a trusted source such as Docker Hub or a private container registry. | ||
JTorreG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Run the following command to pull the official image: | ||
|
||
```bash | ||
<!-- Registry HERE --> | ||
docker pull <Registry HERE>:latest | ||
``` | ||
|
||
Ensure you are using the correct image version. Replace `latest` with the desired version tag if necessary. | ||
|
||
|
||
2. Create a Configuration File | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
1. Create a configuration file named `nginx-agent.conf` in your current directory. | ||
2. Populate the file with the following structure: | ||
|
||
```vim | ||
JTorreG marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
command: | ||
server: | ||
host: "<NGINX-One-Console-URL>" # Command server host | ||
port: 443 # Command server port | ||
auth: | ||
token: "<your-data-plane-key-here>" # Authentication token for the command server | ||
tls: | ||
skip_verify: false | ||
``` | ||
|
||
Replace the placeholder values: | ||
|
||
- `<NGINX-One-Console-URL>`: The URL of your NGINX One Console instance. | ||
- `<your-data-plane-key-here>`: Your Data Plane access token. | ||
|
||
|
||
3. Run the Container | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Run the NGINX Agent container with the configuration file mounted. | ||
|
||
Use the following command: | ||
|
||
```bash | ||
docker run -d \ | ||
--name nginx-agent \ | ||
-v $(pwd)/nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf \ | ||
nginx/agent:latest | ||
``` | ||
|
||
Key options explained: | ||
|
||
- `-d`: Runs the container in detached mode. | ||
- `--name nginx-agent`: Assigns a name to the container for easy identification. | ||
- `-v $(pwd)/nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf`: Mounts the configuration file into the container. | ||
|
||
|
||
4. Verify the Container is Running | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Check the running status of the container: | ||
|
||
```bash | ||
docker ps | ||
``` | ||
|
||
You should see an entry for `nginx-agent`. The `STATUS` field should indicate that the container is running. | ||
JTorreG marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
5. Monitor Logs | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
To ensure the container is functioning properly and communicating with NGINX One Console, monitor the container logs. | ||
|
||
Run the following command: | ||
|
||
```bash | ||
docker logs -f nginx-agent | ||
``` | ||
|
||
Look for log entries indicating successful connection to the NGINX One Console and periodic metric transmission. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,229 +1,36 @@ | ||
--- | ||
title: Metrics Export | ||
title: Exporting Metrics with NGINX Agent | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
weight: 200 | ||
--- | ||
|
||
## Overview | ||
|
||
The F5 NGINX Agent v3 now includes an embedded [OpenTelemetry](https://opentelemetry.io/) Collector, streamlining observability and metric collection for NGINX instances. With this feature, you can collect: | ||
The F5 NGINX Agent now includes an embedded [OpenTelemetry](https://opentelemetry.io/) Collector, streamlining observability and metric collection for NGINX instances. With this feature, you can collect: | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
* Metrics from NGINX Plus and NGINX OSS | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
* Host metrics (CPU, memory, disk, and network activity) from VMs or Containers | ||
|
||
|
||
This guide walks you through enabling and configuring the embedded OpenTelemetry Collector for metric export. | ||
> **Note**: The OpenTelemetry exporter is enabled by default. Once a valid connection to the management plane is established, the Agent will automatically begin exporting metrics. | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
# Key Benefits | ||
### Key Benefits | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
* Seamless Integration: No need to deploy an external OpenTelemetry Collector. All components are embedded within the Agent for streamlined observability. | ||
* Standardized Protocol: Support for OpenTelemetry standards ensures interoperability with a wide range of observability backends, including Jaeger, Prometheus, Splunk, and more. | ||
|
||
## Before you begin | ||
### Verify Metrics Exported | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Before you begin configuring the F5 NGINX Agent OTel Collector: | ||
You can validate that metrics are successfully exported by using the methods below: | ||
|
||
- [NGINX One Console Getting Started]({{< relref "/nginx-one/getting-started" >}}) | ||
- F5 NGINX OSS/Plus installed on a Virtual Machine | ||
- F5 NGINX Agent v3 is installed | ||
**NGINX One Dashboard** | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
- When an instance has connected to NGINX One Console [Connect to NGINX One Console]({{< ref "/nginx-one/how-to/nginx-configs/add-instance.md" >}}), you should be able to see metrics showing on the NGINX One Dashboard. | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Configure the OTel Collector - Virtual Machine | ||
**Agent Logs** | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
1. Locate the configuration file for the F5 NGINX Agent: | ||
Check the OpenTelemetry Collector logs for confirmation of successful metric processing: | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```bash | ||
/etc/nginx-agent/nginx-agent.conf | ||
``` | ||
2. Open the configuration file for editing: | ||
|
||
```bash | ||
sudo vim /etc/nginx-agent/nginx-agent.conf | ||
``` | ||
|
||
3. Edit the `/etc/nginx-agent/nginx-agent.conf` and add the following. | ||
|
||
Make sure to replace your-data-plane-key-here with the real data plane key that you are using for your application or service. | ||
|
||
```vim | ||
collector: | ||
receivers: | ||
host_metrics: | ||
collection_interval: 1m0s | ||
initial_delay: 1s | ||
scrapers: | ||
cpu: {} | ||
memory: {} | ||
disk: {} | ||
network: {} | ||
filesystem: {} | ||
processors: | ||
batch: {} | ||
exporters: | ||
otlp_exporters: | ||
- server: | ||
host: <NGINX One Conosle Host> | ||
port: 443 | ||
authenticator: headers_setter | ||
tls: | ||
skip_verify: false | ||
extensions: | ||
headers_setter: | ||
headers: | ||
- action: insert | ||
key: "authorization" | ||
value: "your-data-plane-key-here" | ||
``` | ||
4. Restart the NGINX Agent service | ||
|
||
```bash | ||
sudo systemctl restart nginx-agent | ||
``` | ||
|
||
## Running a Container to Connect to the NGINX One Console and Send Metrics | ||
|
||
This guide provides step-by-step instructions on how to run a container to connect to the NGINX One Console and send metrics. Follow these steps to ensure proper setup and execution. | ||
|
||
--- | ||
|
||
## Prerequisites | ||
Before running the container, ensure the following: | ||
1. **Docker Installed**: Docker must be installed on your system. You can download it from [Docker's official website](https://www.docker.com/). | ||
2. **NGINX One Console**: The NGINX One Console is set up and accessible. | ||
3. **Data Plane Token**: Obtain an access key or Data Plane token from the NGINX One Console for authentication. | ||
4. **Network Connectivity**: Verify that the container can reach the NGINX One Console endpoint. | ||
|
||
--- | ||
|
||
## Steps to Run the Container | ||
|
||
### Step 1: Pull the NGINX Metrics Agent Container Image | ||
The NGINX Metrics Agent container image must be downloaded from a trusted source such as Docker Hub or a private container registry. | ||
|
||
Run the following command to pull the official image: | ||
```bash | ||
<!-- Registry HERE --> | ||
docker pull <Registry HERE>:latest | ||
``` | ||
|
||
Ensure you are using the correct image version. Replace `latest` with the desired version tag if necessary. | ||
|
||
--- | ||
|
||
### Step 2: Create a Configuration File | ||
|
||
1. Create a configuration file named `nginx-agent.conf` in your current directory. | ||
2. Populate the file with the following structure: | ||
|
||
```vim | ||
command: | ||
server: | ||
host: "<NGINX-One-Console-URL>" # Command server host | ||
port: 443 # Command server port | ||
type: 0 # Server type (e.g., 0 for gRPC) | ||
auth: | ||
token: "<your-data-plane-key-here>" # Authentication token for the command server | ||
tls: | ||
skip_verify: false | ||
|
||
collector: | ||
receivers: | ||
host_metrics: | ||
collection_interval: 1m0s | ||
initial_delay: 1s | ||
scrapers: | ||
cpu: {} | ||
memory: {} | ||
disk: {} | ||
network: {} | ||
filesystem: {} | ||
processors: | ||
batch: {} | ||
exporters: | ||
otlp_exporters: | ||
- server: | ||
host: <saas-host> | ||
port: 443 | ||
authenticator: headers_setter | ||
tls: | ||
skip_verify: false | ||
extensions: | ||
headers_setter: | ||
headers: | ||
- action: insert | ||
key: "authorization" | ||
value: "your-data-plane-key-here" | ||
``` | ||
|
||
Replace the placeholder values: | ||
- `<NGINX-One-Console-URL>`: The URL of your NGINX One Console instance. | ||
- `<your-data-plane-key-here>`: Your Data Plane access token. | ||
|
||
--- | ||
|
||
### Step 3: Run the Container | ||
Run the NGINX Agent container with the configuration file mounted. | ||
|
||
Use the following command: | ||
```bash | ||
docker run -d \ | ||
--name nginx-agent \ | ||
-v $(pwd)/nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf \ | ||
nginx/agent:latest | ||
``` | ||
|
||
Key options explained: | ||
- `-d`: Runs the container in detached mode. | ||
- `--name nginx-agent`: Assigns a name to the container for easy identification. | ||
- `-v $(pwd)/nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf`: Mounts the configuration file into the container. | ||
|
||
--- | ||
|
||
### Step 4: Verify the Container is Running | ||
Check the running status of the container: | ||
```bash | ||
docker ps | ||
``` | ||
|
||
You should see an entry for `nginx-agent`. The `STATUS` field should indicate that the container is running. | ||
|
||
--- | ||
|
||
### Step 5: Monitor Logs | ||
To ensure the container is functioning properly and communicating with NGINX One Console, monitor the container logs. | ||
|
||
Run the following command: | ||
```bash | ||
docker logs -f nginx-agent | ||
``` | ||
|
||
Look for log entries indicating successful connection to the NGINX One Console and periodic metric transmission. | ||
|
||
--- | ||
|
||
### Troubleshooting | ||
|
||
1. **Container Fails to Start**: | ||
- Check the configuration file for errors. | ||
- Ensure the NGINX One Console endpoint is reachable from the host. | ||
|
||
2. **No Metrics Sent**: | ||
- Verify the access token is valid. | ||
- Confirm network connectivity to the NGINX One Console. | ||
|
||
3. **Logs Show Errors**: | ||
- Examine the logs for specific error messages. | ||
- Address any permission or network-related issues. | ||
|
||
--- | ||
|
||
## Clean Up | ||
To stop and remove the container when it is no longer needed, run: | ||
```bash | ||
docker stop nginx-metrics-agent | ||
docker rm nginx-metrics-agent | ||
``` | ||
|
||
--- | ||
|
||
## Conclusion | ||
Following these instructions, you can successfully run a container to connect to the NGINX One Console and send metrics. For further details or issues, refer to the documentation provided by NGINX or your administrator. | ||
1. Open the file: ```/var/log/nginx-agent/opentelemetry-collector-agent.log``` | ||
2. Look for the following logs: | ||
```vim | ||
Everything is ready. Begin running and processing data. | ||
``` | ||
nginx-seanmoloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.