Merge pull request #2356 from nicknovitski/vts-sum-key

Add vts-sum-key config flag
This commit is contained in:
k8s-ci-robot 2018-04-17 13:35:00 -07:00 committed by GitHub
commit c37ed7ecb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 1 deletions

View file

@ -46,6 +46,7 @@ The following table shows a configuration option's name, type, and the default v
|[ignore-invalid-headers](#ignore-invalid-headers)|bool|true| |[ignore-invalid-headers](#ignore-invalid-headers)|bool|true|
|[enable-vts-status](#enable-vts-status)|bool|false| |[enable-vts-status](#enable-vts-status)|bool|false|
|[vts-status-zone-size](#vts-status-zone-size)|string|"10m"| |[vts-status-zone-size](#vts-status-zone-size)|string|"10m"|
|[vts-sum-key](#vts-sum-key)|string|"*"|
|[vts-default-filter-key](#vts-default-filter-key)|string|"$geoip_country_code country::*"| |[vts-default-filter-key](#vts-default-filter-key)|string|"$geoip_country_code country::*"|
|[retry-non-idempotent](#retry-non-idempotent)|bool|"false"| |[retry-non-idempotent](#retry-non-idempotent)|bool|"false"|
|[error-log-level](#error-log-level)|string|"notice"| |[error-log-level](#error-log-level)|string|"notice"|
@ -254,6 +255,13 @@ Vts config on http level enables the keys by user defined variable. The key is a
_References:_ _References:_
- https://github.com/vozlt/nginx-module-vts#vhost_traffic_status_filter_by_set_key - https://github.com/vozlt/nginx-module-vts#vhost_traffic_status_filter_by_set_key
## vts-sum-key
For metrics keyed (or when using Prometheus, labeled) by server zone, this value is used to indicate metrics for all server zones combined. Default value is *
_References:_
- https://github.com/vozlt/nginx-module-vts#vhost_traffic_status_display_sum_key
## retry-non-idempotent ## retry-non-idempotent
Since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) in case of an error in the upstream server. The previous behavior can be restored using the value "true". Since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) in case of an error in the upstream server. The previous behavior can be restored using the value "true".

File diff suppressed because one or more lines are too long

View file

@ -180,6 +180,11 @@ type Configuration struct {
// Default value is $geoip_country_code country::* // Default value is $geoip_country_code country::*
VtsDefaultFilterKey string `json:"vts-default-filter-key,omitempty"` VtsDefaultFilterKey string `json:"vts-default-filter-key,omitempty"`
// Description: Sets sum key used by vts json output, and the sum label in prometheus output.
// These indicate metrics values for all server zones combined, rather than for a specific one.
// Default value is *
VtsSumKey string `json:"vts-sum-key,omitempty"`
// RetryNonIdempotent since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) // RetryNonIdempotent since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH)
// in case of an error. The previous behavior can be restored using the value true // in case of an error. The previous behavior can be restored using the value true
RetryNonIdempotent bool `json:"retry-non-idempotent"` RetryNonIdempotent bool `json:"retry-non-idempotent"`
@ -582,6 +587,7 @@ func NewDefault() Configuration {
LoadBalanceAlgorithm: defaultLoadBalancerAlgorithm, LoadBalanceAlgorithm: defaultLoadBalancerAlgorithm,
VtsStatusZoneSize: "10m", VtsStatusZoneSize: "10m",
VtsDefaultFilterKey: "$geoip_country_code country::*", VtsDefaultFilterKey: "$geoip_country_code country::*",
VtsSumKey: "*",
VariablesHashBucketSize: 128, VariablesHashBucketSize: 128,
VariablesHashMaxSize: 2048, VariablesHashMaxSize: 2048,
UseHTTP2: true, UseHTTP2: true,

View file

@ -532,6 +532,7 @@ http {
{{ if $cfg.EnableVtsStatus }} {{ if $cfg.EnableVtsStatus }}
vhost_traffic_status_display; vhost_traffic_status_display;
vhost_traffic_status_display_format html; vhost_traffic_status_display_format html;
vhost_traffic_status_display_sum_key {{ $cfg.VtsSumKey }};
{{ else }} {{ else }}
access_log off; access_log off;
stub_status on; stub_status on;