@@ -107,6 +107,7 @@ Cube Cloud deployment should export their logs:
107107| ` refresh-scheduler ` | Logs of the refresh worker |
108108| ` warmup-job ` | Logs of the [ pre-aggregation warm-up] [ ref-preagg-warmup ] |
109109| ` cubestore ` | Logs of Cube Store |
110+ | ` query-history ` | [ Query History export] ( #query-history-export ) |
110111
111112Example configuration for exporting logs to
112113[ Datadog] [ vector-docs-sinks-datadog ] :
@@ -274,6 +275,61 @@ You can also customize the user name and password for `prometheus_exporter` by
274275setting ` CUBE_CLOUD_MONITORING_METRICS_USER ` and
275276` CUBE_CLOUD_MONITORING_METRICS_PASSWORD ` environment variables, respectively.
276277
278+ ## Query History export
279+
280+ With Query History export, you can bring [ Query History] [ ref-query-history ] data to an
281+ external monitoring solution for further analysis, for example:
282+ * Detect queries that do not hit pre-aggregations.
283+ * Set up alerts for queries that exceed a certain duration.
284+ * Attribute usage to specific users and implement chargebacks.
285+
286+ <SuccessBox >
287+
288+ Query History export requires the [ M tier] ( /product/deployment/cloud/pricing#monitoring-integrations-tiers )
289+ of Monitoring Integrations.
290+
291+ </SuccessBox >
292+
293+ To configure Query History export, add the ` query-history ` input to the ` inputs `
294+ option of the sink configuration. Example configuration for exporting Query History data
295+ to the standard output of the Vector agent:
296+
297+ ``` toml
298+ [sinks .my_console ]
299+ type = " console"
300+ inputs = [
301+ " query-history"
302+ ]
303+ target = " stdout"
304+ encoding = { codec = " json" }
305+ ```
306+
307+ Exported data includes the following fields:
308+
309+ | Field | Description |
310+ | --- | --- |
311+ | ` trace_id ` | Unique identifier of the API request. |
312+ | ` account_name ` | Name of the Cube Cloud account. |
313+ | ` deployment_id ` | Identifier of the [ deployment] [ ref-deployments ] . |
314+ | ` environment_name ` | Name of the [ environment] [ ref-environments ] , ` NULL ` for production. |
315+ | ` api_type ` | Type of [ data API] [ ref-apis ] used (` rest ` , ` sql ` , etc.), ` NULL ` for errors. |
316+ | ` api_query ` | Query executed by the API, represented as string. |
317+ | ` security_context ` | [ Security context] [ ref-security-context ] of the request, represented as a string. |
318+ | ` status ` | Status of the request: ` success ` or ` error ` . |
319+ | ` error_message ` | Error message, if any. |
320+ | ` start_time_unix_ms ` | Start time of the execution, Unix timestamp in milliseconds. |
321+ | ` end_time_unix_ms ` | End time of the execution, Unix timestamp in milliseconds. |
322+ | ` api_response_duration_ms ` | Duration of the execution in milliseconds. |
323+ | ` cache_type ` | [ Cache type] [ ref-cache-type ] : ` no_cache ` , ` pre_aggregations_in_cube_store ` , etc. |
324+
325+ <ReferenceBox >
326+
327+ See [ this recipe] [ ref-query-history-export-recipe ] for an example of analyzing data from
328+ Query History export.
329+
330+ </ReferenceBox >
331+
332+
277333[ ref-autosuspend ] : /product/deployment/cloud/auto-suspension#effects-on-experience
278334[ self-sinks-for-metrics ] : #configuration-sinks-for-metrics
279335[ ref-dedicated-infra ] : /product/deployment/cloud/infrastructure#dedicated-infrastructure
@@ -302,4 +358,11 @@ setting `CUBE_CLOUD_MONITORING_METRICS_USER` and
302358[ mimir ] : https://grafana.com/oss/mimir/
303359[ grafana-cloud ] : https://grafana.com/products/cloud/
304360[ ref-prod-env ] : /product/workspace/environments#production-environment
305- [ ref-preagg-warmup ] : /product/deployment/cloud/warm-up#pre-aggregation-warm-up
361+ [ ref-preagg-warmup ] : /product/deployment/cloud/warm-up#pre-aggregation-warm-up
362+ [ ref-query-history ] : /product/workspace/query-history
363+ [ ref-deployments ] : /product/deployment/cloud/deployments
364+ [ ref-environments ] : /product/workspace/environments
365+ [ ref-apis ] : /product/apis-integrations
366+ [ ref-security-context ] : /product/auth/context
367+ [ ref-cache-type ] : /product/caching#cache-type
368+ [ ref-query-history-export-recipe ] : /guides/recipes/data-exploration/query-history-export
0 commit comments