Skip to main content

Azure monitor

Reading time: 0 minute(s) (0 words)

Azure Monitor is a monitoring solution that collects and aggregates data for further interpretation and response.

Nobl9 integration with Azure Monitor supports collecting Azure Monitor metrics, including Application Insights. With it, Nobl9 users can retrieve metrics and build SLOs based on them.

Scope of support​

caution

Ensure the metrics you use support a one-minute (1-minute) aggregation window (time grain).

Authentication​

To set up the Nobl9 direct connection, you must provide your Azure application's client ID and client secret. For this:

  1. Register an Azure application.
  2. Assign your Azure application the Monitoring Reader role for the Azure resources you want to read metrics from.
    This role meets the Nobl9 requirements for metric collection.
  3. Grant your application the Microsoft.Resources/subscriptions/resourceGroups/read permission.
    It enables resource and metric autocompletion during SLO creation.

You can also use sloctl. This way, you can configure SLOs for your Azure Cloud application without the resource and metric autocompletion.

Azure IAM

We recommend granting the Monitoring Reader role on the subscription or resource group level rather than a specific resource. A broader scope provides a more comprehensive choice of subscriptions, resource groups, resources, and metrics in the Nobl9 platform.

Adding Azure Monitor as a data source​

  1. Navigate to Integrations > Sources.
  2. Click .
    The Data Source wizard opens.
  3. Select Azure Monitor.

Azure Monitor direct​

Direct configuration in the UI​

  1. Click Direct.
  2. Enter your Azure Tenant ID.
    It is an 8-4-4-4-12-character code containing digits 0-9 and letters Aa-Ff.
  3. Enter your Azure Client ID.
  4. Enter your Azure Client Secret.
Azure application ID

To retrieve Azure application's client ID and client secret, find your required application under App Registrations within the Azure Portal.

  1. Select a Project.
    Specifying a project is helpful when multiple users are spread across multiple teams or projects. When the Project field is left blank then object is assigned to project default.
  2. Enter a Display Name.
    You can enter a friendly name with spaces in this field.
  3. Enter a Name.
    The name is mandatory and can only contain lowercase, alphanumeric characters and dashes (for example, my-project-name). This field is populated automatically when you enter a display name, but you can edit the result.
  4. Enter a Description.
    Here you can add details such as who is responsible for the integration (team/owner) and the purpose of creating it.
  5. Specify the Query delay to set a customized delay for queries when pulling the data from the data source.
    info
    Changing the Query delay may affect your SLI data. For more details, check the Query delay documentation.
  6. Enter a Maximum Period for Historical Data Retrieval.
    • This value defines how far back in the past your data will be retrieved.
    • The value for the maximum period of data retrieval depends on the data source. Check the Replay documentation for details.
    • A greater period can extend the loading time when creating an SLO.
      • The value must be a positive integer.
  7. Enter a Default Period for Historical Data Retrieval.
    • It is used by SLOs connected to this data source.
    • The value must be a positive integer or 0.
    • By default, this value is set to 0. When you set it to >0, you will create SLOs with Replay.
  8. Click Add Data Source.

Direct using CLI - YAML​

The YAML for setting up a direct connection to Azure Monitor looks like this:

apiVersion: n9/v1alpha
kind: Direct
metadata:
name: azure-monitor
displayName: Azure Monitor
project: azure-monitor
spec:
description: Direct integration with Azure Monitor
sourceOf:
- Metrics
azureMonitor:
tenantID: <YOUR_AZURE_TENANT_ID>
clientID: <YOUR_AZURE_APPLICATION_CLIENT_ID>
clientSecret: <YOUR_AZURE_APPLICATION_CLIENT_SECRET>
releaseChannel: beta # one of: beta | stable # string, one of: beta | stable. When adding a new direct without specifying the releaseChannel, the default release channel will be set to beta
queryDelay:
unit: Minute # string, one of: Second || Minute
value: 5 # numeric, must be a number from 5 to 1440 minutes (24 hours)
logCollectionEnabled: false # boolean, defaults to 'false'. Set to true if you'd like your source to collect logs. It's a beta functionality available only through direct release channel. Reach out to support@nobl9.com to activate it.
historicalDataRetrieval:
maxDuration:
value: 30
unit: Day # allowed values: Minute, Hour, Day
defaultDuration:
value: 0
unit: Day # allowed values: Minute, Hour, Day
Important notes​
  • tenantID is mandatory. It's the identifier of your Microsoft Entra tenant
  • clientID and clientSecret are credentials of your required Azure application
  • For correct operation, the queryDelay value must be within the range of 5-1440 minutes
  • Currently, releaseChannel: beta only

