DEV.co
Open-Source Observability · go-masonry

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.

Source: GitHub — github.com/go-masonry/mortar
677
GitHub stars
22
Forks
Go
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorygo-masonry/mortar
Ownergo-masonry
Primary languageGo
LicenseMIT — OSI-approved
Stars677
Forks22
Open issues0
Latest releasev1.0.35 (2025-05-13)
Last updated2025-05-13
Sourcehttps://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.

Quickstart

Get the mortar source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/go-masonry/mortar.gitcd mortar# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Microservice Platform with Distributed Tracing

Teams building multiple interconnected gRPC services needing trace correlation across requests. Mortar's built-in traceId propagation via HTTP headers and context simplifies observability setup.

gRPC-to-REST Gateway Services

Services requiring both gRPC backend and REST frontend. Bundled Grpc-Gateway integration eliminates separate gateway configuration and deployment.

Telemetry-First Development

Organizations prioritizing operational observability from day one. Predefined handlers for pprof profiling, health checks, and configuration endpoints reduce boilerplate.

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.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

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.

Software development agency

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.co

Related 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)?
No. Mortar defines abstract interfaces for logging, configuration, tracing, and monitoring. Wrappers are provided for convenience, but you can implement your own or plug in third-party integrations.
How is tracing correlation handled across services?
Mortar propagates traceId via HTTP headers and gRPC metadata. Interceptors automatically extract and attach traceId to logs. Downstream services must be instrumented similarly to maintain correlation.
What is the overhead of built-in interceptors?
Not quantified in provided data. Requires profiling with your workload; use provided pprof endpoints (`/debug/pprof`) to measure.
Can Mortar be used for non-gRPC services?
Partially. Mortar is gRPC-first; REST support comes via Grpc-Gateway translation. Pure HTTP-only services would be better served by lighter frameworks.

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.