Ryan McGuire d875bbb2f7
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 9s
Build and Publish / helm-release (push) Has been skipped
use docker app_name arg
2025-04-04 15:42:05 -04:00
2025-01-03 17:13:15 -05:00
2025-03-31 10:13:02 -04:00
2025-03-31 10:13:02 -04:00
2025-03-30 20:31:52 -04:00
2025-03-30 20:39:46 -04:00
2025-03-30 20:35:31 -04:00
2025-03-30 20:31:52 -04:00
2025-03-31 10:13:02 -04:00
2025-04-01 09:10:43 -04:00
2025-04-01 09:10:43 -04:00
2025-03-30 11:38:56 -04:00
2025-01-03 19:54:04 +00:00
2025-03-31 16:24:01 -04:00
2025-04-04 15:42:05 -04:00
2025-04-01 09:10:43 -04:00
2025-04-01 09:10:43 -04:00

go-server-with-otel 🚀

A powerful and flexible template for building Go HTTP + GRPC servers with full OpenTelemetry (OTEL) support. Bootstrapped with the go-app framework to provide all the bells and whistles right out of the box. Ideal for rapidly creating production-ready microservices.

Check out the go-app framework for more detail there.

🌟 Features

  • 📈 OpenTelemetry (OTEL) Metrics & Traces Comprehensive observability with built-in support for metrics and traces.
  • 📝 Logging with Zerolog High-performance structured logging with zerolog for ultra-fast, leveled logging.
  • 💬 GRPC + GRPC-Gateway Supports RESTful JSON APIs alongside gRPC with auto-generated Swagger (OpenAPI2) specs.
  • 🌐 HTTP and GRPC Middleware Flexible middleware support for HTTP and GRPC to enhance request handling, authentication, and observability.
  • 📦 Multi-Arch Builds Robust Makefile that supports building for multiple architectures (amd64, arm64, etc.).
  • 🐳 Docker Image Generation Easily build Docker images using make docker.
  • 📜 Config Schema Generation Automatically generate JSON schemas for configuration validation.
  • 📝 Proto Compilation Seamlessly compile .proto files with make proto.
  • 🔄 Project Renaming Easily rename your project using make rename NAME=your.gitremote.com/pathto/repo.
  • 📦 Helm Chart Deploy your application with Kubernetes using the provided Helm chart.
  • 🤖 Gitea CI Integration Out-of-the-box Gitea CI pipeline configuration with .gitea/workflows/ci.yaml.
  • ⚙️ Expandable Configuration Extend your app-specific configuration with go-app's built-in logging, HTTP, and GRPC config support.

📚 Getting Started

  1. Install tools:

    • Install make, protoc, and go using brew, apt, etc..
    • Install protoc plugins (provided in go.mod tool()):
      • go get -v tool && go install -v tool
  2. Rename your package:

    make rename NAME=my.gitremote.com/pathto/repo
    
  3. Review the config struct: Update and customize your app-specific configuration. This merges with go-app's configuration, providing logging, HTTP, and GRPC config for free.

  4. Generate a new JSON schema:

    make schema
    
    • Ensure your structs have yaml and json tags.
    • With the yaml-language-server LSP plugin, the schema will be auto-detected in your config.yaml.
  5. Compile proto files:

    make proto
    
    • Add paths under proto/ as necessary.
  6. Implement your application logic.

  7. Update Gitea CI configuration: Modify parameters in .gitea/workflows/ci.yaml as needed.

  8. Tag your release: git tag v0.1.0 and push git push --tags


📂 Project Structure

  • proto/ - Protobuf definitions and generated files.
  • api/ - Auto-generated code for proto, grpc-gateway, and OpenAPI2 spec
  • pkg/config/ - Custom config, merged with go-app configuration
  • pkg/demo(http|grpc)/ - HTTP and GRPC server implementations
  • helm/ - Helm chart for deploying your application to Kubernetes.
  • .gitea/workflows/ - CI pipelines for automated builds and tests.

🔥 Ready to build something awesome? Let's go! 🎉

Description
Template for a go server with HTTP, GRPC, and OTEL support
Readme MIT 199 KiB
Languages
Go 69.2%
Makefile 25.5%
Dockerfile 5.3%