Azure Monitor agent​

Agent configuration in the UI​

  1. Click Agent.
  2. Enter your Azure Tenant ID.
    It is an 8-4-4-4-12-character code containing digits 0-9 and letters Aa-Ff.
  1. Select a Project.
    Specifying a project is helpful when multiple users are spread across multiple teams or projects. When the Project field is left blank then object is assigned to project default.
  2. Enter a Display Name.
    You can enter a friendly name with spaces in this field.
  3. Enter a Name.
    The name is mandatory and can only contain lowercase, alphanumeric characters and dashes (for example, my-project-name). This field is populated automatically when you enter a display name, but you can edit the result.
  4. Enter a Description.
    Here you can add details such as who is responsible for the integration (team/owner) and the purpose of creating it.
  5. Specify the Query delay to set a customized delay for queries when pulling the data from the data source.
    info
    Changing the Query delay may affect your SLI data. For more details, check the Query delay documentation.
  6. Enter a Maximum Period for Historical Data Retrieval.
    • This value defines how far back in the past your data will be retrieved.
    • The value for the maximum period of data retrieval depends on the data source. Check the Replay documentation for details.
    • A greater period can extend the loading time when creating an SLO.
      • The value must be a positive integer.
  7. Enter a Default Period for Historical Data Retrieval.
    • It is used by SLOs connected to this data source.
    • The value must be a positive integer or 0.
    • By default, this value is set to 0. When you set it to >0, you will create SLOs with Replay.
  8. Click Add Data Source.

Agent using CLI - YAML​

The YAML for setting up an agent connection to Azure Monitor is as follows:

apiVersion: n9/v1alpha
kind: Agent
metadata:
name: azure-monitor
displayName: Azure Monitor
project: azure-monitor
spec:
description: Azure Monitor agent
sourceOf:
- Metrics
azureMonitor:
tenantId: <YOUR_AZURE_AD_TENANT_ID>
releaseChannel: beta # string, one of: beta || stable
queryDelay:
unit: Minute # string, one of: Second || Minute
value: 5 # numeric, must be a number from 5 to 1440 minutes (24 hours)
historicalDataRetrieval:
maxDuration:
value: 30 # integer greater than or equal to 0
unit: Day # accepted values: Minute, Hour, Day
defaultDuration: # value must be less than or equal to value of maxDuration
value: 0 # integer greater than or equal to 0
unit: Day # accepted values: Minute, Hour, Day
Important notes​
  • For correct operation, the queryDelay value must be within the range of 5-1440 minutes
  • Currently, releaseChannel: beta only

Deploying Azure Monitor agent​

When you add the data source, Nobl9 automatically generates a Kubernetes configuration and a Docker command line for you to use to deploy the agent. Both of these are available in the web UI, under the Agent Configuration section. Be sure to swap in your credentials (e.g., replace the <YOUR_AZURE_APPLICATION_CLIENT_ID> and <YOUR_AZURE_APPLICATION_CLIENT_SECRET> with your client ID and client secret).

If you use Kubernetes, you can apply the supplied YAML config file to a Kubernetes cluster to deploy the agent. The agent facilitates Nobl9 to import your service metrics.

# DISCLAIMER: This deployment description contains only the fields necessary for the purpose of this demo.
# It is not a ready-to-apply k8s deployment description, and the client_id and client_secret are only exemplary values.

apiVersion: v1
kind: Secret
metadata:
name: nobl9-agent-nobl9-azure-agent
namespace: default
type: Opaque
stringData:
azure_client_id: "<YOUR_AZURE_APPLICATION_CLIENT_ID>"
azure_client_secret: "<YOUR_AZURE_APPLICATION_CLIENT_SECRET>"
client_id: "<UNIQUE_CLIENT_ID>"
client_secret: "<UNIQUE_CLIENT_SECRET>"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nobl9-agent-nobl9-azure-agent
namespace: default
spec:
replicas: 1
selector:
matchLabels:
nobl9-agent-name: "azure-agent"
nobl9-agent-project: "default"
nobl9-agent-organization: "nobl9"
template:
metadata:
labels:
nobl9-agent-name: "azure-agent"
nobl9-agent-project: "default"
nobl9-agent-organization: "nobl9"
spec:
containers:
- name: agent-container
image: nobl9/agent:0.69.0-beta1
resources:
requests:
memory: "700Mi"
cpu: "0.2"
env:
- name: N9_CLIENT_ID
valueFrom:
secretKeyRef:
key: client_id
name: nobl9-agent-nobl9-azure-agent
- name: N9_AZURE_MONITOR_CLIENT_ID
valueFrom:
secretKeyRef:
key: azure_client_id
name: nobl9-agent-nobl9-azure-agent
- name: N9_AZURE_MONITOR_CLIENT_SECRET
valueFrom:
secretKeyRef:
key: azure_client_secret
name: nobl9-agent-nobl9-azure-agent
- name: N9_INTAKE_URL
value: "https://app.nobl9.com/api/input"
- name: N9_QUERYENGINE_URL
value: "https://app.nobl9.com/api/queryengine"
- name: N9_CLIENT_SECRET
valueFrom:
secretKeyRef:
key: client_secret
name: nobl9-agent-nobl9-azure-agent
- name: N9_AUTH_SERVER
value: "<UNIQUE_VALUE>"
- name: N9_OKTA_ORG_URL
value: "https://accounts.nobl9.com"
# The N9_METRICS_PORT is a variable specifying the port to which the /metrics and /health endpoints are exposed.
# The 9090 is the default value and can be changed.
# If you don’t want the metrics to be exposed, comment out or delete the N9_METRICS_PORT variable.
- name: N9_METRICS_PORT
value: "9090"

Creating SLOs with Azure Monitor​

Using Azure Monitor, you can create SLOs by entering standard threshold metric and ratio good or bad over total metrics

These methods are available in the UI and by applying YAML via sloctl.

Creating SLOs in the UI​

Follow the instructions below to create your SLOs with Azure Monitor in the UI:

  1. Navigate to Service Level Objectives.

  2. Click .
    The SLO wizard opens.
  3. In step 1, select the Service the SLO will be associated with.

  4. In step 2, select your Azure Monitor integration as the Data Source for your SLO.

  5. Modify the Period for Historical Data Retrieval, when necessary.
    By default, the historical data for Azure Monitor is retrieved for the 7-day period. You can extend this period up to the value you've set when adding the Azure Monitor data source.

  6. Specify the Resource you need to collect metrics for.
    Set the path to your required resource using the Subscription, Resource Group, and Resource fields. Make sure your selected resource holds the metrics you need to collect.

  7. Select Namespace in the list of available, when required.
    It's a way Azure Monitor groups similar metrics together.

  8. Configure Metric.

    1. You can choose either:

      • A Threshold metric where a single time series is evaluated against a threshold.

      • A Ratio metric that allows you to enter two-time series for comparison. You can choose one of the following metric types:

        • Good metric, meaning a ratio of good requests and total requests.
        • Bad metric, meaning a ratio of bad requests and total requests.
        1. Choose the Data Count Method for your ratio metric:
          • Non-incremental: counts incoming metric values one-by-one. So the resulting SLO graph is pike-shaped.
          • Incremental: counts the incoming metric values incrementally, adding every next value to previous values. It results in a constantly increasing SLO graph.
    2. Select the Metric Name in the list of available metrics.
      When you cannot find the required metric name in the list or the list displays the No matching data message, check if your selected resource holds the metric you need.

    3. Choose metric Aggregation to determine processing of the incoming data. The following aggregations are available:

      • Sum: the sum of all datapoints in an aggregation window
      • Average: the average of datapoints per aggregation window. Usually, it's Sum/Count
      • Maximum: the greatest datapoint value in an aggregation window
      • Minimum: the lowest datapoint value in an aggregation window
      • Count: the number of datapoints in an aggregation window. This type considers only how many data points are received, instead of datapoint values
    4. Select Dimensions to your metric configuration if any are applied to your chosen metric in Azure.
      You can select the Value in the list or enter the required one. Make sure your entered value is up to 255 characters (ASCII only).

  9. In step 3, define a Time Window for the SLO.

  10. In step 4, specify the Error Budget Calculation Method and your Objective(s).

  11. In step 5, add a Name, Description, and other details about your SLO. You can also select Alert Policies and Labels on this screen.

  12. Click Create SLO.

