Skip to content

Commit 5620626

Browse files
pleshakovamimimor
authored andcommitted
Enable Production Endpoint for Product Telemetry (nginx#1699)
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 68fa10c commit 5620626

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
157157
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
158158
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
159-
TELEMETRY_ENDPOINT: "" # disables sending telemetry
159+
TELEMETRY_ENDPOINT: oss.edge.df.f5.com:443
160160
TELEMETRY_ENDPOINT_INSECURE: "false"
161161

162162
- name: Cache Artifacts

Makefile

+21-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ 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+
PROD_TELEMETRY_ENDPOINT = oss.edge.df.f5.com:443
13+
# the telemetry related variables below are also configured in goreleaser.yml
14+
TELEMETRY_REPORT_PERIOD = 24h
15+
TELEMETRY_ENDPOINT=# if empty, NGF will report telemetry in its logs at debug level.
16+
TELEMETRY_ENDPOINT_INSECURE = false
1717

18-
TELEMETRY_ENDPOINT_INSECURE = false # also configured in goreleaser.yml
1918
GW_API_VERSION = 1.0.0
2019
INSTALL_WEBHOOK = false
2120
NODE_VERSION = $(shell cat .nvmrc)
@@ -45,20 +44,36 @@ help: Makefile ## Display this help
4544
@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}'
4645
@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}'
4746

47+
.PHONY: build-prod-images
48+
build-prod-images: build-prod-ngf-image build-prod-nginx-image ## Build the NGF and nginx docker images for production
49+
50+
.PHONY: build-prod-images-with-plus
51+
build-prod-images-with-plus: build-prod-ngf-image build-prod-nginx-plus-image ## Build the NGF and NGINX Plus docker images for production
52+
4853
.PHONY: build-images
4954
build-images: build-ngf-image build-nginx-image ## Build the NGF and nginx docker images
5055

5156
.PHONY: build-images-with-plus
5257
build-images-with-plus: build-ngf-image build-nginx-plus-image ## Build the NGF and NGINX Plus docker images
5358

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

67+
.PHONY: build-prod-nginx-image
68+
build-prod-nginx-image: build-nginx-image ## Build the custom nginx image for production
69+
5870
.PHONY: build-nginx-image
5971
build-nginx-image: check-for-docker ## Build the custom nginx image
6072
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) -f build/Dockerfile.nginx -t $(strip $(NGINX_PREFIX)):$(strip $(TAG)) .
6173

74+
.PHONY: build-prod-nginx-plus-image
75+
build-prod-nginx-plus-image: build-nginx-plus-image ## Build the custom nginx plus image for production
76+
6277
.PHONY: build-nginx-plus-image
6378
build-nginx-plus-image: check-for-docker ## Build the custom nginx plus image
6479
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)