File tree 3 files changed +7
-2
lines changed
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,17 @@ jobs:
35
35
# Build the crate using the other optional features
36
36
- run : cargo build --features=metrics-0_21,custom-objective-percentile,custom-objective-latency
37
37
38
+ # Install protoc for the examples
39
+ - uses : arduino/setup-protoc@v3
40
+
38
41
# Compile the examples
39
42
- run : cargo build --package example-actix-web
40
43
- run : cargo build --package example-axum
41
44
- run : cargo build --package example-custom-metrics
42
45
- run : cargo build --package example-exemplars-tracing
43
46
- run : cargo build --package example-exemplars-tracing-opentelemetry
44
47
- run : cargo build --package example-full-api
48
+ - run : cargo build --package example-grpc-http
45
49
- run : cargo build --package example-opentelemetry-push
46
50
47
51
Original file line number Diff line number Diff line change 1
1
[package ]
2
- name = " grpc-http"
2
+ name = " example- grpc-http"
3
3
version = " 0.0.0"
4
4
publish = false
5
5
edition = " 2021"
Original file line number Diff line number Diff line change 1
1
use std:: net:: SocketAddr ;
2
2
use tonic:: transport:: Server as TonicServer ;
3
3
use warp:: Filter ;
4
+ use warp:: http:: StatusCode ;
4
5
5
6
use autometrics:: prometheus_exporter;
6
7
use server:: MyJobRunner ;
@@ -52,7 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
52
53
// Build http /metrics endpoint
53
54
let routes = warp:: get ( )
54
55
. and ( warp:: path ( "metrics" ) )
55
- . map ( || prometheus_exporter:: encode_http_response ( ) ) ;
56
+ . map ( || prometheus_exporter:: encode_to_string ( ) . map_err ( |_| StatusCode :: INTERNAL_SERVER_ERROR ) ) ;
56
57
57
58
// Build http web server
58
59
let ( _, web_server) =
You can’t perform that action at this time.
0 commit comments