Skip to content
Merged
Show file tree
Hide file tree
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 Apr 2, 2025
c486596
Apply suggestion to update metadata for how-to guide.
nginx-seanmoloney Apr 7, 2025
e449dc4
Apply suggestion to update markdown format, and code block
nginx-seanmoloney Apr 7, 2025
27d6bd6
Apply suggestion to update locating config file
nginx-seanmoloney Apr 7, 2025
14c7195
Apply suggestion to title
nginx-seanmoloney Apr 7, 2025
aeb7db4
Apply suggestion to title
nginx-seanmoloney Apr 7, 2025
9ee6466
Apply suggestion to sentence.
nginx-seanmoloney Apr 7, 2025
b5d1854
Apply suggestion to use correct note element
nginx-seanmoloney Apr 7, 2025
af7c5b7
Apply suggestion
nginx-seanmoloney Apr 7, 2025
99daffb
Apply suggestion
nginx-seanmoloney Apr 7, 2025
6a40c4d
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney Apr 7, 2025
6302f0e
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney Apr 7, 2025
cf726ce
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney Apr 7, 2025
683c2ea
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney Apr 7, 2025
20a940e
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
dc76859
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
ee50b27
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
2b2c581
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
07dbd71
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
c8c3e3a
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
ff61880
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
49c039d
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney Apr 7, 2025
03f08f5
docs: Change Container to container, based on PR feedback
nginx-seanmoloney Apr 7, 2025
341d617
Merge branch 'agent-release-3.0' into update-export-metrics-docs
JTorreG Apr 7, 2025
7943667
Update content/agent/otel/configure-otel-metrics.md
JTorreG Apr 8, 2025
58194d4
Apply suggestions from code review
JTorreG Apr 8, 2025
5bd7093
docs: improve layout
JTorreG Apr 8, 2025
ffad0cc
Merge branch 'agent-release-3.0' into update-export-metrics-docs
JTorreG Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions content/agent/how-to/export-metrics.md

This file was deleted.

98 changes: 98 additions & 0 deletions content/agent/how-to/run-agent-container.md
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
---

## 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.

## Before you begin

Before you begin this guide ensure:

> **Note**: This guide uses docker but the Agent will also work with other application containers.
- **Installed Docker:** Ensure Docker is installed and configured on your system. [You can download Docker here](https://www.docker.com/products/docker-desktop/).
- **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 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

The NGINX 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.


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
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

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

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.

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.
223 changes: 15 additions & 208 deletions content/agent/otel/configure-otel-metrics.md
Original file line number Diff line number Diff line change
@@ -1,229 +1,36 @@
---
title: Metrics Export
title: Exporting Metrics with NGINX Agent
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:

* Metrics from NGINX Plus and NGINX OSS
* 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.

# Key Benefits
### Key Benefits

* 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

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**

- 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.

## Configure the OTel Collector - Virtual Machine
**Agent Logs**

1. Locate the configuration file for the F5 NGINX Agent:
Check the OpenTelemetry Collector logs for confirmation of successful metric processing:

```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.
```
5 changes: 0 additions & 5 deletions content/agent/otel/metrics.md

This file was deleted.

Loading