Skip to content

Add support to measure status_codes #317

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

Merged
merged 18 commits into from
May 23, 2025

Conversation

wpjunior
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor 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
@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.

@u5surf
Copy link
Collaborator

u5surf commented May 21, 2025

@wpjunior Sorry for long time no response! I’ve decided to merge your PR because other reviewers had no response, I’ve no claimed you the change request anymore. Finally, could you fix a several chore conflict?
Thanks a lot and I hope to consider continuously the shape of the future about this module together.

@wpjunior wpjunior force-pushed the feat/measure-status-codes branch from 2a4b75a to f6ac339 Compare May 23, 2025 20:00
@wpjunior
Copy link
Contributor Author

Hi @u5surf, I am happy to made this git rebase,

done my friend

@u5surf u5surf merged commit c382342 into vozlt:master May 23, 2025
1 check passed
@u5surf
Copy link
Collaborator

u5surf commented May 23, 2025

@wpjunior Thanks! It’s all done!

@mur-me
Copy link

mur-me commented May 26, 2025

Huge thanks for this update @wpjunior

Already tried, works like a charm for the Prometheus metrics format 🙏

@wpjunior wpjunior deleted the feat/measure-status-codes branch May 26, 2025 21:32
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.

3 participants