Martini Metrics API
Overview
The Martini Metrics API provides production-ready monitoring capabilities for applications built on the Martini platform. It exposes detailed runtime metrics, health endpoints, and system performance data that operations teams use to monitor application health, track performance trends, and integrate with enterprise monitoring platforms like Prometheus, Datadog, and CloudWatch.
What You Will Learn
- How to access and utilize Martini's built-in metrics endpoints for production monitoring
- Which monitoring systems integrate with Martini through Micrometer support
- How to read and interpret JVM, application, and system performance metrics
- When to use the Metrics API versus the visual Server Admin UI
- Best practices for integrating Martini metrics into enterprise monitoring workflows
When To Use This
Use the Metrics API when you need programmatic access to Martini application performance data. This is essential for:
- Integrating with external monitoring systems like Prometheus or Datadog
- Building custom monitoring dashboards
- Implementing health checks for load balancers and orchestration platforms like Kubernetes
- Accessing detailed runtime metrics for performance analysis and troubleshooting
Prerequisites
- Running Martini Server instance with network access to metrics endpoints
- User credentials with access permissions for the specific Martini instance you want to monitor
- Basic understanding of HTTP REST API requests and JSON response formats
- Knowledge of your target monitoring system's configuration requirements (if integrating externally)
Alternative: Visual Monitoring with Server Admin UI
For teams who prefer visual dashboards, Martini provides the Server Admin UI - a web-based interface that displays the same metrics data in graphical format.
Use the Metrics API for: External monitoring integrations (Prometheus, Datadog), automated alerting, programmatic access, and Kubernetes health checks.
Use the Server Admin UI for: Real-time visual monitoring, dashboard interfaces, quick performance charts, and interactive debugging.
Both approaches access the same underlying data and complement each other.
Metrics API Core Concepts
The Metrics API serves as your primary interface for production monitoring and operational management of Martini applications, providing essential data for maintaining application health and performance in enterprise environments.
Getting Started with Metrics API Endpoints
Access the Metrics API through standard HTTP requests to your Martini Server instance. Replace MARTINI_RUNTIME_SERVER_URL with your running server address:
- For local development: Use
http://localhost:<PORT>(default port is 8080, but this can vary depending on your configuration) - For production environments: Use HTTPS (required for Martini Runtime hosted via Lonti Managed Hosting and recommended for self-managed hosting)
Core Endpoints:
<MARTINI_RUNTIME_SERVER_URL>/actuator- Lists all available metrics endpoints<MARTINI_RUNTIME_SERVER_URL>/actuator/metrics- Returns complete metrics catalog<MARTINI_RUNTIME_SERVER_URL>/actuator/metrics/{metricName}- Gets specific metric details
Example requests:
1 2 3 4 5 | |
Expected result: JSON response with current memory usage data including measurements, available tags, and statistical values.
Metrics API Key Terms
Essential terminology for understanding and working with Martini's metrics system.
| Term | Definition |
|---|---|
| Metric Name | Unique identifier for a specific measurement (e.g., jvm.memory.used, service.invoke) |
| Metric Tags | Key-value pairs that add dimensional data to metrics for filtering and grouping |
Micrometer Integration & Monitoring Systems
Martini includes built-in Micrometer support that enables seamless integration with enterprise monitoring platforms, allowing you to export metrics to multiple systems simultaneously for comprehensive observability.
Supported Monitoring Systems
Martini supports integration with the following monitoring platforms through Micrometer. Click on each link to access detailed configuration instructions for your specific monitoring system:
| Monitoring System | Authentication Required | Configuration Guide |
|---|---|---|
| AppOptics | API Token | Complete setup guide for AppOptics integration with token-based authentication |
| Azure Monitor | Azure Credentials | Step-by-step Azure Monitor configuration for dimensional monitoring |
| CloudWatch | AWS Credentials | Amazon CloudWatch integration setup and configuration |
| Datadog | API Key | Datadog monitoring platform configuration with API key setup |
| New Relic | License Key | New Relic integration guide for real-time monitoring |
| Stackdriver | Google Cloud Credentials | Google Cloud Stackdriver configuration for observability |
Each configuration guide provides specific setup instructions, authentication requirements, and troubleshooting steps for the respective monitoring platform.
How Monitoring Integration Works
Micrometer acts as an abstraction layer between Martini's metric collection and external monitoring systems. When you configure a monitoring system, Micrometer automatically formats and transmits metrics according to each platform's specific requirements. This allows you to change monitoring systems or add additional systems without modifying your Martini application code.
The integration process handles authentication, data formatting, retry logic, and error handling transparently, ensuring reliable metric delivery even in high-traffic production environments.
Available Metrics
Martini automatically collects metrics across different aspects of application performance and system health. Use the /actuator/metrics endpoint to see all available metrics, then explore specific metrics based on your monitoring needs.
See how to access various Metrics API endpoints to view available metrics and specific details
The metrics below are organized into categories for easier navigation:
Storage Metrics
Disk space and storage utilization metrics for the Martini application environment.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
disk.free |
Usable space for the path where Martini home directory is located | Storage | Monitor disk space to prevent outages, trigger alerts for low storage |
disk.total |
Total disk space for the path where Martini home directory is located | Storage | Capacity planning, storage utilization tracking |
Application Performance Metrics
Metrics specific to Martini application functionality including service invocations and trigger executions.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
endpoint.invoke |
Count of invocations via Martini Triggers | Application | Monitor trigger execution frequency, track automated workflow performance |
service.invoke |
Service invocation count | Application | Track service usage patterns, identify performance bottlenecks |
license.service.invoke |
License service invocation count | Licensing | Monitor license usage for compliance and billing tracking |
Web Traffic Performance Metrics
HTTP request metrics covering REST APIs, service endpoints, and webhook triggers.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
http.server.requests |
Duration of HTTP server request handling including REST APIs, adhoc REST APIs for services, and workflows with webhook triggers | Web Traffic | Monitor request volume, response times, error rates for SLA compliance |
JVM Performance Metrics
Java Virtual Machine metrics provide critical insights into application runtime performance, memory management, and resource utilization that directly impact user experience and system stability.
Why JVM Metrics Matter for Enterprise Applications:
The Java Virtual Machine executes your Martini applications and its performance directly affects your application's responsiveness and reliability. For enterprise developers, JVM monitoring is crucial for performance optimization by identifying memory leaks and garbage collection inefficiencies, capacity planning through understanding memory usage patterns, proactive issue detection by predicting OutOfMemoryError conditions, and cost management through optimized resource utilization.
JVM Memory Usage Metrics
Memory allocation, usage, and management metrics for understanding application memory behavior.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
jvm.buffer.count |
Number of buffers in the buffer pool | JVM Memory | Monitor buffer pool usage for memory optimization |
jvm.buffer.memory.used |
Memory used by the buffer pool | JVM Memory | Track buffer memory consumption, detect memory leaks |
jvm.buffer.total.capacity |
Total capacity of buffers in the pool | JVM Memory | Assess buffer allocation efficiency |
jvm.memory.committed |
Amount of memory guaranteed to be available for use by the JVM | JVM Memory | Track actual memory allocation by JVM |
jvm.memory.max |
Maximum amount of memory that can be used for memory management | JVM Memory | Capacity monitoring, prevent OutOfMemoryError conditions |
jvm.memory.usage.after.gc |
Percentage of long-lived heap pool used after the last GC event (range 0-1) | JVM Memory | Monitor memory cleanup efficiency after garbage collection |
jvm.memory.used |
Amount of memory currently in use | JVM Memory | Real-time memory monitoring, alerting on high usage |
JVM Runtime Environment Metrics
Class loading and runtime environment metrics for understanding application complexity and performance.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
jvm.classes.loaded |
Number of classes currently loaded in the JVM | JVM Runtime | Monitor application complexity, class loading performance |
jvm.classes.unloaded |
Total number of classes unloaded since JVM startup | JVM Runtime | Track class lifecycle, detect classloader memory issues |
JVM Garbage Collection Performance Metrics
Garbage collection metrics that directly impact application responsiveness and throughput.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
jvm.gc.live.data.size |
Size of long-lived heap memory pool after garbage collection | Garbage Collection | Monitor heap efficiency after cleanup cycles |
jvm.gc.max.data.size |
Maximum size of long-lived heap memory pool | Garbage Collection | Capacity planning, heap sizing optimization |
jvm.gc.memory.allocated |
Memory allocated in young generation between GC cycles | Garbage Collection | Track allocation rate, tune GC parameters |
jvm.gc.memory.promoted |
Memory moved from young to old generation during GC | Garbage Collection | Monitor object lifecycle, optimize GC tuning |
jvm.gc.overhead |
Percentage of CPU time used by GC activities (range 0-1) | Garbage Collection | Critical performance indicator - high overhead requires GC tuning |
jvm.gc.pause |
Time spent in garbage collection pause | Garbage Collection | Monitor application latency impact from GC operations |
JVM Thread Management Metrics
Threading metrics for understanding concurrent execution and potential bottlenecks.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
jvm.threads.daemon |
Current number of live daemon threads | Threading | Monitor background thread activity and resource usage |
jvm.threads.live |
Current number of live threads (daemon and non-daemon) | Threading | Track thread pool health, detect thread leaks |
jvm.threads.peak |
Peak live thread count since JVM startup | Threading | Assess maximum concurrency requirements |
jvm.threads.states |
Current number of threads in BLOCKED state | Threading | Diagnose thread contention and blocking issues |
System Performance Metrics
Host system and process-level performance metrics for understanding infrastructure impact on application performance.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
process.cpu.usage |
Recent CPU usage for the Martini JVM process | System Performance | Monitor application CPU consumption for scaling decisions |
system.cpu.count |
Number of processors available to the JVM | System Info | Infrastructure monitoring, scaling capacity planning |
system.cpu.usage |
Recent CPU usage for the entire host system | System Performance | Monitor overall system load, capacity planning |
system.load.average.1m |
System load average over 1 minute period | System Performance | Critical for understanding system stress and scaling requirements |
System Resources Metrics
File descriptor and resource utilization metrics for preventing resource exhaustion issues.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
process.files.max |
Maximum number of file descriptors available | System Resources | Prevent file descriptor exhaustion in high-traffic applications |
process.files.open |
Current number of open file descriptors | System Resources | Monitor file handle leaks, resource management efficiency |
System Information Metrics
Process lifecycle and uptime metrics for availability and deployment tracking.
| Metric Name | Description | Category | Enterprise Use Case |
|---|---|---|---|
process.start.time |
Process start time since Unix epoch | System Info | Track application uptime, deployment timing analysis |
process.uptime |
Java Virtual Machine uptime duration | System Info | Monitor availability metrics, calculate SLA compliance |
Troubleshooting
Common issues when accessing or configuring the Metrics API, with specific solutions and diagnostic steps.
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| 403 Access Denied | API requests return HTTP 403 status | Your user account doesn't have permission to access metrics | Check that your user credentials have the correct permissions for this Martini instance |
| 404 Endpoint Not Found | API requests return HTTP 404 status | URL contains a typo or the metric doesn't exist | Double-check your URL for typos and verify the metric name exists by calling /actuator/metrics first |
Helpful Resources
- Server Admin UI Visual Monitoring - Web-based dashboard alternative for visual metrics monitoring
- Martini Triggers Documentation - Understanding trigger invocation metrics and monitoring
- REST API Development Guide - Creating APIs that generate HTTP request metrics
- Micrometer Documentation - Official Micrometer metrics library documentation
- Community Q&A: Martini Community
Have questions about metrics configuration or monitoring setup? Post or search here for community support.