Prometheus Datasets
Prerequisites
The data source to be connected has been created. For details, see Prometheus Data Sources.
Creating a Prometheus Dataset
- Log in to Huawei Cloud Astro Canvas by referring to Logging In to Huawei Cloud Astro Canvas.
- Choose Data Center from the main menu.
- Choose Datasets > All in the navigation pane.
- On the Dataset Management page, click Create.
- Set the dataset name, specify the data type, data source, and folder, and click Save.
Figure 1 Creating a Prometheus dataset
- Dataset Name: A dataset is identified by its name. The name contains 1 to 60 characters, including letters, digits, and underscores (_).
- Data Type: Select Prometheus.
- Data Source: Select the data source created in Prometheus Data Sources.
- Folder: Set the folder for storing the dataset. You can select the folder created in (Optional) Creating a Folder or click New Folder.
- Owner: Creator of the dataset.
- Description: Description of the new dataset, which is usually the function of the dataset.
- Configure dataset parameters.
Figure 2 Configuring dataset parameters
- Query type: The type of data to be queried, such as data within a query time range or instantaneous data.
- Query period: Set the query period as either a time segment or a specific time point.
- Maximum number of sampling points: The number of data records to be queried, ranging from 1 to 10,000. For example, if the query period is set to the last 3 hours and the maximum number of sampling points is 100, one data point will be returned every 108 seconds (calculated as 3 hours × 60 minutes × 60 seconds ÷ 100).
Figure 3 Querying data of the last three hours
- Minimum interval: The shortest time gap between data points, with a value range of 1 to 40,000,000.
- Query configuration: Click Add Query to add a PromQL query. Up to eight PromQL queries can be added. Variables can also be set.
- Test API: API testing. After you click Test API, the output is displayed in the sample packet area.
- Sample packet: Sample response packet of the API. The metadata structure of the dataset is determined by the data structure of the sample response packet after the packet is processed by the transformer.
- Converter: You can click Create to create a converter or use the preset PromAPIBuiltinDT to convert data.
- Click Save.
Using the Dataset in Widgets
- Return to the Projects page.
- Go to the canvas page and drag required widgets (for example, multi-line chart) to the canvas.
Figure 4 Dragging the multiple line chart widget to the canvas
- Select the widget and click
.
- Select Dataset from the Data Type drop-down list and select the dataset created in section Creating a Prometheus Dataset.
- Set global variables.
Global variables can be regarded as parameter variables and used to control parameter transfer between widgets for interactions such as diagram and table association and field customization.
- In Widget Preview, select the form fields to be displayed by dragging them from the left column to the right column, and click Save.
Figure 5 Dragging a field to the axis
- Form field: Data recorded in Creating a Prometheus Dataset.
- Configuration: Drag the required fields from the form field area to the X-axis data, Y-axis data, and series.
- Refresh cycle: Interval for obtaining data from the HTTP connector. Default is 0, meaning the data is obtained only once.
- Data sharing: When enabled, multiple widgets calling the same bridge URL request will share the result data.
- Click
in the upper part of the page to save the settings.
- Click
to preview.
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