Reporting Prometheus Data to AOM
If you have deployed the open-source Prometheus, go to 4.
This section describes how to configure the access code in the Prometheus configuration file and make the configuration effective.
Prerequisites
You have created an ECS.
Procedure
- Install and start Prometheus. For details, see Prometheus official documentation.
- Add an access code.
- Log in to the AOM console and choose Monitoring Center in the menu bar.
- In the navigation pane on the left, choose Global Configuration.
- In the right pane, click Add Access Code.
- In the dialog box that is displayed, click OK. The system automatically generates an access code.
- You can create up to two access codes for each project.
- An access code is an identity credential for calling APIs. Keep your access code secure.
- After the access code is added, click to view it. To delete the access code, click Delete in the Operation column. Deleted access codes cannot be recovered. Exercise caution when performing this operation.
- Obtain the configuration code for Prometheus remote write.
- Log in to the AOM console and choose Monitoring Center in the menu bar.
- In the navigation pane on the left, choose Prometheus Monitoring. In the instance list, click the name of the target Prometheus instance.
- Obtain the configuration code for Prometheus remote write.
- Log in to the ECS and locate the Prometheus configuration file.
Run the following command:
./prometheus --config.file=prometheus.yml
Open prometheus.yml and add the configuration code obtained in 3 to the end.
The following shows an example. You need to configure the italic part.
# my global config global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s). # Alertmanager configuration alerting: alertmanagers: - static_configs: - targets: # - alertmanager:9093 # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: # - "first_rules.yml" # - "second_rules.yml" # A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9090'] remote_write: - url: 'https://${POD_LB_IP}:8149/v1/{project_id}/{prometheus_instance}/push' tls_config: insecure_skip_verify: true bearer_token: 'SE**iH'
- Check the private domain name.
In the preceding example, data is reported through the intranet. Ensure that the host where Prometheus is located can resolve private domain names.
- Restart Prometheus.
- You can use Grafana to query metric data in AOM to check whether data is successfully reported after the preceding configuration is modified.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot