mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix: add content-type for metrics response (#4340)
chore: add content-type for metrics response. Also, update the local stack to use prometheus 3.0 Finally, hex-escape arguments when logging an error for a command. Fixes #4277 Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
3f68028c08
commit
904d21d666
3 changed files with 3 additions and 2 deletions
|
@ -715,7 +715,7 @@ string FailedCommandToString(std::string_view command, facade::CmdArgList args,
|
|||
absl::StrAppend(&result, " ", command);
|
||||
|
||||
for (auto arg : args) {
|
||||
absl::StrAppend(&result, " ", facade::ToSV(arg));
|
||||
absl::StrAppend(&result, " ", absl::CHexEscape(arg));
|
||||
}
|
||||
|
||||
absl::StrAppend(&result, " failed with reason: ", reason);
|
||||
|
|
|
@ -1541,6 +1541,7 @@ void ServerFamily::ConfigureMetrics(util::HttpListenerBase* http_base) {
|
|||
|
||||
auto cb = [this](const util::http::QueryArgs& args, util::HttpContext* send) {
|
||||
StringResponse resp = util::http::MakeStringResponse(boost::beast::http::status::ok);
|
||||
util::http::SetMime(util::http::kTextMime, &resp);
|
||||
uint64_t uptime = time(NULL) - start_time_;
|
||||
PrintPrometheusMetrics(uptime, this->GetMetrics(&namespaces->GetDefaultNamespace()),
|
||||
this->dfly_cmd_.get(), &resp);
|
||||
|
|
|
@ -14,7 +14,7 @@ services:
|
|||
command: chown -R 11211:11211 /memcached
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:v2.45.5
|
||||
image: prom/prometheus:v3.0.0
|
||||
restart: always
|
||||
volumes:
|
||||
- ./prometheus:/etc/prometheus/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue