Skip to content
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

Add image source to telemetry data #1600

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

ciarams87
Copy link
Member

Proposed changes

Problem: As a maintainer of NGF
I want to collect the image source from all NGF/NIC installations
So that I can understand the most popular methods for installing NGF/NIC

Solution: Export the BUILD_AGENT ARG in the container as an env var and use this value to determine if the image was:

  1. built using the pipeline (i.e. prebuilt by us and pulled by the customer)
  2. built locally using the make command or
  3. of unknown origin (env var is not set to either "gha" or "local"

Testing: Unit tests and checked the logs for the value:

{"level":"debug","ts":"2024-02-21T11:27:35Z","logger":"telemetryExporter","msg":"Exporting telemetry","data":{"ProjectMetadata":{"Name":"NGF","Version":"edge"},"ClusterID":"0046b6ee-d5aa-4d7a-b426-1f968272e149","NodeCount":1,"NGFResourceCounts":{"Gateways":1,"GatewayClasses":1,"HTTPRoutes":1,"Secrets":0,"Services":0,"Endpoints":0},"NGFReplicaCount":1,"ImageSource":"local"}}

Closes #1310

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

None

@ciarams87 ciarams87 requested a review from a team as a code owner February 21, 2024 12:07
@github-actions github-actions bot added the enhancement New feature or request label Feb 21, 2024
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ciarams87 ciarams87 merged commit 6a11016 into nginxinc:main Feb 21, 2024
34 checks passed
@ciarams87 ciarams87 deleted the enh/capture-image-source branch February 21, 2024 18:16
salonichf5 pushed a commit to salonichf5/nginx-gateway-fabric that referenced this pull request Feb 21, 2024
* Add image source

* Move env var to join the others
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Collect Image Source (NGF)
4 participants