Skip to content

New Relic

New Relic is an observability platform designed to help monitor, analyze, and optimize the performance of applications and infrastructure. It provides tools for application performance monitoring (APM), infrastructure monitoring, distributed tracing, and log management.

Configure Martini Runtime to send Metrics to New Relic

This guide helps you configure Martini Runtime to send metrics to New Relic, facilitating the monitoring of your application's performance. If you encounter any issues, refer to the New Relic documentation or seek support from the New Relic community.

Create an Account

  • Go to New Relic Signup and create an account.
  • While setting up your account, make sure to copy your License Key and Account ID, as you won’t be able to copy these afterwards.
  • If you weren’t able to copy these credentials, you may simply delete the old License Key and create a new one then copy that. Make sure to copy the values and store them somewhere safe the first time they are generated as you won’t be able to copy them again.

Martini Runtime Setup

  • Import the Micrometer Registry New Relic JAR file on Martini.
  • Configure the application.properties with the following properties:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    # Expose metrics endpoint
    management.endpoints.web.exposure.include=metrics
    
    # Enable sending metrics to New Relic
    management.metrics.export.newrelic.enabled=true
    
    # Your New Relic license key
    management.metrics.export.newrelic.api-key=<license-key>
    
    # Your New Relic account ID
    management.metrics.export.newrelic.account-id=<account-id>
    
    # Interval for sending metrics
    management.metrics.export.newrelic.step=20s
    
    # Debugging purposes
    logging.level.io.micrometer.newrelic=DEBUG
    
    # Define the event type for Martini Runtime metrics 
    management.metrics.export.newrelic.event-type=<event-type>
    

  • Replace <license-key> and <account-id> with your actual New Relic license key and account ID. Choose any descriptive name for <event-type> to define how your Martini Runtime metrics will be grouped when queried in New Relic.

  • Restart Martini Runtime to apply the changes.

Query Metrics

  • Go to New Relic Data Exploration to query and explore your metrics.
  • Martini Runtime metrics will be grouped under the event-type name you specified in management.metrics.export.newrelic.event-type=<event-type>. You may query specific metrics such as service-invoke or endpoint-invoke.