Skip to content

Azure Monitor

Azure Monitor is a cloud-native monitoring service from Microsoft designed to collect, analyze, and act on telemetry data from Azure resources, on-premises environments, and hybrid systems. Azure Monitor integrates with tools like Application Insights and Log Analytics, enabling proactive issue detection, resource optimization, and seamless visualization with Azure dashboards.

Configure Martini Runtime to send Metrics to Azure Monitor

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

Set up Microsoft Azure Monitor

Application Insights

  • Sign in to Microsoft Azure Portal.
  • Select Azure Monitor.
  • In the Monitor Overview page, click on "Application Insights" then "View".
  • Create Application Insights apps.
  • Once the Application Insights passes validation, click "Create". You can now use this to gather metrics from Martini Runtime.

Credentials

  • Once deployment is complete, Select "Go to resource".
  • In the Overview page, Click on "Instrumentation Key". This will be added to your Martini Runtime’s application.properties file.

Martini Runtime Setup

  • Import the Micrometer Registry Azure Monitor 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
    21
    22
    # Specifies which management endpoints should be exposed.
    # In this case, it includes the 'metrics' endpoint, allowing access to application metrics.
    management.endpoints.web.exposure.include=metrics
    
    # Enables the export of metrics to Azure Monitor.
    management.metrics.export.azuremonitor.enabled=true
    
    # Sets the logging level for Micrometer (the metrics library) to DEBUG.
    # This can help with troubleshooting by providing more detailed logs.
    logging.level.io.micrometer=DEBUG
    
    # Specifies the instrumentation key for Azure Monitor.
    # This key is used to authenticate and identify your application with Azure Monitor.
    management.metrics.export.azuremonitor.instrumentation-key=yourCopiedInstrumentationKeyHereFromStep1
    
    # Sets the frequency of exporting metrics to Azure Monitor to 1 minute.
    # This means metrics will be sent to Azure Monitor every minute.
    management.metrics.export.azuremonitor.step=1m
    
    # Specifies the instrumentation key for Azure Application Insights.
    # This key is used to authenticate and identify your application with Azure Application Insights.
    azure.application-insights.instrumentation-key=yourCopiedInstrumentationKeyHereFromStep1
    

  • Restart Martini Runtime to apply the changes.

Query Metrics

  • Click on "Metrics" under "Monitoring".
  • Metrics sent by applications like Martini Runtime are stored under the azure.applicationinsights namespace.
  • Select the metric you want to check.