Log-collecting agent for API Discovery for NGINX โ ships NGINX access logs to the dashboard
213
๐ฐ๐ท ํ๊ตญ์ด ๋ฌธ์๋ ์ด ํ์ด์ง ์๋์ชฝ์ ์์ต๋๋ค. ยท Korean documentation follows below.
The log collector for API Discovery for NGINX. It runs on your NGINX host, tails the access log (and optionally the NGINX Plus REST API), and ships records to the dashboard.
๐ Dashboard image:
gusgh13900/api-discovery-nginxโ โ collector server + web UI (:8080). Keep it on the same version tag as this image.
| Image | Role | Download | On disk | Runs on |
|---|---|---|---|---|
api-discovery-agent (this image) | NGINX log collector | ~21 MB | ~56 MB | NGINX host |
api-discovery-nginx | Collector server + web dashboard (:8080) | ~288 MB | ~1 GB | Dashboard host |
linux/amd64 (no ARM build)Start the dashboardโ first, then run this on your NGINX host:
docker run -d --name api-discovery-agent \
--network host \
-e DASHBOARD_URL=http://<dashboard-host>:8080 \
-e INGEST_TOKEN=<same token as the dashboard> \
-e LOG_PATH=/var/log/nginx/api_access.log \
-e CURSOR_FILE=/agent/state/agent_cursor.json \
-e NGINX_PLUS_API=http://127.0.0.1:411/api/9 \
-v /var/log/nginx:/var/log/nginx:ro \
-v $PWD/state:/agent/state \
gusgh13900/api-discovery-agent:1.2.1
INGEST_TOKENmust be identical on both sides. A mismatch is the usual reason an agent starts cleanly, reportsHTTP 401in its log, and never appears in the dashboard. Leaving it empty disables authentication entirely โ local use only.
Drop --network host if the dashboard is remote and you are not collecting NGINX Plus metrics.
| Variable | Required | Default | Description |
|---|---|---|---|
DASHBOARD_URL | โ | โ | Dashboard address, e.g. http://10.0.0.5:8080 |
INGEST_TOKEN | (empty) | Must match the dashboard | |
LOG_PATH | /var/log/nginx/api_access.log | Active log file, as seen inside the container | |
LOG_ROTATE_DIR | /var/log/nginx/old | logrotate archive directory (empty to skip) | |
LOG_ROTATE_PATTERN | api_access.log-*.gz | Glob for rotated files (must contain an 8-digit date) | |
CURSOR_FILE | /agent/state/agent_cursor.json | Read position, so restarts don't resend. Put this on a volume. | |
NGINX_PLUS_API | (empty) | NGINX Plus REST API URL (empty to skip) | |
POLL_INTERVAL | 30 | Seconds between polls | |
BATCH_SIZE | 5000 | Maximum rows per request | |
RETAIN_DAYS | 7 | Skip rotated logs older than this | |
SKIP_ERROR_RESPONSES | false | Exclude 4xx/5xx responses | |
AGENT_ID | hostname | Identifier shown in the dashboard |
/var/log/nginx (read-only), /agent/state (cursor persistence)log_format block to copy is on the dashboard image pageโ .curl -O https://raw.githubusercontent.com/VEEP09/api-discovery-for-nginx/main/docker-compose.agent.yml
DASHBOARD_URL=http://<dashboard-host>:8080 INGEST_TOKEN=<token> \
docker compose -f docker-compose.agent.yml up -d
Run this on your NGINX host, not on the dashboard host.
| Tag | Description |
|---|---|
latest | Newest stable release (currently 1.2.1) |
1.2.1 | No source changes; released alongside the dashboard. Release notesโ |
1.2.0 | English log output and --help. Release notesโ |
1.1.0 | Base image refresh, no source changes. Release notesโ |
1.0.0 | Initial release |
Pin a version tag in production rather than using latest, and keep the dashboard and agent on the same tag. Sizes above are compressed download sizes.
API Discovery for NGINX ์ ๋ก๊ทธ ์์ง ์์ด์ ํธ์ ๋๋ค. NGINX ์๋ฒ์์ ์คํ๋๋ฉฐ ์ก์ธ์ค ๋ก๊ทธ(๋ฐ ์ ํ์ ์ผ๋ก NGINX Plus REST API ์งํ)๋ฅผ ์ฝ์ด ๋์๋ณด๋๋ก ์ ์กํฉ๋๋ค.
๐ ๋์๋ณด๋ ์ด๋ฏธ์ง:
gusgh13900/api-discovery-nginxโ โ ์์ง ์๋ฒ + ์น UI(:8080). ์ด ์ด๋ฏธ์ง์ ๋์ผํ ๋ฒ์ ํ๊ทธ๋ก ๋ง์ถฐ ์ฌ์ฉํ์ธ์.
| ์ด๋ฏธ์ง | ์ญํ | ๋ค์ด๋ก๋ | ๋์คํฌ | ์คํ ์์น |
|---|---|---|---|---|
api-discovery-agent (์ด ์ด๋ฏธ์ง) | NGINX ๋ก๊ทธ ์์ง ์์ด์ ํธ | ~21 MB | ~56 MB | NGINX ์๋ฒ |
api-discovery-nginx | ์์ง ์๋ฒ + ์น ๋์๋ณด๋ (:8080) | ~288 MB | ~1 GB | ๋์๋ณด๋ ์๋ฒ |
linux/amd64 (ARM ๋ฏธ์ง์)๋จผ์ ๋์๋ณด๋โ ๋ฅผ ๋์ด ๋ค, NGINX ์๋ฒ์์ ์คํํฉ๋๋ค.
docker run -d --name api-discovery-agent \
--network host \
-e DASHBOARD_URL=http://<๋์๋ณด๋-์๋ฒ>:8080 \
-e INGEST_TOKEN=<๋์๋ณด๋์ ๋์ผํ ํ ํฐ> \
-e LOG_PATH=/var/log/nginx/api_access.log \
-e CURSOR_FILE=/agent/state/agent_cursor.json \
-e NGINX_PLUS_API=http://127.0.0.1:411/api/9 \
-v /var/log/nginx:/var/log/nginx:ro \
-v $PWD/state:/agent/state \
gusgh13900/api-discovery-agent:1.2.1
INGEST_TOKEN์ ์์ชฝ์ด ๋ฐ๋์ ๋์ผํด์ผ ํฉ๋๋ค. ๊ฐ์ด ๋ค๋ฅด๋ฉด ์์ด์ ํธ๋ ์ ์ ๊ธฐ๋ํ๊ณ ๋ก๊ทธ์HTTP 401๋ง ๋ฐ๋ณตํด์ ์ฐ์ผ๋ฉฐ ๋์๋ณด๋์๋ ๋๋ด ๋ํ๋์ง ์์ต๋๋ค. ๋น์๋๋ฉด ์ธ์ฆ์ด ์์ ํ ๋นํ์ฑํ๋๋ฏ๋ก ๋ก์ปฌ ์ ์ฉ์ผ๋ก๋ง ์ฐ์ธ์.
๋์๋ณด๋๊ฐ ์๊ฒฉ์ด๊ณ NGINX Plus ๋ฉํธ๋ฆญ์ ์์งํ์ง ์๋๋ค๋ฉด --network host ๋ ๋นผ๋ ๋ฉ๋๋ค.
| ๋ณ์ | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |
|---|---|---|---|
DASHBOARD_URL | โ | โ | ๋์๋ณด๋ ์ฃผ์ (์: http://10.0.0.5:8080) |
INGEST_TOKEN | (๋น ๊ฐ) | ๋์๋ณด๋์ ๋์ผํด์ผ ํจ | |
LOG_PATH | /var/log/nginx/api_access.log | ํ์ฑ ๋ก๊ทธ ํ์ผ(์ปจํ ์ด๋ ๋ด๋ถ ๊ฒฝ๋ก) | |
LOG_ROTATE_DIR | /var/log/nginx/old | logrotate ๋ณด๊ด ๋๋ ํ ๋ฆฌ (๋น ๊ฐ์ด๋ฉด ๋ฏธ์์ง) | |
LOG_ROTATE_PATTERN | api_access.log-*.gz | rotated ํ์ผ glob (๋ ์ง 8์๋ฆฌ ํฌํจ ํ์) | |
CURSOR_FILE | /agent/state/agent_cursor.json | ์ฝ๊ธฐ ์์น ์ ์ฅ โ ์ฌ์์ ์ ์ค๋ณต ์ ์ก ๋ฐฉ์ง. ๋ณผ๋ฅจ ๊ฒฝ๋ก๋ก ์ง์ ํ์ธ์. | |
NGINX_PLUS_API | (๋น ๊ฐ) | NGINX Plus REST API URL (๋น ๊ฐ์ด๋ฉด ๋ฏธ์์ง) | |
POLL_INTERVAL | 30 | ํด๋ง ์ฃผ๊ธฐ(์ด) | |
BATCH_SIZE | 5000 | 1ํ ์ ์ก ์ต๋ ํ ์ | |
RETAIN_DAYS | 7 | ์ด ๊ธฐ๊ฐ๋ณด๋ค ์ค๋๋ rotated ๋ก๊ทธ๋ ๊ฑด๋๋ | |
SKIP_ERROR_RESPONSES | false | 4xx/5xx ์๋ต ์ ์ธ ์ฌ๋ถ | |
AGENT_ID | ํธ์คํธ๋ช | ๋์๋ณด๋์ ํ์๋ ์๋ณ์ |
/var/log/nginx(์ฝ๊ธฐ ์ ์ฉ), /agent/state(์ปค์ ์์ํ)log_format ๋ธ๋ก์ ๋์๋ณด๋ ์ด๋ฏธ์ง ํ์ด์งโ ์ ์์ต๋๋ค.curl -O https://raw.githubusercontent.com/VEEP09/api-discovery-for-nginx/main/docker-compose.agent.yml
DASHBOARD_URL=http://<๋์๋ณด๋-์๋ฒ>:8080 INGEST_TOKEN=<ํ ํฐ> \
docker compose -f docker-compose.agent.yml up -d
๋์๋ณด๋ ์๋ฒ๊ฐ ์๋๋ผ NGINX ์๋ฒ์์ ์คํํ์ธ์.
| ํ๊ทธ | ์ค๋ช |
|---|---|
latest | ์ต์ ์์ ๋ฒ์ (ํ์ฌ 1.2.1) |
1.2.1 | ์์ค ๋ณ๊ฒฝ ์์, ๋์๋ณด๋์ ํจ๊ป ๋ฐฐํฌ. ๋ฆด๋ฆฌ์ค ๋ ธํธโ |
1.2.0 | ๋ก๊ทธ ์ถ๋ ฅยท--help ์๋ฌธํ. ๋ฆด๋ฆฌ์ค ๋
ธํธโ |
1.1.0 | ๋ฒ ์ด์ค ์ด๋ฏธ์ง ๊ฐฑ์ , ์์ค ๋ณ๊ฒฝ ์์. ๋ฆด๋ฆฌ์ค ๋ ธํธโ |
1.0.0 | ์ต์ด ๋ฆด๋ฆฌ์ค |
ํ๋ก๋์
์์๋ latest ๋์ ๊ณ ์ ๋ฒ์ ํ๊ทธ๋ฅผ ์ฐ๊ณ , ๋์๋ณด๋์ ์์ด์ ํธ๋ฅผ ๊ฐ์ ํ๊ทธ๋ก ๋ง์ถ์ธ์. ์ ํฌ๊ธฐ๋ ์์ถ๋ ๋ค์ด๋ก๋ ๊ธฐ์ค์
๋๋ค.
NGINXยฎ is a registered trademark of F5, Inc. This project is an independent tool and is not affiliated with, endorsed by, or sponsored by F5 or NGINX. "NGINX" is used here only to describe compatibility.
Content type
Image
Digest
sha256:ddc40f3c7โฆ
Size
20.3 MB
Last updated
about 1 month ago
docker pull gusgh13900/api-discovery-agent