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

Register php-fpm metrics as extension plugin #451

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

achawla2012
Copy link
Contributor

Proposed changes

Register php-fpm metrics as extension plugin.

Test

Agent logs with extension functionality.

time="2023-08-24T00:29:09Z" level=info msg="The following extension plugins have being registered: [\"php-fpm-metrics\"]"
...
time="2023-08-24T00:29:09Z" level=info msg="php-fpm-metrics initializing"

time="2023-08-24T00:29:09Z" level=info msg="Commander received agent_connect_response:<agent_config:<details:<features:\"registration\" ... extensions:\"php-fpm-metrics\" server:<backoff:<initial_interval:100 randomization_factor:0.1 multiplier:1.5 max_interval:60000 > > > configs:<configs:<system_id:\"8908ba0d-157b-313e-8598-92f96acc3de3\" nginx_id:\"b636d4376dea15405589692d3c5d3869ff3a9b26b0e7bb4bb1aa7e658ace1437\" > > > status:<statusCode:CONNECT_OK > > , <nil>"

Agent logs with extension functionality not enabled.

time="2023-08-24T16:40:48Z" level=info msg="The following extension plugins have being registered: []"
time="2023-08-24T16:40:48Z" level=info msg="Commander initializing"

time="2023-08-24T16:40:49Z" level=warning msg="Ignoring unknown extension php-fpm-metrics that was configured"

time="2023-08-24T16:40:50Z" level=debug msg="Command msg from data plane: agent_connect_response:<agent_config:<details:<features:\"registration\" features:\"nginx-config-async\" features:\"nginx-ssl-config\" features:\"nginx-counting\" features:\"metrics\" features:\"metrics-throttle\" features:\"dataplane-status\" features:\"process-watcher\" features:\"file-watcher\" features:\"activity-events\" features:\"agent-api\" server:<backoff:<initial_interval:100 randomization_factor:0.1 multiplier:1.5 max_interval:60000 > > > configs:<configs:<system_id:\"8908ba0d-157b-313e-8598-92f96acc3de3\" nginx_id:\"b636d4376dea15405589692d3c5d3869ff3a9b26b0e7bb4bb1aa7e658ace1437\" > > > status:<statusCode:CONNECT_OK > > "

Checklist

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

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@github-actions github-actions bot added chore Pull requests for routine tasks dependencies labels Aug 24, 2023
@netlify
Copy link

netlify bot commented Aug 24, 2023

Deploy Preview for agent-public-docs ready!

Name Link
🔨 Latest commit 6e5d099
🔍 Latest deploy log https://app.netlify.com/sites/agent-public-docs/deploys/64ee71b06e0e190008c61006
😎 Deploy Preview https://deploy-preview-451--agent-public-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sdk/agent/config/config_helpers.go Show resolved Hide resolved
src/extensions/php_fpm_metrics.go Show resolved Hide resolved
src/extensions/php_fpm_metrics_test.go Outdated Show resolved Hide resolved
src/extensions/php_fpm_metrics_test.go Outdated Show resolved Hide resolved
src/extensions/php_fpm_metrics.go Show resolved Hide resolved
src/extensions/php_fpm_metrics.go Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 31.81% and project coverage change: -0.40% ⚠️

Comparison is base (7c1ada3) 67.19% compared to head (6e5d099) 66.79%.
Report is 4 commits behind head on main.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #451      +/-   ##
==========================================
- Coverage   67.19%   66.79%   -0.40%     
==========================================
  Files         113      114       +1     
  Lines       12849    12951     +102     
==========================================
+ Hits         8634     8651      +17     
- Misses       3647     3729      +82     
- Partials      568      571       +3     
Files Changed Coverage Δ
.../nginx/agent/sdk/v2/agent/config/config_helpers.go 26.82% <0.00%> (-2.44%) ⬇️
...m/nginx/agent/v2/src/extensions/php_fpm_metrics.go 33.33% <33.33%> (ø)
...or/github.com/nginx/agent/sdk/v2/config_helpers.go 64.19% <50.00%> (+0.18%) ⬆️

... and 6 files with indirect coverage changes

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

Copy link
Collaborator

@dhurley dhurley left a comment

Choose a reason for hiding this comment

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

Looks good. Just one thing to note. Could you also update the extensions plugin https://github.com/nginx/agent/blob/main/src/plugins/extensions.go as well to support enabling this extension via an agent config update from the grpc AgentConfig message? You can do it in this PR or open a separate PR afterwards if you want.

@achawla2012
Copy link
Contributor Author

Looks good. Just one thing to note. Could you also update the extensions plugin https://github.com/nginx/agent/blob/main/src/plugins/extensions.go as well to support enabling this extension via an agent config update from the grpc AgentConfig message? You can do it in this PR or open a separate PR afterwards if you want.

Thanks. I will take care of it in separate PR.

@dhurley dhurley merged commit 39e6e49 into nginx:main Sep 7, 2023
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants