diff --git a/modules/ROOT/images/metrics_integration_azure_alerts.png b/modules/ROOT/images/metrics_integration_azure_alerts.png new file mode 100644 index 000000000..23b625b5f Binary files /dev/null and b/modules/ROOT/images/metrics_integration_azure_alerts.png differ diff --git a/modules/ROOT/images/metrics_integration_azure_cluster.png b/modules/ROOT/images/metrics_integration_azure_cluster.png new file mode 100644 index 000000000..b6bba1634 Binary files /dev/null and b/modules/ROOT/images/metrics_integration_azure_cluster.png differ diff --git a/modules/ROOT/images/metrics_integration_azure_monitor_workspace.png b/modules/ROOT/images/metrics_integration_azure_monitor_workspace.png new file mode 100644 index 000000000..25e621b42 Binary files /dev/null and b/modules/ROOT/images/metrics_integration_azure_monitor_workspace.png differ diff --git a/modules/ROOT/pages/platform/metrics-integration.adoc b/modules/ROOT/pages/platform/metrics-integration.adoc index e6ef37ec2..5258615a3 100644 --- a/modules/ROOT/pages/platform/metrics-integration.adoc +++ b/modules/ROOT/pages/platform/metrics-integration.adoc @@ -152,6 +152,65 @@ Open http://localhost:9090 and enter a metric name or expression in the search f Install and configure Grafana, adding the endpoint of the Prometheus instance configured in the previous step as a data source. You can create visualizations, dashboards, and alarms based on Neo4j metrics. +[aura-cmi-example-using-azure-monitor] +== Example using Azure Monitor workspace + +Pre-requisites: + +* Azure subscription +* Azure Kubernetes service with managed Prometheus enabled + +image::metrics_integration_azure_cluster.png[] + + +For the instance or tenant you want to monitor, use the link:https://console.neo4j.io/#metrics-integration[Metrics Integration^] in Neo4j Aura Console to create a Prometheus job configuration, as shown in <<_example_using_prometheus, Example using Prometheus>>. + +To access metrics from Azure Monitor, follow the steps described below to deploy the Prometheus job configuration in the Kubernetes Cluster. For details, see link:https://learn.microsoft.com/en-us/azure/azure-monitor/containers/prometheus-metrics-scrape-validate[Create and validate custom configuration file for Prometheus metrics in Azure Monitor^]. + +Connect a shell to the Azure Kubernetes service: + +[source,shell] +---- +az aks get-credentials --resource-group --name +---- + +Save the Prometheus job configuration in a file named `prometheus-config`. + +Optional: validate the Prometheus job configuration: + +[source,shell] +---- +for podname in $(kubectl get pods -l rsName=ama-metrics -n=kube-system -o json | jq -r '.items[].metadata.name'); do kubectl cp -n=kube-system "${podname}":/opt/promconfigvalidator ./promconfigvalidator; kubectl cp -n=kube-system "${podname}":/opt/microsoft/otelcollector/collector-config-template.yml ./collector-config-template.yml; chmod 500 promconfigvalidator; done + +./promconfigvalidator --config "prometheus-config" --otelTemplate "./collector-config-template.yml" +---- + +Deploy the Prometheus job configuration as a ConfigMap: + +[source,shell] +---- +kubectl create configmap ama-metrics-prometheus-config-node --from-file=prometheus-config -n kube-system +---- + +If everything is correct, the Prometheus job configuration will be merged with the default configuration and the `ama-metrics-node` linux daemonset will be restarted. After a few minutes, the metrics will be available in Azure Monitor. + +To build visualizations, navigate to the Azure Monitor workspace and select the "Monitoring / Metrics" navigation item. +You should be able to define queries and build visualizations based on the Neo4j metrics as well as save them to dashboards. + +[NOTE] +==== +Disable ad-blockers in the browser to ensure that the Azure Monitor workspace works correctly. + +Make sure you use the function "Add metric with editor" in the top-left corner above the chart, as shown in the screenshot below. +The function "Add metric with builder" doesn't show Neo4j metrics in the dropdown. +==== + +image::metrics_integration_azure_monitor_workspace.png[] + +To define alerts, select the "Alerts" navigation item and select "Prometheus rule groups" on the right. Create a new rule group and specify a Prometheus query to define the alert condition. + +image::metrics_integration_azure_monitor_workspace.png[] + [aura-cmi-example-using-datadog] == Example using Datadog