Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs to scrape and visualize CMI metrics with Azure Monitor #477

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions modules/ROOT/pages/platform/metrics-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <RESOURCE_GROUP> --name <CLUSTER_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

Expand Down