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 support to measure status_codes #317

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

wpjunior
Copy link

@wpjunior wpjunior commented Mar 4, 2025

@wpjunior wpjunior marked this pull request as ready for review March 4, 2025 19:49
@u5surf
Copy link
Collaborator

u5surf commented Mar 4, 2025

@wpjunior Thanks contribute. Unfortunately, the status dash board(html page) seems to corrupt the series of N/A appered suddenly in server zone.
IMG_4195

Note that the page is used by many users now a day, they will suprise what happened when the feature turn on.
We should be handling or treating something for all I/F thus html, json, prometheus to keep backward compatibility, even if you don't need that for your usecase.

@wpjunior
Copy link
Author

wpjunior commented Mar 5, 2025

Hi @u5surf, I extracted the status codes into a separate JSON structure, so the status page is still working as before.

I believe I have finished the merge request.

@u5surf u5surf self-requested a review March 6, 2025 14:35
Copy link
Collaborator

@u5surf u5surf left a comment

Choose a reason for hiding this comment

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

@wpjunior
Hi, Could you handling following control command?

https://github.com/vozlt/nginx-module-vts?tab=readme-ov-file#to-reset-traffic-zones-on-the-fly

The status 1xx - 5xx can be reset by this command on the fly.
We should make a consistent with this behavior.

@wpjunior
Copy link
Author

wpjunior commented Mar 7, 2025

Hi @u5surf I implemented this feature :-)

@u5surf
Copy link
Collaborator

u5surf commented Mar 8, 2025

@wpjunior
Is there any conflict with this feature?
Of course, you can claim the your feature doesn't have to count unnecessary status code, but also we can consider that is not to introduce the redundant complexity of the code any more.

https://github.com/vozlt/nginx-module-vts?tab=readme-ov-file#to-calculate-traffic-for-detailed-http-status-code

BTW, I have an another suggestion for you about this pull request.
Can I contact with you via LinkedIn later?

@wpjunior
Copy link
Author

wpjunior commented Mar 8, 2025

Hi @u5surf,

Creating filters is a powerful tool. However, the current implementation seems to generate Prometheus metrics with two somewhat confusing dimensions: filter and filter_name. Making the status code a first-class attribute would simplify the metrics, making them easier for entry-level users to adopt.

Yeah, let's talk on LinkedIn!

@u5surf u5surf self-requested a review March 9, 2025 01:58
vtsn->stat_out_bytes);

if (ctx->measure_status_codes != NULL && vtsn->stat_status_code_counter != NULL) {
ngx_uint_t *status_code = NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@u5surf
Copy link
Collaborator

u5surf commented Mar 10, 2025

@wpjunior In addition some nit picks. At last I would be merge this if you will have finished some fixes. Thanks for a while!

@SuperQ Could you review this PR? Because this is a significant change for this module. For we have to make a decision to merge this, I'd like hear more collaboraters agree with the feature or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants