Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
update grpc-http example to autometrics 2.0
  • Loading branch information
mellowagain committed Sep 6, 2024
commit b3c6e18184133f78e20a56e894f9142b47cb47fc
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- run: cargo build --package example-exemplars-tracing
- run: cargo build --package example-exemplars-tracing-opentelemetry
- run: cargo build --package example-full-api
- run: cargo build --package example-grpc-http
- run: cargo build --package example-opentelemetry-push


Expand Down
3 changes: 2 additions & 1 deletion examples/grpc-http/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::net::SocketAddr;
use tonic::transport::Server as TonicServer;
use warp::Filter;
use warp::http::StatusCode;

use autometrics::prometheus_exporter;
use server::MyJobRunner;
Expand Down Expand Up @@ -52,7 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Build http /metrics endpoint
let routes = warp::get()
.and(warp::path("metrics"))
.map(|| prometheus_exporter::encode_http_response());
.map(|| prometheus_exporter::encode_to_string().map_err(|_| StatusCode::INTERNAL_SERVER_ERROR));

// Build http web server
let (_, web_server) =
Expand Down