How to Simplify Spring Boot Observability Without Running Prometheus/Grafana Infrastructure
The Monitoring Trap I Fell Into
When I started building Spring Boot applications, every tutorial told me the same thing: “Set up Prometheus and Grafana for observability.” So I did. I spent a weekend configuring servers, writing PromQL queries, and building Grafana dashboards.
Three months later, I realized something uncomfortable: I was spending more time maintaining my monitoring infrastructure than actually building features. My Prometheus server ran out of disk space twice. My Grafana dashboards broke after an upgrade. And I still didn’t have proper alerting set up.
That’s when I asked myself: Is this really the only way?
The Hidden Cost of “Standard” Monitoring
The Prometheus/Grafana stack works great for teams with dedicated DevOps engineers. But for small teams or solo developers, it becomes a burden:
Infrastructure you need to maintain:
Traditional Stack Components:├── Prometheus server (stateful, needs persistent storage)├── Grafana instance (dashboards, users, permissions)├── Alertmanager (routing, silences, rules)├── Exporters (node, application, custom)└── Network + backup + securityTime I wasted:
- Upgrading Prometheus versions (migration scripts, breaking changes)
- Debugging why metrics weren’t being scraped
- Learning PromQL syntax for every new query
- Managing storage and retention policies
- Training team members on Grafana
I wanted to build applications, not become a monitoring infrastructure expert. There had to be a simpler path.
Discovery: Micrometer Already Does the Hard Work
Here’s what I didn’t realize: Spring Boot’s Actuator with Micrometer already provides vendor-neutral metrics. The standard setup uses Prometheus as a backend, but Micrometer supports many others out of the box.
// Spring Boot Actuator already exposes these metrics:- JVM memory, GC, thread counts- HTTP request durations and error rates- Database connection pool stats- Custom business metrics you defineThe key insight: Micrometer is just the interface. The backend can be anything.
Solution 1: SaaS Platforms with Zero Infrastructure
I tried Datadog first, and the setup shocked me. Five minutes from “no monitoring” to “production-ready dashboards.”
Datadog Setup (What I Actually Did)
Added this to my pom.xml:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-datadog</artifactId></dependency>Then configured the API key in application.yml:
management: metrics: export: datadog: api-key: ${DD_API_KEY} tags: application: ${spring.application.name}That’s it. No servers. No Docker containers. No configuration files.
Within 60 seconds, metrics appeared in Datadog’s dashboard:
What appeared automatically:├── JVM metrics (heap, GC, threads)├── HTTP request latency (p50, p95, p99)├── Database connection pool├── Pre-built Spring Boot dashboard└── Ready-to-use alert templatesWhat About Vendor Lock-in?
I tested switching from Datadog to New Relic. Changed one dependency:
<dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-new-relic</artifactId></dependency>And updated the config:
management: metrics: export: newrelic: account-id: ${NEW_RELIC_ACCOUNT_ID} api-key: ${NEW_RELIC_INSIGHTS_API_KEY} step: 1mZero code changes. Micrometer abstracts the backend completely.
Other SaaS Options I Evaluated
Dynatrace offers similar simplicity with AI-powered anomaly detection:
management: dynatrace: metrics: export: uri: https://${your-env-id}.live.dynatrace.com/api/v2/metrics/ingest api-token: ${DYNATRACE_API_TOKEN} step: 60sEmerging tools like Opsion focus specifically on the “add dependency + API key” experience, with pre-built dashboards and alerts configured out of the box.
Solution 2: OpenTelemetry for Future-Proof Flexibility
While SaaS platforms are easy, I worried about being locked into one vendor. Then I discovered OpenTelemetry (OTel).
Why OpenTelemetry Changed My Mind
OpenTelemetry provides three advantages:
- One SDK for everything: Metrics, traces, and logs in a single integration
- Vendor-neutral: Switch backends without touching code
- Automatic instrumentation: Zero code changes for basic metrics
OpenTelemetry Setup
Added the Spring Boot starter:
<dependency> <groupId>io.opentelemetry.instrumentation</groupId> <artifactId>opentelemetry-spring-boot-starter</artifactId></dependency>Configured it to send to Honeycomb:
otel: exporter: otlp: endpoint: https://api.honeycomb.io:443 headers: x-honeycomb-team: ${HONEYCOMB_API_KEY} resource: attributes: service.name: ${spring.application.name}Now I get:
- Metrics: Performance data
- Traces: Request flow across services
- Logs: All correlated together
Backend Options
I tested several OpenTelemetry-compatible backends:
| Backend | Best For | My Experience |
|---|---|---|
| Honeycomb | High-cardinality debugging | Excellent for complex queries |
| Lightstep | Microservices tracing | Great service maps |
| Grafana Cloud | Prometheus compatibility | Familiar if you know Prometheus |
| HyperDX | Developer experience | Unified logs/metrics/traces UI |
The best part: I can switch between any of these by changing only the endpoint URL.
Solution 3: Managed Prometheus (If You Still Want Prometheus)
Some teams need Prometheus compatibility (existing queries, Grafana expertise, compliance requirements). Managed Prometheus services give you this without the infrastructure.
Using Pushgateway for Ephemeral Apps
For batch jobs or serverless functions, I used the Pushgateway approach:
<dependency> <groupId>io.prometheus</groupId> <artifactId>prometheus-metrics-exporter-pushgateway</artifactId></dependency>management: prometheus: metrics: export: pushgateway: enabled: true base-url: https://pushgateway.grafana.net job: ${spring.application.name}This pushes metrics to a managed service instead of requiring Prometheus to scrape my application.
How I Chose: Decision Framework
After testing all three approaches, here’s how I decided:
For Solo Developers (1-3 people)
Pick: Datadog or New Relic free tier
Why:
- Zero infrastructure
- Instant dashboards
- No learning curve
- Free tier covers small apps
For Small Teams (4-10 people)
Pick: OpenTelemetry + Honeycomb or Lightstep
Why:
- Flexibility to change backends
- Tracing included (critical for microservices)
- Cost scales predictably
- Team can learn one tool
For Teams Wanting Prometheus Compatibility
Pick: Grafana Cloud or AWS Managed Prometheus
Why:
- Keep PromQL queries
- Familiar Grafana interface
- No server maintenance
- Pay for what you use
Real Migration: From Nothing to Monitoring
Here’s the exact path I followed for a new Spring Boot project:
Day 1: Enable Actuator (2 minutes)
management: endpoints: web: exposure: include: health,info,metrics endpoint: health: show-details: alwaysTested it: curl http://localhost:8080/actuator/health
Day 1: Add SaaS Backend (3 minutes)
Chose Datadog, added the dependency and API key. Metrics appeared in the dashboard within a minute.
Week 1: Add Custom Business Metrics
For tracking actual business value, I added custom metrics:
@Servicepublic class OrderService { private final Counter orderCounter; private final Timer orderDuration;
public OrderService(MeterRegistry registry) { this.orderCounter = Counter.builder("orders.total") .description("Total orders processed") .tag("type", "online") .register(registry);
this.orderDuration = Timer.builder("orders.duration") .description("Order processing time") .publishPercentiles(0.5, 0.95, 0.99) .register(registry); }
public Order createOrder(OrderRequest request) { return orderDuration.record(() -> { Order order = processOrder(request); orderCounter.increment(); return order; }); }}Now I track:
- Order volume over time
- Processing latency percentiles
- Error rates by order type
Week 2: Configure Alerts
Set up alerts in the SaaS dashboard:
- Error rate > 1% for 5 minutes
- p95 latency > 500ms for 10 minutes
- JVM heap usage > 85% for 5 minutes
No Alertmanager configuration. No routing rules. Just click and configure.
What I Learned
The biggest realization: Prometheus/Grafana is a tool, not a requirement. Spring Boot’s observability stack is backend-agnostic.
The “add dependency + API key” approach is real. I spent 5 minutes setting up Datadog, versus the weekend I spent on Prometheus/Grafana initially.
OpenTelemetry is the future. It gives me vendor neutrality without complexity. One SDK handles metrics, traces, and logs.
Pre-built dashboards save time. Every SaaS platform I tried had Spring Boot dashboards ready to use. No more building Grafana panels from scratch.
Quick Start: Pick Your Path
If you want the fastest path (5 minutes):
- Sign up for Datadog/New Relic free tier
- Add Micrometer dependency
- Add your API key
- Done
If you want flexibility (10 minutes):
- Add OpenTelemetry starter
- Choose a backend (Honeycomb, Lightstep, Grafana Cloud)
- Configure the endpoint
- Get metrics + traces
If you need Prometheus compatibility (15 minutes):
- Use Grafana Cloud or AWS Managed Prometheus
- Configure Pushgateway for push-based metrics
- Keep your existing PromQL queries
Summary
In this post, I shared how I escaped the Prometheus/Grafana infrastructure trap and found simpler observability solutions for Spring Boot. I walked through three approaches: SaaS platforms with Micrometer, OpenTelemetry for vendor neutrality, and managed Prometheus services. I showed the exact setup for each, including the 5-minute Datadog integration and the OpenTelemetry configuration I now use for new projects.
The key insight is that monitoring doesn’t require infrastructure expertise. Spring Boot’s Actuator + Micrometer gives you vendor-neutral metrics. OpenTelemetry adds traces and logs. SaaS platforms handle everything else: storage, dashboards, alerts, and scaling.
For small teams and solo developers, the “add dependency + API key” approach isn’t just possible—it’s the better choice. Start with a SaaS free tier, and if you need more flexibility later, OpenTelemetry provides a smooth migration path.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Spring Boot Actuator Documentation
- 👨💻 Micrometer Documentation
- 👨💻 OpenTelemetry Spring Boot Starter
- 👨💻 Datadog Micrometer Integration
- 👨💻 New Relic Micrometer Integration
- 👨💻 Honeycomb OpenTelemetry
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments