Skip to content

Commit 67cc619

Browse files
committed
Enable Production Endpoint for Product Telemetry
Problem: Start sending product telemetry to the product F5 telemetry service. Solution: - Use the production telemetry endpoint in production NGF image, built using: - goreleaser - make commands from building the images doc - Introduce new targets in the Makefile for building prod images. Developer instructions for building NGF image remain unchanged, and such image will not send any telemetry, but will report it in the logs at the debug level. Testing: - Confirmed production NGF image built using make command sends telemetry. - Confirmed developer NGF image build using make command doesn't send any telemetry but reports it in the logs. CLOSES - nginx#1563
1 parent 92c2910 commit 67cc619

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
152152
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
153153
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
154-
TELEMETRY_ENDPOINT: "" # disables sending telemetry
154+
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317 # TO-DO: Update with the correct telemetry endpoint
155155
TELEMETRY_ENDPOINT_INSECURE: "false"
156156

157157
- name: Cache Artifacts

Makefile

+22-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ NGINX_CONF_DIR = internal/mode/static/nginx/conf
88
NJS_DIR = internal/mode/static/nginx/modules/src
99
NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key
1010
BUILD_AGENT=local
11-
TELEMETRY_REPORT_PERIOD = 24h # also configured in goreleaser.yml
1211

13-
# FIXME(pleshakov) - TELEMETRY_ENDPOINT will have the default value of F5 telemetry service once we're ready
14-
# to report. https://github.com/nginxinc/nginx-gateway-fabric/issues/1563
15-
# Also, we will need to set it in goreleaser.yml
16-
TELEMETRY_ENDPOINT =# if empty, NGF will report telemetry in its logs at debug level.
12+
# TO-DO: Update the PROD_TELEMETRY_ENDPOINT with the correct prod endpoint.
13+
PROD_TELEMETRY_ENDPOINT = otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317 # used in production NGF image.
14+
# the telemetry related variables below are also configured in goreleaser.yml
15+
TELEMETRY_REPORT_PERIOD = 24h
16+
TELEMETRY_ENDPOINT=# if empty, NGF will report telemetry in its logs at debug level.
17+
TELEMETRY_ENDPOINT_INSECURE = false
1718

18-
TELEMETRY_ENDPOINT_INSECURE = false # also configured in goreleaser.yml
1919
GW_API_VERSION = 1.0.0
2020
INSTALL_WEBHOOK = false
2121
NODE_VERSION = $(shell cat .nvmrc)
@@ -45,20 +45,36 @@ help: Makefile ## Display this help
4545
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n\n make \033[36m<target>\033[0m [VARIABLE=value...]\n\nTargets:\n\n"}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
4646
@grep -E '^(override )?[a-zA-Z_-]+ \??\+?= .*?## .*$$' $< | sort | awk 'BEGIN {FS = " \\??\\+?= .*?## "; printf "\nVariables:\n\n"}; {gsub(/override /, "", $$1); printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
4747

48+
.PHONY: build-prod-images
49+
build-prod-images: build-prod-ngf-image build-prod-nginx-image ## Build the NGF and nginx docker images for production
50+
51+
.PHONY: build-prod-images-with-plus
52+
build-prod-images-with-plus: build-prod-ngf-image build-prod-nginx-plus-image ## Build the NGF and NGINX Plus docker images for production
53+
4854
.PHONY: build-images
4955
build-images: build-ngf-image build-nginx-image ## Build the NGF and nginx docker images
5056

5157
.PHONY: build-images-with-plus
5258
build-images-with-plus: build-ngf-image build-nginx-plus-image ## Build the NGF and NGINX Plus docker images
5359

60+
.PHONY: build-prod-ngf-image
61+
build-prod-ngf-image: TELEMETRY_ENDPOINT=$(PROD_TELEMETRY_ENDPOINT)
62+
build-prod-ngf-image: build-ngf-image ## Build the NGF docker image for production
63+
5464
.PHONY: build-ngf-image
5565
build-ngf-image: check-for-docker build ## Build the NGF docker image
5666
docker build --platform linux/$(GOARCH) --build-arg BUILD_AGENT=$(BUILD_AGENT) --target $(strip $(TARGET)) -f build/Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) .
5767

68+
.PHONY: build-prod-nginx-image
69+
build-prod-nginx-image: build-nginx-image ## Build the custom nginx image for production
70+
5871
.PHONY: build-nginx-image
5972
build-nginx-image: check-for-docker ## Build the custom nginx image
6073
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) -f build/Dockerfile.nginx -t $(strip $(NGINX_PREFIX)):$(strip $(TAG)) .
6174

75+
.PHONY: build-prod-nginx-plus-image
76+
build-prod-nginx-plus-image: build-nginx-plus-image ## Build the custom nginx plus image for production
77+
6278
.PHONY: build-nginx-plus-image
6379
build-nginx-plus-image: check-for-docker ## Build the custom nginx plus image
6480
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) $(strip $(NGINX_DOCKER_BUILD_PLUS_ARGS)) -f build/Dockerfile.nginxplus -t $(strip $(NGINX_PLUS_PREFIX)):$(strip $(TAG)) .

site/content/installation/ngf-images/building-the-images.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,31 @@ If building the NGINX Plus image, you will also need a valid NGINX Plus license
3636
- To build both the NGINX Gateway Fabric and NGINX images:
3737

3838
```makefile
39-
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-images
39+
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-images
4040
```
4141

4242
- To build both the NGINX Gateway Fabric and NGINX Plus images:
4343

4444
```makefile
45-
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-images-with-plus
45+
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-images-with-plus
4646
```
4747

4848
- To build just the NGINX Gateway Fabric image:
4949

5050
```makefile
51-
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-ngf-image
51+
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-ngf-image
5252
```
5353

5454
- To build just the NGINX image:
5555

5656
```makefile
57-
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-nginx-image
57+
make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-nginx-image
5858
```
5959

6060
- To build just the NGINX Plus image:
6161

6262
```makefile
63-
make PREFIX=<my-docker-registry>/nginx-gateway-fabric/nginx-plus build-nginx-plus-image
63+
make PREFIX=myregistry.example.com/nginx-gateway-fabric/nginx-plus build-prod-nginx-plus-image
6464
```
6565

6666
Set the `PREFIX` variable to the name of the registry you'd like to push the image to. By default, the images will be

0 commit comments

Comments
 (0)