Skip to content

Extend service instance Dashboard

Amit Malav edited this page Feb 5, 2018 · 5 revisions

How to extend service instance dashboard

Service Fabrik provides a pre configured default dashboard for service instances, the link to the same can be found in service instance description.

cf service blueprint-instance

Service instance: blueprint-instance
Service: blueprint
Bound apps:
Tags:
Plan: v1.0-small
Description: Blueprint service for internal development, testing, and documentation purposes of the Service Fabrik
Documentation url: https://sap.com/
Dashboard: https://service-fabrik-broker.bosh-lite.com/manage/instances/24731fb8-7b84-4f57-914f-c3d55d793dd4/bc158c9a-7934-401e-94ab-057082a5073e/5e41a60a-c9ea-4523-8416-d545fc4dbfc5

Service information section of dashboard looks like following by default

Missing

This section of service instance dashboard can be configured to have extra rows in each panel. Let's add Additional information in each panel. To do that, we will have to write a dashboard template and specify added fields inside template. Let's write a template example.

<%
const plan_manager = plan.manager.name;
const instance_create_time = instance.metadata.created_at;
%>

service:
  Additional: 'This is template example'

plan:
  Manager: <%= plan_manager %>
  URL: 'protocol://example.com'

service_instance:
  Creation Time: <%= instance_create_time %>

Above template will add 'Additional' row in service panel, 'Manager' and 'URL' in plan panel, 'Creation Time' in service_instance panel.

Save this template file as /config/templates/blueprint-dashboard.yml.ejs Apart from this we will also have to add dashboard_template node in service plan in config/settings.yml

plan:
  manager:
    settings:
      dashboard_template: <%= base64_template('blueprint-dashboard') %>

Now, added fields can be seen in updated dashboard

Missing