Insights configuration#

Insights requires some additional configuration before you can access its features in the Starburst Enterprise web UI.

Requirements#

Insights requires:

Note

Usage metrics are surfaced and documented in Insights. However, usage metrics continue to be collected even when Insights is disabled.

Insights is configured in the config.properties file on the coordinator only. To avoid startup failures, do not add Insights properties to worker configuration files.

General configuration properties#

You must explicitly enable Insights to use the persisted data in the backend service database with insights.persistence-enabled=true. Persisted data provides the information needed for the query and cluster history features. Additionally, you can configure Insights to persist cluster metrics to the same database with the insights.metrics-persistence-enabled property.

For deployments using built-in access control, usage metrics and unrestricted access to query history are controlled through roles and privileges in the built-in access control system.

Warning

Do not use the deprecated insights.authorized-users and insights.authorized-groups with SEP’s built-in access control, as they provide administrative access outside of built-in access control. Use the built-in access control configuration properties instead.

Deployments using supported third-party access control integrations such as Ranger must use the UI access controls and configuration properties available in SEP’s built-in access control to control which users can access specific UI elements if that level of control is desired.

For legacy deployments, usage metrics and unrestricted access to query history are controlled by the deprecated insights.authorized-users and insights.authorized-groups configuration properties. You must assign specific authorized users and/or groups, or enable everyone with a wildcard. If a user has not been granted access, they can only review queries made by that user account. See example authorization configurations in Authorization examples.

Cluster and query history-related configuration properties#

Property name

Description

insights.persistence-enabled

Enable the query history functionality. Defaults to false.

insights.metrics-persistence-enabled

Enable the usage metrics functionality. Defaults to false.

insights.authorized-users

Regular expression to match user names granted unrestricted access to the query history and to the usage metrics feature. See the examples for more details. Do not use if implementing SEP’s built-in access control. Use the built-in access control configuration properties instead.

insights.authorized-groups

Regular expression to match user groups granted unrestricted access to the query history and to the usage metrics feature. See the examples for more details. Do not use if implementing SEP’s built-in access control. Use the built-in access control configuration properties instead.

The following example config.properties configuration enables Insights on a coordinator that already has the backend service configured:

insights.persistence-enabled=true
insights.metrics-persistence-enabled=true

Data retention#

Insights’s data retention configuration properties allow you to define intervals at which SEP performs a sweep to purge history, as well as the range of data purged, from the following tables:

  • biac_change_log

  • biac_access_log

  • biac_audit_session

  • completed_queries

  • query_user_group

  • query_tables

  • query_views

  • query_plan

  • job_history

  • data_product_completed_query

  • data_product_completed_query_relation

Usage metrics, cluster metrics, query editor tab information, node anomalies, and recommendations are not purged.

The data_product_completed_query and data_product_completed_query_relation tables store data product query history. When data retention is not configured, SEP purges these tables after 60 days by default. This purge prevents the tables from growing indefinitely. When you set insights.data-retention.max-age, only these two tables use that value instead of the 60-day default. Data retention is disabled by default. To enable it you must set insights.data-retention.max-age.

Data product usage statistics, for example the 7-day and 30-day query and user counts shown for each data product, come from data_product_completed_query. If you set insights.data-retention.max-age to fewer than 30 days, SEP purges the underlying rows before the statistics window closes, and the statistics are undercounted. To keep data product usage statistics accurate, set insights.data-retention.max-age to 30 days or more.

Retention policy for the built-in access control audit logs is the same as for the query history because audit logs maintain a reference to the query that triggered them. If you need to retain audit logs that would otherwise be deleted by the data retention configuration, download the access logs and change logs as CSV files.

Data retention policies are disabled by default, so that no data is purged automatically, with the exception of the data_product_completed_query and data_product_completed_query_relation tables. If data retention policies are enabled, SEP logs all deletions.

Note

Data retention does not apply to query history records that SEP uploads to object storage. Configure a lifecycle expiration rule on the bucket or prefix to purge those objects.

Insights data retention configuration properties#

Property name

Description

Example

insights.data-retention.max-age

Data older than this threshold is purged. Can be any SEP duration value, but is always rounded up to an integer number of days. If omitted, no data is deleted, with the exception of the data_product_completed_query and data_product_completed_query_relation tables. When this property is unset, SEP purges these tables every 60 days by default.

insights.data-retention.max-age=180d

insights.data-retention.sweep-schedule

Schedule to start sweep in unix cron format. If omitted, 0 0 * * * is used (each day at midnight).

insights.data-retention.sweep-schedule=0 3 * * *

insights.data-retention.sweep-schedule-timezone

Specifies the timezone in TZDB format to be used by sweep schedule. If omitted, the system timezone is used.

insights.data-retention.sweep-schedule-timezone=America/New_York

insights.data-retention.sweep-max-duration

Maximum sweep duration. Can be used along with sweep schedule to limit the time interval when data deletion occurs. Can be any SEP duration value. If omitted, or if the configured value exceeds time until the next schedule, the sweep runs until the next scheduled sweep.

insights.data-retention.sweep-max-duration=3h

Query history upload to object storage#

SEP can upload the history record of each completed query to S3-compatible object storage. SEP writes each record as an Avro file. Use these files to retain query history outside of the backend service database, or to analyze it with other tools.

The feature is disabled by default and requires a valid license. Configure it in the config.properties file on the coordinator only.

Query history object storage configuration properties#

Property name

Description

insights.query-history.object-storage.enabled

Enable the upload of query history records to object storage. Defaults to false.

insights.query-history.object-storage.bucket

Name of the bucket that receives the records. Must be a valid S3 bucket name. Required when the upload is enabled.

insights.query-history.object-storage.bucket-scheme

URI scheme for the bucket. Supported values are s3, s3a, and s3n. Defaults to s3.

insights.query-history.object-storage.key-prefix

Optional prefix for the object keys. Must consist of segments that are safe for S3 keys, separated by /. The prefix must not start or end with /, and must not contain repeated / characters.

insights.query-history.object-storage.s3.endpoint

Endpoint URL of the object storage service. Use an HTTPS endpoint in production.

insights.query-history.object-storage.s3.region

Region of the bucket.

insights.query-history.object-storage.s3.path-style-access

Use path-style access for all requests to the bucket. Set to true for some S3-compatible storage systems, such as MinIO. Defaults to false.

insights.query-history.object-storage.s3.aws-access-key

Access key for the bucket. Must be set together with insights.query-history.object-storage.s3.aws-secret-key. SEP treats the value as sensitive.

insights.query-history.object-storage.s3.aws-secret-key

Secret key for the bucket. Must be set together with insights.query-history.object-storage.s3.aws-access-key. SEP treats the value as sensitive.

insights.query-history.object-storage.s3.sse.type

Server-side encryption type for uploaded objects. Supported values are NONE, S3, and KMS. Defaults to NONE.

insights.query-history.object-storage.s3.sse.kms-key-id

ID of the AWS KMS key used for encryption. Allowed only when insights.query-history.object-storage.s3.sse.type is KMS.

insights.query-history.object-storage.s3.max-error-retries

Maximum number of retries for a failed request to the object storage. Defaults to 3.

insights.query-history.object-storage.s3.connect-timeout

Maximum duration to wait for a connection to the object storage. Defaults to 5s.

insights.query-history.object-storage.s3.socket-timeout

Maximum duration to wait for data from the object storage after a connection is established. Defaults to 10s.

The following example enables the upload to a bucket on an S3-compatible storage system:

insights.query-history.object-storage.enabled=true
insights.query-history.object-storage.bucket=query-history
insights.query-history.object-storage.key-prefix=sep
insights.query-history.object-storage.s3.endpoint=https://storage.example.com
insights.query-history.object-storage.s3.region=us-east-1
insights.query-history.object-storage.s3.path-style-access=true

Object layout#

SEP writes one object for each query. The object key uses the following format:

{key-prefix}/{clusterId}/{yyyy}/{MM}/{dd}/{queryId}.avro
  • key-prefix is the value of the optional key prefix property. If you omit the property, the key starts with the cluster ID.

  • clusterId is the value of the node.environment property.

  • yyyy, MM, and dd are the year, month, and day of the end time of the query in UTC.

  • queryId is the ID of the query.

The account ID and role ID fields in each record are empty.

Upload behavior#

Uploads are asynchronous and best-effort. If an upload fails, SEP logs a warning, and the query is not affected. When the coordinator shuts down, it waits for queued uploads to finish. The retry and timeout properties limit how long the coordinator waits.

Security and retention#

Consider the following when you enable the upload:

  • The records contain query text, user names, and client addresses. Use an HTTPS endpoint in production, and restrict access to the bucket.

  • With the default NONE server-side encryption type, the default encryption of the bucket applies. AWS S3 always encrypts new objects. Other S3-compatible storage systems might require you to configure encryption on the bucket, or to set the server-side encryption type property.

  • With the KMS encryption type, every user or application that reads the files also needs permission to decrypt with the KMS key.

  • The insights.data-retention.max-age property does not apply to the uploaded objects. Add a lifecycle expiration rule to the bucket or prefix to remove old records.

Miscellaneous configuration properties#

The following optional properties allow you to fine-tune the functionality and behavior of Insights.

Miscellaneous Insights configuration properties#

Property name

Description

insights.jdbc.connection-pool.max-size

Maximum number of connections to the backend service database in the connection pool in SEP. Default is 10.

insights.jdbc.connection-pool.min-size

Minimum number of connections to the backend service database in the connection pool in SEP. Default is 1.

insights.query-history.timeout

Maximum duration for each backend service database query that loads data for the query overview and cluster history pages. Longer queries are canceled, and the page shows an error. Must be between 1s and 1h. Default is 1m.

insights.metrics-collection-interval

How often query and cluster metrics are sampled for the overview page. Default is 15s.

insights.metrics-persistence-interval

How often query and cluster resource metrics are persisted for the cluster history page. Default is 60s.

insights.max-samples

The number of sample data points to store in memory for the graphs on the overview page. Default is 120.

insights.query-history.range.default

Default time range of the After date filter on the query overview page. Enter a duration such as 12h. The minimum value is 1m. Default is 1d.

insights.query-results-download-enabled

When explicitly set to false, hides all download options in the query editor and its result sets. Defaults to true.

Instructions for configuring Insights for Kubernetes deployments are available in the Kubernetes documentation.

CSFR protection#

To enhance security for the Starburst Enterprise web UI when using password, OAuth2, and SAML authentication mechanisms, you can enable an optional Cross-Site Request Forgery (CSRF) protection feature.

When enabled, the Starburst Enterprise web UI includes a CSRF token in all POST, PUT, DELETE, and PATCH requests. The coordinator verifies these tokens to ensure requests originate from the UI itself, preventing malicious cross-origin requests.

To configure CSRF protection, add the following properties to the coordinator’s config.properties file:

insights.csrf.enabled=true
insights.csrf.secret=<your-secure-random-secret>
CSRF configuration properties#

Property name

Description

insights.csrf.enabled

Enables CSRF protection in the Starburst Enterprise web UI. When set to true, a valid CSRF token is required for all modifying requests (POST, PUT, DELETE, PATCH). This protection applies only when using password, OAuth2, or SAML authentication methods. Defaults to false.

insights.csrf.secret

The secret used to generate CSRF tokens. By default, a new random secret is generated on each server restart.

Authorization examples#

You can grant unrestricted access to the Insights query overview and query history features, using regular expressions for authorized users and groups.

Note

The insights.* properties described on this page only manage access to the following panes in the Insights section of the Starburst Enterprise web UI:

  • Query overview (and the Query details sub-pages for each query)

  • Usage metrics

The properties that manage access to the built-in access control features are independent. They are managed with the starburst.access-control.* properties described in Access control users and groups.

To grant everyone unrestricted access to the Insights features noted previously, use the expression .*, which matches any user name.

insights.authorized-users=.*

To grant unrestricted access to users alice, bob, and charlie, use a regular expression with the pipe (|) separator:

insights.authorized-users=alice|bob|charlie

User names are provided from the cluster’s configured authentication system. Only PASSWORD-based authentication types are supported.

To grant unrestricted access to all users in the admin and super groups, include the following:

insights.authorized-groups=admin|super

Groups must be configured with Group mapping or LDAP group provider in etc/group-provider.properties.

You can also configure specific users at the same time you configure groups. For example the following setup grants unrestricted access to any user in the admin group, and also to the user alice, even if she is not a member of the admin group:

insights.authorized-users=alice
insights.authorized-groups=admin

If both insights.authorized-users and insights.authorized-groups are empty, no user has access to the Insights usage metrics and query history features.