SLOs using Azure Monitor - YAML samples​

Here’s an example of Azure Monitor using a rawMetric (the threshold metric):

apiVersion: n9/v1alpha
kind: SLO
metadata:
name: azure-my-app-client-request-duration-rolling-hour-oc
project: azure-monitor-direct
spec:
budgetingMethod: Occurrences
description: "The time taken by the my-app client to send requests, in ms. The metric for the SLO uses Application Insights, therefore metricNamespace is provided."
indicator:
metricSource:
kind: Direct
name: azure-monitor-direct
service: my-app-direct
objectives:
- displayName: Fatal
name: objective-1
op: lte
rawMetric:
query:
azureMonitor:
resourceID: /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/<PROVIDER_NAMESPACE>/<PROVIDER_TYPE>/my-app
metricName: "random_get AvgDurationMs"
metricNamespace: azure.applicationinsights
aggregation: Avg
value: 1
target: 0.5
- displayName: Poor
name: objective-2
op: lte
rawMetric:
query:
azureMonitor:
resourceID: /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/<PROVIDER_NAMESPACE>/<PROVIDER_TYPE>/my-app
metricName: "random_get AvgDurationMs"
metricNamespace: azure.applicationinsights
aggregation: Avg
value: 0.5
target: 0.6
- displayName: Good
name: objective-3
op: lte
rawMetric:
query:
azureMonitor:
resourceID: /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/<PROVIDER_NAMESPACE>/<PROVIDER_TYPE>/my-app
metricName: "random_get AvgDurationMs"
metricNamespace: azure.applicationinsights
aggregation: Avg
value: 0.4
target: 0.7
- displayName: Excellent
name: objective-4
op: lte
rawMetric:
query:
azureMonitor:
resourceID: /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/<PROVIDER_NAMESPACE>/<PROVIDER_TYPE>/my-app
metricName: "random_get AvgDurationMs"
metricNamespace: azure.applicationinsights
aggregation: Avg
value: 0.3
target: 0.8
- displayName: Perfect
name: objective-5
op: lte
rawMetric:
query:
azureMonitor:
resourceID: /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/<PROVIDER_NAMESPACE>/<PROVIDER_TYPE>/my-app
metricName: "random_get AvgDurationMs"
metricNamespace: azure.applicationinsights
aggregation: Avg
value: 0.2
target: 0.9
timeWindows:
- count: 1
isRolling: true
unit: Hour

Querying the Azure Monitor API​

The Nobl9 agent leverages the Azure Monitor Data Plane API | Azure documentation to get data.

Agent metrics

Creating SLOs via Terraform

Creating agents via Terraform

The list of supported metrics with Azure Monitor | Azure documentation

Register an Azure application | Azure documentation

Monitoring Reader | Azure documentation

Find your Azure AD tenant | Azure documentation

Retrieve the resource ID | Azure documentation

Essentials | Azure documentation

Metric aggregation types | Azure documentation