mortar
Mortar is a Go framework for building gRPC and REST microservices with built-in support for dependency injection, logging, tracing, and monitoring. It provides pre-configured defaults for common operational concerns while remaining fully customizable through a modular architecture.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | go-masonry/mortar |
| Owner | go-masonry |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 677 |
| Forks | 22 |
| Open issues | 0 |
| Latest release | v1.0.35 (2025-05-13) |
| Last updated | 2025-05-13 |
| Source | https://github.com/go-masonry/mortar |
What mortar is
Mortar wraps Uber-FX for dependency injection and bundles Grpc-Gateway for REST-to-gRPC translation, with abstract interfaces for logging, configuration, tracing (Jaeger), and metrics (Prometheus). It includes server/client interceptors for automatic instrumentation and correlation across service boundaries.
Get the mortar source
Clone the repository and explore it locally.
git clone https://github.com/go-masonry/mortar.gitcd mortar# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Dependency injection via Uber-FX is mandatory; familiarize the team with FX patterns before adoption.
- Custom wrappers for Zerolog, Viper, Jaeger, and Prometheus are provided but not required—teams can integrate preferred libraries.
- Demo and template repositories exist; clone and review before beginning development to understand conventional structure.
- Interceptor configuration for HTTP header forwarding, logging, and tracing is declarative but requires careful planning for multi-hop scenarios.
- Configuration override via `config_test.yml` is available but test isolation strategy should be documented.
When to avoid it — and what to weigh
- Monolithic CRUD Applications — Mortar's complexity is optimized for microservices; simpler web frameworks are more appropriate for traditional monolithic apps.
- Minimal Observability Requirements — Projects with no tracing, metrics, or logging needs will find Mortar's bundled telemetry stack unnecessary overhead.
- REST-Only Services — If gRPC and distributed tracing are not part of your architecture, lighter-weight Go frameworks better match your needs.
- Unfamiliar with Dependency Injection Patterns — Mortar's Uber-FX integration requires understanding DI principles; teams new to FX will face a steeper learning curve.
License & commercial use
Licensed under MIT (permissive open-source license). Allows commercial use, modification, and redistribution with attribution.
MIT license explicitly permits commercial use without restrictions. No commercial licensing model mentioned. Verify no undeclared dependencies with incompatible licenses before deployment.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
No security posture claims made in provided data. Built on standard Go HTTP and gRPC libraries; review dependency versions for vulnerabilities. Interceptor architecture allows request/response logging—ensure sensitive data handling is audited. pprof debug endpoints should be gated behind authentication in production.
Alternatives to consider
grpc-go (standard library)
Lower-level control but requires manual wiring of interceptors, metrics, and tracing; appropriate if minimalist architecture preferred.
Encore (Encore.dev)
Higher-level framework with built-in backends and observability; less customization but faster time-to-deploy for specific use cases.
Buf + Protoc ecosystem
Focuses on protobuf code generation and gRPC API design; pairs with any Go framework but adds no runtime structure or defaults.
Build on mortar with DEV.co software developers
Explore Mortar's demo repository and template to understand its patterns. Review the documentation and assess fit for your gRPC/observability architecture.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
mortar FAQ
Do I have to use the provided wrappers (Jaeger, Prometheus, Zerolog, Viper)?
How is tracing correlation handled across services?
What is the overhead of built-in interceptors?
Can Mortar be used for non-gRPC services?
Software developers & web developers for hire
Adopting mortar is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source observability software in production.
Ready to Build Observable Microservices?
Explore Mortar's demo repository and template to understand its patterns. Review the documentation and assess fit for your gRPC/observability architecture.