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

Vendor update weaveworks/common #4922

Merged
merged 8 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* [ENHANCEMENT] Go: update to 1.20.4. #4092
* [ENHANCEMENT] Ruler: added experimental ruler storage cache support. The cache should reduce the number of "list objects" API calls issued to the object storage when there are 2+ ruler replicas running in a Mimir cluster. The cache can be configured setting `-ruler-storage.cache.*` CLI flags or their respective YAML config options. #4950
* [ENHANCEMENT] Store-gateway: added HTTP `/store-gateway/prepare-shutdown` endpoint for gracefully scaling down of store-gateways. A gauge `cortex_store_gateway_prepare_shutdown_requested` has been introduced for tracing this process. #4955
* [ENHANCEMENT] Updated Kuberesolver dependency (github.com/sercand/kuberesolver) from v2.4.0 to v4.0.0 and gRPC dependency (google.golang.org/grpc) from v1.47.0 to v1.53.0. #4922
* [ENHANCEMENT] Introduced new options for logging HTTP request headers: `-server.log-request-headers` enables logging HTTP request headers, `-server.log-request-headers-exclude-list` lists headers which should not be logged. #4922
* [BUGFIX] Metadata API: Mimir will now return an empty object when no metadata is available, matching Prometheus. #4782
* [BUGFIX] Store-gateway: add collision detection on expanded postings and individual postings cache keys. #4770
* [BUGFIX] Ruler: Support the `type=alert|record` query parameter for the API endpoint `<prometheus-http-prefix>/api/v1/rules`. #4302
Expand Down
22 changes: 21 additions & 1 deletion cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,17 +536,37 @@
"fieldType": "string",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "log_request_headers",
"required": false,
"desc": "Optionally log request headers.",
"fieldValue": null,
"fieldDefaultValue": false,
"fieldFlag": "server.log-request-headers",
"fieldType": "boolean"
},
{
"kind": "field",
"name": "log_request_at_info_level_enabled",
"required": false,
"desc": "Optionally log requests at info level instead of debug level.",
"desc": "Optionally log requests at info level instead of debug level. Applies to request headers as well if server.log-request-headers is enabled.",
"fieldValue": null,
"fieldDefaultValue": false,
"fieldFlag": "server.log-request-at-info-level-enabled",
"fieldType": "boolean",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "log_request_exclude_headers_list",
"required": false,
"desc": "Comma separated list of headers to exclude from loggin. Only used if server.log-request-headers is true.",
"fieldValue": null,
"fieldDefaultValue": "",
"fieldFlag": "server.log-request-headers-exclude-list",
"fieldType": "string"
},
{
"kind": "field",
"name": "http_path_prefix",
Expand Down
6 changes: 5 additions & 1 deletion cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,11 @@ Usage of ./cmd/mimir/mimir:
-server.http-write-timeout duration
Write timeout for HTTP server (default 2m0s)
-server.log-request-at-info-level-enabled
Optionally log requests at info level instead of debug level.
Optionally log requests at info level instead of debug level. Applies to request headers as well if server.log-request-headers is enabled.
-server.log-request-headers
Optionally log request headers.
-server.log-request-headers-exclude-list string
Comma separated list of headers to exclude from loggin. Only used if server.log-request-headers is true.
-server.log-source-ips-enabled
Optionally log the source IPs.
-server.log-source-ips-header string
Expand Down
4 changes: 4 additions & 0 deletions cmd/mimir/help.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,10 @@ Usage of ./cmd/mimir/mimir:
HTTP server listen address.
-server.http-listen-port int
HTTP server listen port. (default 8080)
-server.log-request-headers
Optionally log request headers.
-server.log-request-headers-exclude-list string
Comma separated list of headers to exclude from loggin. Only used if server.log-request-headers is true.
-server.tls-cipher-suites string
Comma-separated list of cipher suites to use. If blank, the default Go cipher suites is used.
-server.tls-min-version string
Expand Down
10 changes: 10 additions & 0 deletions docs/sources/mimir/references/configuration-parameters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,20 @@ grpc_tls_config:
# CLI flag: -server.log-source-ips-regex
[log_source_ips_regex: <string> | default = ""]

# Optionally log request headers.
# CLI flag: -server.log-request-headers
[log_request_headers: <boolean> | default = false]

# (advanced) Optionally log requests at info level instead of debug level.
# Applies to request headers as well if server.log-request-headers is enabled.
# CLI flag: -server.log-request-at-info-level-enabled
[log_request_at_info_level_enabled: <boolean> | default = false]

# Comma separated list of headers to exclude from loggin. Only used if
# server.log-request-headers is true.
# CLI flag: -server.log-request-headers-exclude-list
[log_request_exclude_headers_list: <string> | default = ""]
Copy link
Contributor

Choose a reason for hiding this comment

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

could go in changelog; some users will like the ability to restrict more headers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm adding a PR in weaveworks common to add the flag description as well.

Copy link
Member

Choose a reason for hiding this comment

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

Added to changelog.


# (advanced) Base path to serve all API routes from (e.g. /v1/)
# CLI flag: -server.path-prefix
[http_path_prefix: <string> | default = ""]
Expand Down
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ require (
github.com/prometheus/prometheus v1.8.2-0.20220620125440-d7e7b8e04b5e
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
github.com/sirupsen/logrus v1.9.0
github.com/spf13/afero v1.8.2
github.com/spf13/afero v1.9.2
github.com/stretchr/testify v1.8.2
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
github.com/weaveworks/common v0.0.0-20230509123641-102db1b5bbb9
go.uber.org/atomic v1.10.0
go.uber.org/goleak v1.2.1
golang.org/x/crypto v0.7.0
Expand Down Expand Up @@ -136,6 +136,7 @@ require (
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-errors/errors v1.4.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
Expand Down Expand Up @@ -208,7 +209,7 @@ require (
github.com/rs/cors v1.9.0 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/sercand/kuberesolver v2.4.0+incompatible // indirect
github.com/sercand/kuberesolver/v4 v4.0.0 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's worth calling out this change, which was required by the gRPC update, just in case it works differently.

Copy link
Member

Choose a reason for hiding this comment

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

Also added to changelog.

github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
github.com/spf13/cobra v1.5.0 // indirect
Expand Down Expand Up @@ -253,9 +254,6 @@ replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus
// - https://github.com/hashicorp/memberlist/pull/263
replace github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe

// In sync with github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
replace google.golang.org/grpc => google.golang.org/grpc v1.47.0

// gopkg.in/yaml.v3
// + https://github.com/go-yaml/yaml/pull/691
// + https://github.com/go-yaml/yaml/pull/876
Expand Down
Loading