Skip to content

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 28 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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.

105 changes: 105 additions & 0 deletions content/agent/how-to/run-agent-container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: "Run the NGINX Agent in a container"
weight: 300
toc: true
type: how-to
product: Agent
---

## Overview

This guide serves as a step-by-step guide to run 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 NGINX Agent also works with other container applications.
{{< /note >}}

- **Docker:** Ensure Docker is installed and configured on your system. [Download Docker from the official site](https://www.docker.com/products/docker-desktop/).
- **Credentials:** Acquire any necessary authentication tokens or credentials required for the NGINX Agent.

## Prepare the environment

To run NGINX Agent in a container you will need to download the NGINX Agent
container image and create a configuration file.

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


### Create a configuration file

Create a configuration file named `nginx-agent.conf` in your current directory
and populate the file with the following structure:

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


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


### 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 indicates that the container is running.

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