gateway icon indicating copy to clipboard operation
gateway copied to clipboard

feat: route stat name

Open Inode1 opened this issue 5 months ago • 5 comments

What type of PR is this?

What this PR does / why we need it:

Add support for determining route stat names in BackendTrafficPolicy

Supported: xRoute Supported Formatters: %ROUTE_KIND%, %ROUTE_NAME%, %ROUTE_NAMESPACE%, %ROUTE_RULE_NAME%, %ROUTE_RULE_NUMBER%

Which issue(s) this PR fixes:

Fixes https://github.com/envoyproxy/gateway/issues/6190

Release Notes: Yes

Inode1 avatar Jun 13 '25 22:06 Inode1

Codecov Report

:x: Patch coverage is 88.88889% with 7 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 71.15%. Comparing base (a9fa022) to head (1e6d51f). :warning: Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/backendtrafficpolicy.go 83.33% 3 Missing and 2 partials :warning:
api/v1alpha1/validation/envoyproxy_validate.go 90.90% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6310      +/-   ##
==========================================
- Coverage   72.31%   71.15%   -1.16%     
==========================================
  Files         231      274      +43     
  Lines       34084    34857     +773     
==========================================
+ Hits        24647    24802     +155     
- Misses       7664     8260     +596     
- Partials     1773     1795      +22     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 14 '25 20:06 codecov[bot]

/retest

Inode1 avatar Jun 14 '25 21:06 Inode1

seeing the API being added to BTP, is the use case to enable this only on some routes or all ? If all is the most common use case, , then lets start with a field in EnvoyProxy and later one in BTP

arkodg avatar Jun 16 '25 18:06 arkodg

seeing the API being added to BTP, is the use case to enable this only on some routes or all ? If all is the most common use case, , then lets start with a field in EnvoyProxy and later one in BTP

Hi, I thought we agreed to add stats only in BTP), i.e., only for a specific route using the template. I don't quite understand how the settings of EnvoyProxy and BTP will work together. It seems that in the discussion it was decided that this should be opt-in, as enabling it for all routes through EnvoyProxy could lead to a large number of metrics, which might affect the performance of Envoy (and it's unclear how to disable the option at the EnvoyProxy level for a specific route). Additionally, with BTP, you can specify more specific things, such as the name of the route (routeStatPrefix: name=/route), as well as more concrete business-related aspects, like tenant, for example.

Inode1 avatar Jun 17 '25 07:06 Inode1

okay, lets start with BTP first

arkodg avatar Jun 17 '25 18:06 arkodg

/retest

Inode1 avatar Jun 30 '25 18:06 Inode1

@arkodg PTAL

Inode1 avatar Jun 30 '25 18:06 Inode1

/retest

Inode1 avatar Aug 09 '25 17:08 Inode1

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

github-actions[bot] avatar Sep 08 '25 20:09 github-actions[bot]

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

github-actions[bot] avatar Oct 25 '25 00:10 github-actions[bot]

Hey @Inode1 are you still working on this?

jukie avatar Oct 27 '25 16:10 jukie

Hey @Inode1 are you still working on this?

As far as I understand, @arkodg doesn’t agree to pass the fields into the metadata and suggests making this configuration at the EnvoyProxy level.

Inode1 avatar Oct 27 '25 17:10 Inode1

hey @Inode1 do you have a use case for using %ROUTE_RULE_NUMBER% instead of %ROUTE_SECTION_NAME% which is already available in the IR today ? my preference would be to avoid adding RuleIndex to the IR unless we absolutely need it

arkodg avatar Oct 29 '25 00:10 arkodg

hey @Inode1 do you have a use case for using %ROUTE_RULE_NUMBER% instead of %ROUTE_SECTION_NAME% which is already available in the IR today ? my preference would be to avoid adding RuleIndex to the IR unless we absolutely need it

No, to be honest, I don't need formatters tags at all, just a custom stats name string).

Done, delete ROUTE_RULE_NUMBER

Inode1 avatar Nov 03 '25 05:11 Inode1

thanks @Inode1, will take a look at this PR next week, after v1.6 is out

arkodg avatar Nov 03 '25 20:11 arkodg

@Inode1 can you fix the DCO?

zirain avatar Nov 18 '25 00:11 zirain