You need to enable JavaScript to run this app.
Volcengine Managed Service for Prometheus

Volcengine Managed Service for Prometheus

Copy page
Download PDF
Alert center
Using vmalert to integrate with VMP for alerting
Copy page
Download PDF
Using vmalert to integrate with VMP for alerting
This topic describes how to use a Volcengine Managed Service for Prometheus (VMP) workspace as the data source to configure alerts in a self-built monitoring environment.​
Background​
In a self-built environment, vmalert can be used to configure alerts with a workspace as the data source and route the generated alerts to the self-built Alertmanager. The vmalert agent is fully compatible with the configuration files of alert rules of Prometheus.​
​​​
Prerequisites​
Procedure​
Step 1: Obtain the vmalert agent​
  • Obtain vmalert through binary​
  • Obtain vmutils-linux-amd64-vxxx.tar.gz from this site.​
  • Obtain vmalert through a container image​
  • Image address: https://hub.docker.com/r/victoriametrics/vmalert.​
Step 2: Start vmalert​
​
RuleFiles="rules/*" # The alert rule file directory, which supports wildcards and is compatible with Prometheus alert rule files.​
QueryURL=http://query.prometheus-cn-guangzhou.ivolces.com/workspaces/0df18f14****** # The VMP workspace query URL.​
WriteURL=http://write.prometheus-cn-guangzhou.ivolces.com/workspaces/0df18f14******/api/v1/write # The VMP workspace write URL.​
AUTH_USER=alarm # The username used for the basic authentication of the VMP workspace.​
AUTH_PSW=Alarm@test # The password used for the basic authentication of the VMP workspace.​
AlertmanagerURL=http://localhost:9093 # The self-managed Alertmanager URL.​
​
# Launch parameters​
./vmalert-prod -rule=$RuleFiles \​
-datasource.url=$QueryURL \​
-datasource.basicAuth.username=$AUTH_USER \​
-datasource.basicAuth.password=$AUTH_PSW \​
-notifier.url=$AlertmanagerURL \​
-remoteWrite.url=$WriteURL \​
-remoteWrite.disablePathAppend \​
-remoteWrite.basicAuth.username=$AUTH_USER \​
-remoteWrite.basicAuth.password=$AUTH_PSW \​
-remoteRead.url=$QueryURL \​
-remoteRead.basicAuth.username=$AUTH_USER \​
-remoteRead.basicAuth.password=$AUTH_PSW​
​
  • To specify more launch parameters, refer to the Configuration section of the vmalert topic.​
  • If you want to dynamically listen to changes in the rule configuration file, you need to add the following configuration:​
  • ​
    -configCheckInterval duration​
    Interval for checking for changes in '-rule' or '-notifier.config' files. By default, the checking is disabled. Send SIGHUP signal in order to force config check for changes.​
    ​
  • If you add global labels, the corresponding labels are added to alerts when the alerts are generated.​
  • ​
    -external.label=cluster=east-1​
    # Supports configuring multiple parameters repeatedly -external.label=a=1 -external.label=b=2​
    ​
  • Custom GeneratorURL of vmalert​
  • The default GeneratorURL generated by vmalert routes requests to /api/v1/groupID/alertID/status, which is different from Prometheus. If you need to specify a custom URL, add the following parameters to the vmalert launch parameters:​
  • ​
    -external.url="http://grafana.com" \​
    -external.alert.source="?expr={{ \$expr }}"​
    ​
  • The following figure shows the modified result.​
  • ​Image​​
Step 3: View the running status of vmalert​
  1. Query the vmalert endpoint.​
  • ​Image​​
  1. Access the endpoint to view the running status of vmalert.​
  • ​Image​​
​
Last updated: 2026.10.19 11:54:53