This guide outlines the complete release flow for Luzmo dashboards — from initial development to production — using groups, collections, and environment-specific API tokens to manage access to dashboards and datasets. It also makes use of the dashboard versioning mechanism to allow validating changes to existing dashboards in your application's different development environments before publishing it to production.
To achieve a robust setup for your application's different development environments (i.e. where your development, testing, and releasing process occurs), the following Luzmo features can be used:
By using a dashboard's version history functionality (see here), you can "publish" a certain dashboard version to a specific environment (e.g. production) and keep editing the dashboard in Luzmo's dashboard editor, without changes being immediately reflected in your production environment.
When embedding a dashboard using an Authorization token, the production dashboard version would by default be shown if no environment property is specified (by specifying this property, you can control which dashboard version is shown in which development environment of your application). For example, if you want to embed the latest version of a dashboard in your testing environment, you can do so by specifying environment: null when requesting the token:
client.create('authorization', {
type: 'embed',
access: { ... },
...,
environment: null
});
Within the dashboard editor's dashboard version history, you can "publish" a dashboard version to one of the environment tags (i.e. production, acceptance, or development); each environment tag can only be associated to a single dashboard version per dashboard. If a certain environment specified in the Authorization token does not exist for an embedded dashboard, it will show the latest dashboard version. There are five acceptable states for the 'environment' property:
null - load latest version of dashboard'production' (Default value if not specified)'acceptance''qa' (currently only available via API)'development'By using our API, you can also set the different environment property values mentioned above on a specific dashboard version (i.e. securableVersion) using the following steps:
client.get('securableversion', {
where: {
securable_id: "<id of dashboard I want to update the version of>"
},
attributes: [ "created_at", "name", "updated_at", "environment" ],
order: [
[ "created_at", "desc" ]
]
});
Note: when you change the dashboard name, it changes the securableVersion name as well. If you hide the name in your dashboard's settings, that is a potential easy reference point. Otherwise, you might just want to look at the created_at property.
Note that a specific environment should only be associated to one dashboard version per dashboard: make sure to remove the environment from a previous dashboard version if it had the same environment associated with it (see step 3 below).
client.update('securableversion', "<id of a securable version>", {
"environment": "<production | acceptance | development | qa>"
});
client.update('securableversion', "<id of a securable version>", {
"environment": null
});
The process from a data source to Embedded Luzmo dashboards generally follows typically looks as follows from a high-level point of view (also see the "Setup" section below):
If you have environment-specific data sources for each development environment of your application (e.g. both a "staging" and a "production" database), it may seem at first glance that you will need to repeat the first 4 steps for each environment you'd like to support. However, in Luzmo it's possible to create what we call "Templated" dashboards based on datasets from one Connection in Luzmo (e.g. the production or demo database), and then dynamically override the authentication properties of that Connection (host URL, username, password, schema, ...) when requesting an Embed token for your application's (development) users.
In this way, each environment will use the same template dashboard, but the data will be populated from the environment-specific data source. Be aware that (at least) the same table schema (e.g column names and types) must be present in the overridden data source, otherwise you might experience query failures when embedding a dashboard (e.g. due to trying to query a column that doesn't exist in the overridden data source)!
Refer to the "Making a XXX Connection article of your specific data source for more info on how to do account_overrides.
The Luzmo application (https://app.luzmo.com, https://app.us.luzmo.com, or your VPC-specific Luzmo app URL) can be considered as your internal dashboard development environment. Access management is organized via user groups, which you can create and manage in your Profile settings:
Each environment (Dev, Staging, Production) has a dedicated Luzmo user in the Embed Group, which can be considered "Service accounts". These users:
Typically handled by the Data Group:
owner access to the Data Group to allow your "data" colleagues to use and maintain the connectionowner access) -- allows other internal "data" users to maintain this datasetuse access) -- allows your internal "designer" users to use the dataset in their dashboards, but not modify/share/delete the dataset itselfowner access) -- allows the "developer" users (i.e. service accounts) to provide access to this dataset in the Embed Authorization requestHandled by the Designers Group:
owner access to:Each "Environment-specific" Luzmo user uses its API token to manage any datasets and datasets that should be accessible in that environment, as well as to generate Embed tokens where you can:
You can use the Dev Embed User’s API token to generate Embed Authorization tokens that receive access to the Development collection. To point towards the development database, you can use the account_overrides property in the Authorization request; to point towards the development version of your dashboard, you can set the environment Authorization property to development if you published a dashboard version to development, or null to point towards the latest dashboard version.
After setting up the embedded dashboard in your local frontend environment, you should be able to see the development version at e.g. http://localhost:8080/analytics.
Once your dashboard has been successfully tested in your Develeopment environment:
acceptance (via our UI / via API)environment set to acceptanceaccount_overrides to redirect Luzmo queries dynamically to your Staging data sourceAfter successful validating your embedded dashboards in staging:
production (via our UI / via API)environment set to production (or not specified - the default value is production)account_overrides to redirect Luzmo queries dynamically to your Production data sourceYour embedded dashboards are now available in your Production environment at e.g. https://yourapp.com/analytics 🎉