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

Integrate telemetry exporter #1656

Merged
merged 6 commits into from
Mar 7, 2024
Merged

Conversation

pleshakov
Copy link
Contributor

Proposed changes

Problem:
Integrate the exporter library
https://github.com/nginxinc/telemetry-exporter so that it is possible to send product telemetry data to an endpoint.

Solution:

  • Integrate the exporter library.
  • Update existing telemetry data struct to use the common data struct defined in the exporter library.
  • Refactor existing telemetry data structs to adhere to the exporter library requirements.
  • Generate scheme and Attributes for data structs.
  • Allow configuring telemetry endpoint params via build flags. If the telemetry endpoint is not specified, NGF will log data points to the debug log (existing behavior).
  • Add root CA certs to NGF image so that NGF can verify the cert of the telemetry service.

Testing:

  • Unit tests
  • Manual testing of build flags validation.
  • Manual testing that NGF sends data to an OTel collector.
  • Manual testing that NGF sends data to a dev F5 telemetry service.

CLOSES -- #1377

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

Problem:
Integrate the exporter library
https://github.com/nginxinc/telemetry-exporter so that it is possible
to send product telemetry data to an endpoint.

Solution:
- Integrate the exporter library.
- Update existing telemetry data struct to use the common data struct
  defined in the exporter library.
- Refactor existing telemetry data structs to adhere to the exporter
  library requirements.
- Generate scheme and Attributes for data structs.
- Allow configuring telemetry endpoint params via build flags. If the
  telemetry endpoint is not specified, NGF will log data points to the
  debug log (existing behavior).
- Add root CA certs to NGF image so that NGF can verify the cert of
  the telemetry service.

Testing:
- Unit tests
- Manual testing of build flags validation.
- Manual testing that NGF sends data to an OTel collector.
- Manual testing that NGF sends data to a dev F5 telemetry service.

CLOSES -- #1377
@pleshakov pleshakov requested review from a team as code owners March 7, 2024 17:30
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file labels Mar 7, 2024
@pleshakov
Copy link
Contributor Author

I realized I'm using the branch instead of a fork. This is by mistake. However, I'd keep this PR, so no more PRs created.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 57.73196% with 41 lines in your changes are missing coverage. Please review.

Project coverage is 85.83%. Comparing base (2c8f750) to head (da0b5d2).

Files Patch % Lines
internal/mode/static/manager.go 0.00% 30 Missing ⚠️
cmd/gateway/commands.go 0.00% 10 Missing ⚠️
internal/mode/static/telemetry/job_worker.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1656      +/-   ##
==========================================
- Coverage   86.27%   85.83%   -0.44%     
==========================================
  Files          84       86       +2     
  Lines        5390     5459      +69     
  Branches       52       52              
==========================================
+ Hits         4650     4686      +36     
- Misses        689      722      +33     
  Partials       51       51              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Makefile Show resolved Hide resolved
internal/mode/static/telemetry/collector.go Outdated Show resolved Hide resolved
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.

🚀 🚀

@pleshakov pleshakov merged commit 799ea76 into main Mar 7, 2024
35 of 36 checks passed
@pleshakov pleshakov deleted the feature/integrate-telemetry-library branch March 7, 2024 20:14
amimimor pushed a commit to amimimor/nginx-gateway-fabric that referenced this pull request Apr 3, 2024
Problem:
Integrate the exporter library
https://github.com/nginxinc/telemetry-exporter so that it is possible
to send product telemetry data to an endpoint.

Solution:
- Integrate the exporter library.
- Update existing telemetry data struct to use the common data struct
  defined in the exporter library.
- Refactor existing telemetry data structs to adhere to the exporter
  library requirements.
- Generate scheme and Attributes for data structs.
- Allow configuring telemetry endpoint params via build flags. If the
  telemetry endpoint is not specified, NGF will log data points to the
  debug log (existing behavior).
- Add root CA certs to NGF image so that NGF can verify the cert of
  the telemetry service.

Testing:
- Unit tests
- Manual testing of build flags validation.
- Manual testing that NGF sends data to an OTel collector.
- Manual testing that NGF sends data to a dev F5 telemetry service.

CLOSES -- nginxinc#1377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants