update README
All checks were successful
Build and Publish / check-chart (push) Successful in 10s
Build and Publish / helm-release (push) Has been skipped
Build and Publish / release (push) Has been skipped

This commit is contained in:
Ryan McGuire 2025-03-31 16:21:09 -04:00
parent 676f9b7755
commit dd87a3a570

View File

@ -1,23 +1,66 @@
# go-server-with-otel
# go-server-with-otel 🚀
Template for a go HTTP + GRPC server with OTEL support. Uses the go-app
framework to easily bootstrap a new app with all the bells and whistles.
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.
The provided proto returns a random fact, and serves only as a reference.
It has support for grpc-gateway, and produces an openapi2/swagger spec for
use with postman, etc..
Check out the [go-app framework](https://gitea.libretechconsulting.com/rmcguire/go-app) for more detail there.
## Getting Started
## 🌟 Features
1. Rename your package using `make rename NAME=my.gitremote.com/pathto/repo`
1. Review the config struct, adding any app-specific configuration
1. This will be merged with the go-app config, giving logging/http/grpc
configuration for free
1. Generate a new json schema, for use with your config.yaml: `make schema`
1. Ensure you have yaml+json tags
1. The yaml-language-server lsp plugin for your favorite editor should
pull in the schema using the comment in `config.yaml`
1. Run `make proto` after updating proto changes, and add any
1. paths under proto/ as necessary
1. Implement your things
1. Update parameters in `.gitea/workflows/ci.yaml` for your app
- **📈 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. **Rename your package:**
```sh
make rename NAME=my.gitremote.com/pathto/repo
```
2. **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.
3. **Generate a new JSON schema:**
```sh
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`.
4. **Compile proto files:**
```sh
make proto
```
- Add paths under `proto/` as necessary.
5. **Implement your application logic.**
6. **Update Gitea CI configuration:**
Modify parameters in `.gitea/workflows/ci.yaml` as needed.
---
## 📂 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! 🎉