Insights configuration#
Insights requires some additional configuration before you can access its features in the Starburst Enterprise web UI.
Requirements#
Insights requires:
A configured and operational backend service.
A valid Starburst Enterprise license.
Configuration properties on the coordinator, described next.
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.
Property name |
Description |
|---|---|
|
Enable the query history functionality. Defaults to |
|
Enable the usage metrics functionality. Defaults to |
|
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. |
|
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_logbiac_access_logbiac_audit_sessioncompleted_queriesquery_user_groupquery_tablesquery_viewsquery_planjob_historydata_product_completed_querydata_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.
Property name |
Description |
Example |
|---|---|---|
|
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
|
|
|
Schedule to start sweep in unix |
|
|
Specifies the timezone in TZDB format to be used by sweep schedule. If omitted, the system timezone is used. |
|
|
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. |
|
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.
Property name |
Description |
|---|---|
|
Enable the upload of query history records to object storage. Defaults to
|
|
Name of the bucket that receives the records. Must be a valid S3 bucket name. Required when the upload is enabled. |
|
URI scheme for the bucket. Supported values are |
|
Optional prefix for the object keys. Must consist of segments that are
safe for S3 keys, separated by |
|
Endpoint URL of the object storage service. Use an HTTPS endpoint in production. |
|
Region of the bucket. |
|
Use path-style access for all requests to the bucket. Set to |
|
Access key for the bucket. Must be set together with
|
|
Secret key for the bucket. Must be set together with
|
|
Server-side encryption type for uploaded objects. Supported values are
|
|
ID of the AWS KMS key used for encryption. Allowed only when
|
|
Maximum number of retries for a failed request to the object storage.
Defaults to |
|
Maximum duration to wait for a connection to the
object storage. Defaults to |
|
Maximum duration to wait for data from the object
storage after a connection is established. Defaults to |
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-prefixis the value of the optional key prefix property. If you omit the property, the key starts with the cluster ID.clusterIdis the value of thenode.environmentproperty.yyyy,MM, andddare the year, month, and day of the end time of the query in UTC.queryIdis 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
NONEserver-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
KMSencryption type, every user or application that reads the files also needs permission to decrypt with the KMS key.The
insights.data-retention.max-ageproperty 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.
Property name |
Description |
|---|---|
|
Maximum number of connections to the backend service database in the
connection pool in SEP. Default is |
|
Minimum number of connections to the backend service database in the
connection pool in SEP. Default is |
|
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 |
|
How often query and cluster metrics are sampled for the overview page.
Default is |
|
How often query and cluster resource metrics are persisted for the
cluster history page. Default is |
|
The number of sample data points to store in memory for the graphs on
the overview page. Default is |
|
Default time range of the After date filter on the query
overview page. Enter a duration such as |
|
When explicitly set to |
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>
Property name |
Description |
|---|---|
|
Enables CSRF protection in the Starburst Enterprise web UI. When set to |
|
The secret used to generate CSRF tokens. By default, a new random secret is generated on each server restart. |