Reports
Contents
Configuring Reports
DreamFactory Enterprise uses the ELK stack (Elasticsearch, Logstash, Kibana) for reporting. API calls from instances are automatically logged by the ELK stack, and Kibana can be used as an user-friendly and flexible tool to visualize the metrics.
Introduction to Kibana
Go to the Kibana website, usually the URL is http://kibana.your-enterprise-domain.com.
The Discover tab shows all latest API calls, the parameters indexed and a bar chart with total API calls for the selected time period. The data can be filtered based on the indexed parameters on the left side. This method is useful for getting a detailed view of the data.
The Visualize tab can be used to visualize data as line charts, bar charts, pie charts etc. Select types and filters for X and Y axes to present the data in the prefered way. Charts (with the selected filters) can be saved and open it again later.
A dashboard is collection of visualizations. Stored visualizations (charts etc.) can be inserted into a dashboard, which is an easy way to present multiple charts, showing data in multiple ways, in the same screen.
Create New Dashboard
The following section shows how to create a simple dashboard with two charts, a bar chart and a pie chart. Both charts will show the Top 5 most active instances, the bar chart is a stacked bar chart showing daily API calls, and the pie chart shows how the API calls are distributed between the Top 5 instances.
Create Visualization
Follow these 10 steps to create a new visualization (bar chart):
- Go to Visualize and choose “Vertical bar chart”
- Choose “From a new search” as a new search source
- A bar chart without any filters will be shown. As default the last 15 minutes is shown, expand the timespan selection by clicking the in the top right corner (where selected timespan is shown), and choose “Last 7 days”. Collapse the timespan selection again.
- The Y-axis is Count by default, no change needed.
- Start setting up the X-axis filter by choosing X-axis as bucket type in the left side of the screen.
- Choose “Date Histogram” as aggregation, @timestamp as field and Daily as interval. Click Apply to update the chart, which now will show API calls (total) across all instances.
- Click Add Sub Aggregation to add another aggregation.
- Choose “Split Bars” as bucket type, and “Terms” as sub aggregation.
- Choose “dfe.instance_id” under String, choose “Top” as Order, and set Size to 10. Click Apply to update the chart.
- Click Save Visualization in the top menu, give the chart a title and click Save. The visualization/chart can now be opened again at any time, and be added to a dashboard.
Creating a pie chart is very similar:
- Go to Visualize and choose “Pie chart”
- Choose “From a new search” as a new search source
- A pie chart without any filters will be shown. As default the last 15 minutes is shown, expand the timespan selection by clicking the in the top right corner (where selected timespan is shown), and choose “Last 7 days”. Collapse the timespan selection again.
- The Slice Size is Count by default, no change needed.
- Start setting up the slices by choosing Split Slices as bucket type in the left side of the screen.
- Choose “Terms” as aggregation.
- Choose “dfe.instance_id” under String as Field, choose “Top” as Order, and set Size to 10. Click Apply to update the chart, which now shows how API calls are distributed between instances.
- Click Save Visualization in the top menu, give the chart a title and click Save. The visualization/chart can now be opened again at any time, and be added to a dashboard.
Create Dashboard
The two visualizations (charts) can now be added to a dashboard. Follow these steps to create a new dashboard:
- Go to Dashboard
- Click the + icon (Add Visualization) in the top menu
- Select one or multiple visualizations (charts), in this case the bar chart and pie chart just created.
- Drag and resize the visualizations to position them
- As default the last 15 minutes is shown, expand the timespan selection by clicking the in the top right corner (where selected timespan is shown), and choose “Last 7 days”.
- Click Save Dashboard in the top menu, give the chart a title and click Save. The dashboard can now be opened again at any time.
Embed
All the settings are stored as URL parameters, so the visualizations and dashboards can easily be embedded and shared. Click the Share Visualization to get either the link to the chart, or to get the HTML iframe script for embedding.
If the charts are embedded, the top menu etc. will not be visible. The menu and other controls are hidden by adding “embed” as an URL parameter.
Security
Kibana is not protected by default during installation and can be used by anyone with the URL. It is highly recommended to password protect Kibana, and one way to do it is by adding webserver authentication for the URL.
For NGINX it can be done by creating a user, and adding the following to the website configuration:
auth_basic "Restricted"; auth_basic_user_file /etc/nginx/conf.d/kibana.fabric.htpasswd;
This will force user authentication and the user will be prompted for username and password.
Authentication may be different for other web servers.