Building a web service with go-tool-base, part 6: seeing what your service is doing
Add OpenTelemetry traces, metrics and logs to a Go service with middleware and manual spans, and get one end-to-end trace through the gateway.

Add OpenTelemetry traces, metrics and logs to a Go service with middleware and manual spans, and get one end-to-end trace through the gateway.

Generate an OpenAPI v3 document from an annotated proto file and serve it from the same HTTPS server with an embedded Stoplight Elements UI.

Replace a hand-written REST layer with grpc-gateway: add google.api.http annotations, generate the gateway, and delete the duplicate encoding.

Serve HTML from the same Go HTTP server using html/template and embed, baking templates and static assets straight into the binary.

Two ways to put REST on a Go service: a hand-written net/http ServeMux, and generated handlers from an OpenAPI spec with oapi-codegen.

Define a protobuf contract, generate Go with buf, implement a gRPC server over a domain store, and turn on hardened TLS with mkcert and ALPN.

Service lifecycle in Go: register services with start and stop verbs, handle SIGINT and SIGTERM, and shut down gracefully with liveness checks.

Add self-update to a Go CLI: resolve releases per platform, compare versions, verify checksums and migrate config on upgrade.

Build an AI dungeon master in Go: keep the model to prose only by putting the rules in the system prompt and the mechanics in typed tool calls.

Expose an existing Go CLI to AI agents over MCP without writing any AI code, using built-in commands. The agent reach equals the CLI reach.
