From 4f2561102be2a303bdf8734f910cda0a9f460786 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:31:48 +0800 Subject: [PATCH] LM monitoring --- .../3.license-manager.md | 58 +++++++++++++++++++ .../3.0.deploy-lm.md | 4 ++ 2 files changed, 62 insertions(+) diff --git a/docs-2.0/9.about-license/2.license-management-suite/3.license-manager.md b/docs-2.0/9.about-license/2.license-management-suite/3.license-manager.md index a9d31940235..fb0908d36dd 100644 --- a/docs-2.0/9.about-license/2.license-management-suite/3.license-manager.md +++ b/docs-2.0/9.about-license/2.license-management-suite/3.license-manager.md @@ -238,6 +238,64 @@ For a database administrator (DBA), there may be a need to view the license info - ``: The IP address of the host where the specified LM is located. +## Monitor LM + +### Monitor LM status + +You can use monitoring tools to monitor the status of the LM service. + +- Use Dashboard Enterprise + + When LM is running normally, the **License Manager** page displays the status of LM as **Running**, otherwise, it displays **Exited**. For more information, see [License Manager](../../nebula-dashboard-ent/11.license-manager.md). + +- Use Prometheus + + You need to configure the Prometheus server before monitoring LM. + + Add the following configuration to the Prometheus configuration file. For more information about the Prometheus configuration file, see [Prometheus Configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration). + + ```yaml + ... + - job_name: license-manager + scrape_interval: 15s # The interval for pulling data. + metrics_path: /metrics # The monitoring metrics path of LM, which is `/metrics`. + scheme: http # The protocol type of LM, which is HTTP. + static_configs: # The address and port of LM (default 9119). + - targets: + - [] + ... + ``` + + After the configuration is complete, you can monitor the status of LM through its built-in metric `up`. If the value is `1`, it means that LM is running normally; if the value is `0`, it means that LM is not running. To view the metric, enter `up` in the Prometheus query box as shown below: + + ``` + up{instance="", job="job_name"} + ``` + + - ``: The IP address and port of LM. + - `job_name`: The name of the job. + + For example, up{instance="192.168.8.xxx:9119", job="license-manager"}. + + !!! note + + By default, LM uses port `9119`. If you need to change the port number, you can modify the value of the `Port` field in the LM configuration file above, or modify the value of `port` in the YAML file of [Deploying LM in K8s](../../nebula-operator/3.deploy-nebula-graph-cluster/3.0.deploy-lm.md). + + + +### View LM metrics + +You can view the built-in metrics of LM through the following URL: + +``` +http:///metrics +``` + +- ``: The IP address and port of LM. + +You can also collect LM metrics data through monitoring tools. To use Prometheus, you need to configure the Prometheus server before collecting LM metrics. For more information, see the above section **Monitor LM status**. + + ## Configure connection to LM ### Configure LM in NebulaGraph diff --git a/docs-2.0/nebula-operator/3.deploy-nebula-graph-cluster/3.0.deploy-lm.md b/docs-2.0/nebula-operator/3.deploy-nebula-graph-cluster/3.0.deploy-lm.md index 848d3e75757..cd345161d49 100644 --- a/docs-2.0/nebula-operator/3.deploy-nebula-graph-cluster/3.0.deploy-lm.md +++ b/docs-2.0/nebula-operator/3.deploy-nebula-graph-cluster/3.0.deploy-lm.md @@ -125,6 +125,10 @@ For information on how to deploy LM on a machine outside the K8s cluster, see [L kubectl -n nebula-license-manager get pods ``` +## Monitor LM + +You can use monitoring tools, such as Dashboard Enterprise or Prometheus, to monitor the running status and metrics of LM. For more information, see [Monitor LM](../../9.about-license/2.license-management-suite/3.license-manager.md). + ## Use LM to manage the license - For commands related to using LM deployed outside the K8s cluster to manage License, see [License Manager](../../9.about-license/2.license-management-suite/3.license-manager.md).