File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 run : |
4646 sleep 5
4747
48+ curl -f http://localhost:8080/metrics
49+
4850 # Put request with store='storeId' and key=k1
4951 hex=0A0773746F726549641A150A026B3110FFFFFFFFFFFFFFFFFF011A046B317631
5052 curl -f --data-binary "$(echo "$hex" | xxd -r -p)" http://localhost:8080/vss/putObjects
Original file line number Diff line number Diff line change @@ -79,6 +79,17 @@ impl Service<Request<Incoming>> for VssService {
7979 let maximum_request_body_size = self . config . maximum_request_body_size ;
8080
8181 Box :: pin ( async move {
82+ if path == "/metrics" {
83+ let response = b"# HELP vss_service_up Is the vss service up?\n # TYPE vss_service_up gauge\n vss_service_up 1\n " ;
84+ return Ok ( Response :: builder ( )
85+ . status ( StatusCode :: OK )
86+ . header ( "Content-Type" , "text/plain; version=0.0.4" )
87+ . header ( PROTOCOL_VERSION_HEADER , PROTOCOL_VERSION . as_bytes ( ) )
88+ . body ( Full :: new ( Bytes :: from_static ( response) ) )
89+ // unwrap safety: body only errors when previous chained calls failed.
90+ . unwrap ( ) ) ;
91+ }
92+
8293 let prefix_stripped_path = path. strip_prefix ( BASE_PATH_PREFIX ) . unwrap_or_default ( ) ;
8394
8495 match prefix_stripped_path {
You can’t perform that action at this time.
0 commit comments