Looker
Structure
A model is a set of explores, an explore joins one or more views, a view is a table with dimensions and measures. Explores feed looks, a collection of looks is a dashboard.
- One project,
rebtel_production, with six models based on team structure:Product,Accounting,CRM,Operations,Finance,Acquisition - Views are dbt models plus derived tables made in
Looker - No LookML dashboards: users build looks and dashboards in the UI
- Data Dictionary and LookML diagram list all fields per explore
Model owners
| Model | Owner team |
|---|---|
| Accounting | Finance |
| Finance | Finance |
| Acquisition | Growth |
| CRM | Growth |
| Operations | Operations |
| Product | Product |
New explores go into the model of the team they serve. Ask in #team-data if unsure.
User management
Login is Google SSO at rebtel.eu.looker.com. New users start with no access.
Add a user
- Ask them to log in with Authenticate with Google
- Go to Admin > Users and open the user
- Assign the department group (e.g. Operations, Growth). Departments get
User(read and create) andGeminiroles. AddLooker Power Userfor theDeveloperrole (LookML) - Remove the
no accessrole - Save
Warning
Never grant roles directly to a user. Roles come from groups only.
Grant a role to a group
Create the group under Admin > Groups if needed. Then in Admin > Roles, edit the role, tick the group, and click Update Role.
Dormant and leaving users
- No login in 6 months (dashboard): move to the team's
(Dormant)group, since licences are limited per role. Reverse it when they need access again - Leaving Rebtel: set the account to disabled and remove all groups and roles
Public URL for a report
Public URLs need no login, so prefer email, SFTP or S3 sharing. If needed, fill the request form and message the data team.
Approval process and coding standards
Developers need a GitHub account in the Rebtel org and access to the data-team-looker repo. Always test in dev mode first.
Deploying LookML
- Commit with a descriptive message and Commit Changes & Push
- Click Open Pull Request, add a title and create the PR
- A message with the PR link lands in
#looker-approval - A data team admin reviews it in GitHub against the standards. If they pass and content validation is green, the admin merges and a message confirms it in
#looker-approval. Otherwise the developer fixes and resubmits
Enforced standards
CamelCasenames for new views, models and dashboards, in both the file code and file name, and identical- All views in the
Viewsfolder, with no duplicates - Explicit
includefor every view used in a model, e.g.include: "/Views/DimUser.view.lkml", not/**/*.view.lkml - Mandatory explore properties:
persist_with(e.g.dg_rebtel_production, 24h cache),label,group_label(the model name),description,hidden
explore: view_name {
persist_with: dg_rebtel_production
group_label: "Model name"
label: "Name shown in the UI"
description: "What this explore contains and what it is for"
hidden: no
}
Recommended conventions
- Keep the default IDE indentation
- When joining a view into an explore, only include required fields (
fields: [col1, col2]) - Dimensions first, measures last
- Add
descriptionand relevant attributes to fields - Label counts "Count of ..." and "Count of Distinct ...", and
yesnofields "Is ...?" or "Has ...?" - Samples: UserEngagementSummary view, Finance model
Content validation
Renaming or deleting a field can break looks and dashboards. A Content Validation CI runs on every PR (about a minute) and fails if downstream content breaks.
Warning
Tell the data team before fixing a content validation error. Production breaks for the affected content between the fix and the merge, and the window should be as short as possible.
To fix, open Content Validator, click Validate, select rebtel_production and all folders, then:
- Renamed field: click Replace and enter the new field name
- Deleted field: click Remove, then manually delete custom calculations and filters that still reference it (open the content, edit the tile, delete the red-underlined custom fields, run, save)
Repeat until your errors are gone, re-run the failed CI jobs, and tell the data team.
Create a new Looker model
Needed for a new structure or to split Snowflake compute for performance.
- Warehouse: create a new
Snowflakewarehouse with suspend after 1 minute of inactivity - Connection: under Admin > Connections, add a
Snowflakeconnection with: - Hostrebtel.eu-west-1.snowflakecomputing.com, port443, databaseDW4_PROD, schemaDBT- AuthenticationOAuth. Get the client ID and secret withselect system$show_oauth_client_secrets('LOOKER');- Max connections per node30, pool timeout600, JDBC parameterwarehouse=<new warehouse>- Verify SSL and connection pooling on, time zonesUTC- Test the connection until it is green - Model: in dev mode create the model with a
PascalCasename and place it in theModelsfolder. Use the new connection, include the necessary views, follow the standards, and delete migrated explores from the old model. Removepersist_withfor explores moved from the old label, sinceOAuthqueries run per user. Run the LookML validator and commit - Deploy: in dev mode go to Develop > Projects and configure the new model without changes. Then in Admin > Roles edit the
productionmodel set and tick the new model - Check what breaks: moving explores breaks content saved on them. Use Content Validator to confirm only expected content breaks (1000+ errors on a busy explore is fine)
- Announce in
#team-data, create the PR and merge once CI fails only as expected - Fix content: in Content Validator click Replace, choose type Model, enter the new model name. One click fixes all errors for an explore, repeat per explore
- Tell people the deploy is done and verify