Skip to content

Commit

Permalink
Consume per request metrics reporting config
Browse files Browse the repository at this point in the history
This change addresses issue cloudfoundry#159.

It exposes the new gorouter config properties per_request_metrics_reporting,
send_http_start_stop_server_event and send_http_start_stop_client_event
in the gorouter job spec. This properties can be used to reduce the number
of metric events the gorouter sends per request.
  • Loading branch information
stefanlay committed Mar 3, 2021
1 parent e61f87c commit 1f8008c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions jobs/gorouter/spec
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,15 @@ properties:
This property is provided for backwards compatibility reasons. We recommend leaving it set to true.
When it set to true, the gorouter will return a 503 when a route is known but there is nothing in the pool available to handle the request. When false, the gorouter will return a 404.
default: true

router.per_request_metrics_reporting:
description: "Report metrics for each request"
default: true

router.send_http_start_stop_server_event:
description: "Send a httpstartstopevent of type server for each request"
default: true

router.send_http_start_stop_client_event:
description: "Send a httpstartstopevent of type client for each request"
default: true
4 changes: 4 additions & 0 deletions jobs/gorouter/templates/gorouter.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,7 @@ html_error_template_file: <%= t == "" ? "" : "/var/vcap/jobs/gorouter/config/err

#backwards compatibility only section
empty_pool_response_code_503: <%= p("for_backwards_compatibility_only.empty_pool_response_code_503") %>

per_request_metrics_reporting: <%= p("router.per_request_metrics_reporting") %>
send_http_start_stop_server_event: <%= p("router.send_http_start_stop_server_event") %>
send_http_start_stop_client_event: <%= p("router.send_http_start_stop_client_event") %>
5 changes: 4 additions & 1 deletion spec/gorouter_templates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@
'private_key' => ROUTE_SERVICES_CLIENT_TEST_KEY
},
'frontend_idle_timeout' => 5,
'ip_local_port_range' => '1024 65535'
'ip_local_port_range' => '1024 65535',
'per_request_metrics_reporting' => true,
'send_http_start_stop_server_event' => true,
'send_http_start_stop_client_event' => true
},
'request_timeout_in_seconds' => 100,
'routing_api' => {
Expand Down

0 comments on commit 1f8008c

Please sign in to comment.