Creating a new visualization- Digital Transformation with IBM API Connect
When you create a new visualization, you are taking metrics and creating viewable graphics that provide insight. The following table presents the various visualization types available to choose from:
Table 15.1 – Available types of visualizations
As you can see in Table 15.1 there is a wide variety of graph types. Creating a visualization is essentially a two-step process. You first choose the graph/visualization type (bar chart, line chart, and so on) and then define the content and layout.
When you define the content and layout, you will use the Data tab to configure the metric and bucket objects. If you want to add a legend, you can use the Options tab.
For this introduction to creating new visualizations, you’ll choose one graphic that fits some of the API transactions you have run in the book. We’ll choose a Pie chart so we can choose the buckets to display segmentation of the total amount of API calls. A bucket is a collection of organized data that has been filtered (similar to a SQL GROUP BY statement).
Let’s start creating a new visualization:
- Navigate to the Analytics tab within a Catalog and then choose Visualize. Then click the + button to create a new visualization, as shown here:
Figure 15.27 – Creating a new visualization
After clicking the + button, you can select the type of visualization to create. Figure 15.28 shows a partial list of the available visualization types:
Figure 15.28 – Choosing the Pie visualization type
2. Choose the Pie visualization type and you will be presented with a panel to choose the type of data. This is shown in Figure 15.29:
Figure 15.29 – Choosing the source of data
In Figure 15.29, you see some predefined searches. These were created by API Connect. All Events are all the events that have been captured on the Gateway. You will choose All Events since it provides many event fields to choose from.
3. On the left side, under buckets, choose Split Slices as shown in Figure 15.30:
Figure 15.30 – Choosing type of bucket
4. When you chose Split Slices the panel changes and you will see an aggregation dropdown. Under the aggregation dropdown, choose Terms.
5. The dynamic nature of the panel will then re-draw the panel with a new set of fields. In the Field dropdown, you choose a field that appropriately represents your needs. Scroll down and choose client_ip.
6. Click the play button next to the Data and Options tabs to see the results.
Figure 15.31 shows the results from our limited sample size. Your results will be different. You may also have to change the time range to ensure you have the appropriate metrics.
Figure 15.31 – A new visualization based on data
The new visualization shows which client IP made API calls through the configured Gateway.
7. Let’s further enhance the same visualization by adding a sub-aggregation. Locate the Add sub-buckets button and click on it. This is shown in Figure 15.32:
Figure 15.32 – Add sub-buckets to do sub-aggregation
When you click Add sub-buckets, another entry field setup screen will appear so you can split the slice even more. You will need to click on Split Slices. The panel will refresh with more fields visible.
8. Click the Sub Aggregation dropdown and select Terms. Then choose app_id under the Field dropdown and click the play button again. See Figure 15.33:
Figure 15.33 – Adding a sub aggregation
9. Figure 15.34 now show your new sub-aggregation pie chart:
Figure 15.34 – Sub-aggregation example
This shows visually (by client IP) the various applications calling the same API. You have now completed creating a visualization. You can add it to a dashboard of your choice.
You can also save your new visualization. Figure 15.35 shows how this is done:
Figure 15.35 – Saving your visualization
You have now finished creating a custom visualization and dashboard. There will be many more opportunities to create and update your analytics.
Note
Metric aggregations give you the ability to calculate metrics based on values extracted from indexed fields. The Analytics service indexes the field received from the Gateway.
You can think of metrics as the y axis and buckets as the x axis.
Most likely in the real world, you will be making your visualization and dashboard changes in a lower environment, such as Developer or User Acceptance Testing. After all your hard work, you’ll want to ensure the same views are available in Production. The way you ensure the dashboards and visualization are available in those environments is by exporting and importing them. You’ll do that in the next section.