Skip to content

Commit 63c3abb

Browse files
authored
Create make collector target without NAP (#1055)
1 parent 99e7598 commit 63c3abb

File tree

4 files changed

+107
-12
lines changed

4 files changed

+107
-12
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,22 @@ build-mock-management-otel-collector-image: build-mock-management-otel-collector
231231
.PHONY: run-mock-management-otel-collector
232232
run-mock-management-otel-collector: ## Run mock management plane OTel collector
233233
@echo "🚀 Running mock management plane OTel collector"
234-
AGENT_IMAGE_WITH_NGINX_PLUS=nginx_plus_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_OSS=nginx_oss_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_PLUS_AND_NAP=nginx_plus_and_nap_$(IMAGE_TAG):latest $(CONTAINER_COMPOSE) -f ./test/mock/collector/docker-compose.yaml up -d
234+
AGENT_IMAGE_WITH_NGINX_PLUS=nginx_plus_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_OSS=nginx_oss_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_PLUS_AND_NAP=nginx_plus_and_nap_$(IMAGE_TAG):latest $(CONTAINER_COMPOSE) -f ./test/mock/collector/nginx-plus-and-nap/docker-compose.yaml up -d
235235

236236
.PHONY: stop-mock-management-otel-collector
237237
stop-mock-management-otel-collector: ## Stop running mock management plane OTel collector
238238
@echo "Stopping mock management plane OTel collector"
239-
AGENT_IMAGE_WITH_NGINX_PLUS=nginx_plus_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_OSS=nginx_oss_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_PLUS_AND_NAP=nginx_plus_and_nap_$(IMAGE_TAG):latest $(CONTAINER_COMPOSE) -f ./test/mock/collector/docker-compose.yaml down
239+
AGENT_IMAGE_WITH_NGINX_PLUS=nginx_plus_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_OSS=nginx_oss_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_PLUS_AND_NAP=nginx_plus_and_nap_$(IMAGE_TAG):latest $(CONTAINER_COMPOSE) -f ./test/mock/collector/nginx-plus-and-nap/docker-compose.yaml down
240+
241+
.PHONY: run-mock-otel-collector-without-nap
242+
run-mock-otel-collector-without-nap:
243+
@echo "🚀 Running mock management plane OTel collector without NAP"
244+
AGENT_IMAGE_WITH_NGINX_PLUS=nginx_plus_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_OSS=nginx_oss_$(IMAGE_TAG):latest $(CONTAINER_COMPOSE) -f ./test/mock/collector/docker-compose.yaml up -d
245+
246+
.PHONY: stop-mock-otel-collector-without-nap
247+
stop-mock-otel-collector-without-nap: ## Stop running mock management plane OTel collector
248+
@echo "Stopping mock management plane OTel collector without NAP"
249+
AGENT_IMAGE_WITH_NGINX_PLUS=nginx_plus_$(IMAGE_TAG):latest AGENT_IMAGE_WITH_NGINX_OSS=nginx_oss_$(IMAGE_TAG):latest $(CONTAINER_COMPOSE) -f ./test/mock/collector/docker-compose.yaml down
240250

241251
generate: ## Generate golang code
242252
@echo "🗄️ Generating proto files"

test/mock/collector/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ make local-deb-package build-test-oss-image build-test-plus-image build-mock-man
1414

1515
[**Note:** We need to build the test NGINX Plus with NAP image with the environment variable `OSARCH=amd64` since NGINX App Protect doesn't support ARM yet.]
1616

17+
To build all images except the NGINX Plus & NGINX App Protect run the following
18+
```
19+
make local-deb-package build-test-oss-image build-test-plus-image build-mock-management-otel-collector-image
20+
```
21+
1722
To start run everything run the following
1823
```
1924
make run-mock-management-otel-collector

test/mock/collector/docker-compose.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ volumes:
77
grafana-storage:
88

99
services:
10-
agent-with-nginx-plus-and-nap:
11-
image: ${AGENT_IMAGE_WITH_NGINX_PLUS_AND_NAP}
12-
container_name: mock-collector-agent-with-nginx-plus-and-nap
13-
volumes:
14-
- ./nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf
15-
- ./nginx-plus-and-nap/nginx.conf:/etc/nginx/nginx.conf
16-
- ./nginx-plus-and-nap/conf.d/default.conf:/etc/nginx/conf.d/default.conf
17-
networks:
18-
- metrics
19-
2010
agent-with-nginx-plus:
2111
image: ${AGENT_IMAGE_WITH_NGINX_PLUS}
2212
container_name: mock-collector-agent-with-nginx-plus
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
2+
networks:
3+
metrics:
4+
driver: bridge
5+
6+
volumes:
7+
grafana-storage:
8+
9+
services:
10+
agent-with-nginx-plus-and-nap:
11+
image: ${AGENT_IMAGE_WITH_NGINX_PLUS_AND_NAP}
12+
container_name: mock-collector-agent-with-nginx-plus-and-nap
13+
volumes:
14+
- ../nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf
15+
- ../nginx-plus-and-nap/nginx.conf:/etc/nginx/nginx.conf
16+
- ../nginx-plus-and-nap/conf.d/default.conf:/etc/nginx/conf.d/default.conf
17+
networks:
18+
- metrics
19+
20+
agent-with-nginx-plus:
21+
image: ${AGENT_IMAGE_WITH_NGINX_PLUS}
22+
container_name: mock-collector-agent-with-nginx-plus
23+
volumes:
24+
- ../nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf
25+
- ../nginx-plus/nginx.conf:/etc/nginx/nginx.conf
26+
- ../nginx-plus/conf.d/default.conf:/etc/nginx/conf.d/default.conf
27+
networks:
28+
- metrics
29+
30+
agent-with-nginx-oss:
31+
image: ${AGENT_IMAGE_WITH_NGINX_OSS}
32+
container_name: mock-collector-agent-with-nginx-oss
33+
volumes:
34+
- ../nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf
35+
- ../nginx-oss:/etc/nginx/
36+
networks:
37+
- metrics
38+
39+
otel-collector:
40+
image: mock-collector
41+
container_name: mock-collector-otel-collector
42+
ports:
43+
- 4320:4317
44+
- 9775:9090
45+
volumes:
46+
- ../otel-collector.yaml:/etc/otel-collector.yaml
47+
networks:
48+
- metrics
49+
50+
prometheus:
51+
image: prom/prometheus:latest
52+
container_name: mock-collector-prometheus
53+
restart: unless-stopped
54+
ports:
55+
- "9090:9090"
56+
volumes:
57+
- ../prometheus.yaml:/etc/prometheus/prometheus.yml
58+
command:
59+
- '--config.file=/etc/prometheus/prometheus.yml'
60+
networks:
61+
- metrics
62+
63+
grafana:
64+
image: grafana/grafana:latest
65+
container_name: mock-collector-grafana
66+
restart: unless-stopped
67+
environment:
68+
GF_INSTALL_PLUGINS: "grafana-lokiexplore-app"
69+
ports:
70+
- "3002:3000"
71+
volumes:
72+
- grafana-storage:/var/lib/grafana
73+
- ../grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
74+
- ../grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
75+
- ../grafana/provisioning/plugins:/etc/grafana/provisioning/plugins
76+
- ../grafana/provisioning/dashboards:/var/lib/grafana/dashboards
77+
networks:
78+
- metrics
79+
80+
loki:
81+
image: grafana/loki:latest
82+
container_name: mock-collector-loki
83+
restart: unless-stopped
84+
ports:
85+
- "3100:3100"
86+
volumes:
87+
- ../loki-config.yaml:/etc/loki/local-config.yaml
88+
command: -config.file=/etc/loki/local-config.yaml
89+
networks:
90+
- metrics

0 commit comments

Comments
 (0)