sources
Creates, updates, deletes, gets or lists a sources resource.
Overview
| Name | sources |
| Type | Resource |
| Id | clickhouse.clickstack.sources |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Unique source ID. Server-generated; ignored if sent in create/update requests. (example: 507f1f77bcf86cd799439011) |
name | string | Display name for the source. (example: Logs) |
log_source_id | string | HyperDX Source for logs associated with traces. Optional (example: 507f1f77bcf86cd799439011) (wire: logSourceId) |
metric_source_id | string | HyperDX Source for metrics associated with logs. Optional (example: 507f1f77bcf86cd799439013) (wire: metricSourceId) |
session_source_id | string | HyperDX Source for sessions associated with traces. Optional (example: 507f1f77bcf86cd799439031) (wire: sessionSourceId) |
trace_source_id | string | HyperDX Source for traces associated with logs. Optional (example: 507f1f77bcf86cd799439014) (wire: traceSourceId) |
body_expression | string | Expression to extract the log message body. (example: Body) (wire: bodyExpression) |
connection | string | ID of the ClickHouse connection used by this source. (example: 507f1f77bcf86cd799439012) |
default_table_select_expression | string | Default columns selected in search results (this can be customized per search later) (example: Timestamp, ServiceName, SeverityText, Body) (wire: defaultTableSelectExpression) |
disabled | boolean | When true, the source is hidden from source selectors in the UI. Defaults to false. |
displayed_timestamp_value_expression | string | This DateTime column is used to display and order search results. (example: TimestampTime) (wire: displayedTimestampValueExpression) |
duration_expression | string | Expression to extract span duration. (example: Duration) (wire: durationExpression) |
duration_precision | integer | Number of decimal digits in the duration value (e.g., 3 for milliseconds, 6 for microseconds, 9 for nanoseconds). (wire: durationPrecision) |
event_attributes_expression | string | Expression to extract event-level attributes. (example: LogAttributes) (wire: eventAttributesExpression) |
filter_settings | object | (wire: filterSettings) |
from | object | |
highlighted_row_attribute_expressions | array | Expressions defining row-level attributes which are displayed in the row side panel for the selected row. (wire: highlightedRowAttributeExpressions) |
highlighted_trace_attribute_expressions | array | Expressions defining trace-level attributes which are displayed in the trace view for the selected trace. (wire: highlightedTraceAttributeExpressions) |
implicit_column_expression | string | Column used for full text search if no property is specified in a Lucene-based search. Typically the message body of a log. (example: Body) (wire: implicitColumnExpression) |
kind | string | Source kind discriminator. Must be "log" for log sources. (log) (example: log) |
known_columns_list_expression | string | For Distributed table sources whose target tables have non-matching column sets. A list of columns supported across all target tables, used instead of SELECT * when fetching full row data. Leave blank to select all columns. (example: Timestamp, Body, ServiceName) (wire: knownColumnsListExpression) |
materialized_views | array | Configure materialized views for query optimization. These pre-aggregated views can significantly improve query performance on aggregation queries. (wire: materializedViews) |
metadata_materialized_views | object | (wire: metadataMaterializedViews) |
metric_tables | object | (wire: metricTables) |
parent_span_id_expression | string | Expression to extract the parent span ID. (example: ParentSpanId) (wire: parentSpanIdExpression) |
query_settings | array | Optional ClickHouse query settings applied when querying this source. (wire: querySettings) |
resource_attributes_expression | string | Expression to extract resource-level attributes. (example: ResourceAttributes) (wire: resourceAttributesExpression) |
section | string | Optional grouping label used to organize sources in the source selector. Sources that share a section value are displayed together. (example: Billing) |
service_name_expression | string | Expression to extract the service name from log rows. (example: ServiceName) (wire: serviceNameExpression) |
severity_text_expression | string | Expression to extract the severity/log level text. (example: SeverityText) (wire: severityTextExpression) |
span_events_value_expression | string | Expression to extract span events. Used to capture events associated with spans. Expected to be Nested ( Timestamp DateTime64(9), Name LowCardinality(String), Attributes Map(LowCardinality(String), String) (example: Events) (wire: spanEventsValueExpression) |
span_id_expression | string | Expression to extract the span ID for correlating logs with traces. (example: SpanId) (wire: spanIdExpression) |
span_kind_expression | string | Expression to extract the span kind (e.g., client, server, internal). (example: SpanKind) (wire: spanKindExpression) |
span_name_expression | string | Expression to extract the span name. (example: SpanName) (wire: spanNameExpression) |
status_code_expression | string | Expression to extract the span status code. (example: StatusCode) (wire: statusCodeExpression) |
status_message_expression | string | Expression to extract the span status message. (example: StatusMessage) (wire: statusMessageExpression) |
timestamp_value_expression | string | DateTime column or expression that is part of your table's primary key. (example: Timestamp) (wire: timestampValueExpression) |
trace_id_expression | string | Expression to extract the trace ID for correlating logs with traces. (example: TraceId) (wire: traceIdExpression) |
use_text_index_for_implicit_column | string | Controls whether lucene rendering uses ClickHouse text indices via hasAllTokens() against the implicit column. "auto" detects a covering index at query time, "enabled" forces text index usage, "disabled" forces a LIKE/hasToken fallback. (auto, enabled, disabled) (example: auto) (wire: useTextIndexForImplicitColumn) |
| Name | Datatype | Description |
|---|---|---|
id | string | Unique source ID. Server-generated; ignored if sent in create/update requests. (example: 507f1f77bcf86cd799439011) |
name | string | Display name for the source. (example: Logs) |
log_source_id | string | HyperDX Source for logs associated with traces. Optional (example: 507f1f77bcf86cd799439011) (wire: logSourceId) |
metric_source_id | string | HyperDX Source for metrics associated with logs. Optional (example: 507f1f77bcf86cd799439013) (wire: metricSourceId) |
session_source_id | string | HyperDX Source for sessions associated with traces. Optional (example: 507f1f77bcf86cd799439031) (wire: sessionSourceId) |
trace_source_id | string | HyperDX Source for traces associated with logs. Optional (example: 507f1f77bcf86cd799439014) (wire: traceSourceId) |
body_expression | string | Expression to extract the log message body. (example: Body) (wire: bodyExpression) |
connection | string | ID of the ClickHouse connection used by this source. (example: 507f1f77bcf86cd799439012) |
default_table_select_expression | string | Default columns selected in search results (this can be customized per search later) (example: Timestamp, ServiceName, SeverityText, Body) (wire: defaultTableSelectExpression) |
disabled | boolean | When true, the source is hidden from source selectors in the UI. Defaults to false. |
displayed_timestamp_value_expression | string | This DateTime column is used to display and order search results. (example: TimestampTime) (wire: displayedTimestampValueExpression) |
duration_expression | string | Expression to extract span duration. (example: Duration) (wire: durationExpression) |
duration_precision | integer | Number of decimal digits in the duration value (e.g., 3 for milliseconds, 6 for microseconds, 9 for nanoseconds). (wire: durationPrecision) |
event_attributes_expression | string | Expression to extract event-level attributes. (example: LogAttributes) (wire: eventAttributesExpression) |
filter_settings | object | (wire: filterSettings) |
from | object | |
highlighted_row_attribute_expressions | array | Expressions defining row-level attributes which are displayed in the row side panel for the selected row. (wire: highlightedRowAttributeExpressions) |
highlighted_trace_attribute_expressions | array | Expressions defining trace-level attributes which are displayed in the trace view for the selected trace. (wire: highlightedTraceAttributeExpressions) |
implicit_column_expression | string | Column used for full text search if no property is specified in a Lucene-based search. Typically the message body of a log. (example: Body) (wire: implicitColumnExpression) |
kind | string | Source kind discriminator. Must be "log" for log sources. (log) (example: log) |
known_columns_list_expression | string | For Distributed table sources whose target tables have non-matching column sets. A list of columns supported across all target tables, used instead of SELECT * when fetching full row data. Leave blank to select all columns. (example: Timestamp, Body, ServiceName) (wire: knownColumnsListExpression) |
materialized_views | array | Configure materialized views for query optimization. These pre-aggregated views can significantly improve query performance on aggregation queries. (wire: materializedViews) |
metadata_materialized_views | object | (wire: metadataMaterializedViews) |
metric_tables | object | (wire: metricTables) |
parent_span_id_expression | string | Expression to extract the parent span ID. (example: ParentSpanId) (wire: parentSpanIdExpression) |
query_settings | array | Optional ClickHouse query settings applied when querying this source. (wire: querySettings) |
resource_attributes_expression | string | Expression to extract resource-level attributes. (example: ResourceAttributes) (wire: resourceAttributesExpression) |
section | string | Optional grouping label used to organize sources in the source selector. Sources that share a section value are displayed together. (example: Billing) |
service_name_expression | string | Expression to extract the service name from log rows. (example: ServiceName) (wire: serviceNameExpression) |
severity_text_expression | string | Expression to extract the severity/log level text. (example: SeverityText) (wire: severityTextExpression) |
span_events_value_expression | string | Expression to extract span events. Used to capture events associated with spans. Expected to be Nested ( Timestamp DateTime64(9), Name LowCardinality(String), Attributes Map(LowCardinality(String), String) (example: Events) (wire: spanEventsValueExpression) |
span_id_expression | string | Expression to extract the span ID for correlating logs with traces. (example: SpanId) (wire: spanIdExpression) |
span_kind_expression | string | Expression to extract the span kind (e.g., client, server, internal). (example: SpanKind) (wire: spanKindExpression) |
span_name_expression | string | Expression to extract the span name. (example: SpanName) (wire: spanNameExpression) |
status_code_expression | string | Expression to extract the span status code. (example: StatusCode) (wire: statusCodeExpression) |
status_message_expression | string | Expression to extract the span status message. (example: StatusMessage) (wire: statusMessageExpression) |
timestamp_value_expression | string | DateTime column or expression that is part of your table's primary key. (example: Timestamp) (wire: timestampValueExpression) |
trace_id_expression | string | Expression to extract the trace ID for correlating logs with traces. (example: TraceId) (wire: traceIdExpression) |
use_text_index_for_implicit_column | string | Controls whether lucene rendering uses ClickHouse text indices via hasAllTokens() against the implicit column. "auto" detects a covering index at query time, "enabled" forces text index usage, "disabled" forces a LIKE/hasToken fallback. (auto, enabled, disabled) (example: auto) (wire: useTextIndexForImplicitColumn) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_id, click_stack_source_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a specific source by ID | |
list | select | service_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a list of all sources for the authenticated team | |
create | insert | service_id, organization_id, name, kind, connection, from, default_table_select_expression, timestamp_value_expression, duration_expression, duration_precision, trace_id_expression, span_id_expression, parent_span_id_expression, span_name_expression, span_kind_expression, metric_tables, resource_attributes_expression, trace_source_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Creates a new source. The request body is a source object without the id field. If an id is sent anyway it is silently ignored (stripped before validation — the request is never rejected because of it). Granularity fields (materializedViews[].minGranularity and metadataMaterializedViews.granularity) accept the same short format the API returns (e.g. 5m, 15s, 1h, 1d). | |
update | update | service_id, click_stack_source_id, organization_id, name, kind, connection, from, default_table_select_expression, timestamp_value_expression, duration_expression, duration_precision, trace_id_expression, span_id_expression, parent_span_id_expression, span_name_expression, span_kind_expression, metric_tables, resource_attributes_expression, trace_source_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Updates an existing source. The full source object must be provided; this is a replace, not a patch. The request body is a source object without the id field. If an id is sent anyway it is silently ignored (stripped before validation — never a 400); the path parameter alone identifies the source. Granularity fields (materializedViews[].minGranularity and metadataMaterializedViews.granularity) accept the same short format the API returns (e.g. 5m, 15s, 1h, 1d). | |
delete | delete | service_id, click_stack_source_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Deletes a source |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
click_stack_source_id | string | Source ID (wire: clickStackSourceId) |
organization_id | string | ClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID) |
service_id | string (uuid) | ID of the ClickStack service. (wire: serviceId) |
SELECT examples
- get
- list
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a specific source by ID
SELECT
id,
name,
log_source_id,
metric_source_id,
session_source_id,
trace_source_id,
body_expression,
connection,
default_table_select_expression,
disabled,
displayed_timestamp_value_expression,
duration_expression,
duration_precision,
event_attributes_expression,
filter_settings,
from,
highlighted_row_attribute_expressions,
highlighted_trace_attribute_expressions,
implicit_column_expression,
kind,
known_columns_list_expression,
materialized_views,
metadata_materialized_views,
metric_tables,
parent_span_id_expression,
query_settings,
resource_attributes_expression,
section,
service_name_expression,
severity_text_expression,
span_events_value_expression,
span_id_expression,
span_kind_expression,
span_name_expression,
status_code_expression,
status_message_expression,
timestamp_value_expression,
trace_id_expression,
use_text_index_for_implicit_column
FROM clickhouse.clickstack.sources
WHERE service_id = '{{ service_id }}' -- required
AND click_stack_source_id = '{{ click_stack_source_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a list of all sources for the authenticated team
SELECT
id,
name,
log_source_id,
metric_source_id,
session_source_id,
trace_source_id,
body_expression,
connection,
default_table_select_expression,
disabled,
displayed_timestamp_value_expression,
duration_expression,
duration_precision,
event_attributes_expression,
filter_settings,
from,
highlighted_row_attribute_expressions,
highlighted_trace_attribute_expressions,
implicit_column_expression,
kind,
known_columns_list_expression,
materialized_views,
metadata_materialized_views,
metric_tables,
parent_span_id_expression,
query_settings,
resource_attributes_expression,
section,
service_name_expression,
severity_text_expression,
span_events_value_expression,
span_id_expression,
span_kind_expression,
span_name_expression,
status_code_expression,
status_message_expression,
timestamp_value_expression,
trace_id_expression,
use_text_index_for_implicit_column
FROM clickhouse.clickstack.sources
WHERE service_id = '{{ service_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
INSERT examples
- create
- Manifest
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Creates a new source. The request body is a source object without the id field. If an id is sent anyway it is silently ignored (stripped before validation — the request is never rejected because of it). Granularity fields (materializedViews[].minGranularity and metadataMaterializedViews.granularity) accept the same short format the API returns (e.g. 5m, 15s, 1h, 1d).
INSERT INTO clickhouse.clickstack.sources (
id,
name,
section,
disabled,
kind,
connection,
from,
query_settings,
filter_settings,
default_table_select_expression,
timestamp_value_expression,
service_name_expression,
severity_text_expression,
body_expression,
event_attributes_expression,
resource_attributes_expression,
displayed_timestamp_value_expression,
metric_source_id,
trace_source_id,
trace_id_expression,
span_id_expression,
implicit_column_expression,
known_columns_list_expression,
use_text_index_for_implicit_column,
highlighted_trace_attribute_expressions,
highlighted_row_attribute_expressions,
materialized_views,
metadata_materialized_views,
duration_expression,
duration_precision,
parent_span_id_expression,
span_name_expression,
span_kind_expression,
log_source_id,
session_source_id,
status_code_expression,
status_message_expression,
span_events_value_expression,
metric_tables,
service_id,
organization_id
)
SELECT
'{{ id }}',
'{{ name }}' /* required */,
'{{ section }}',
{{ disabled }},
'{{ kind }}' /* required */,
'{{ connection }}' /* required */,
'{{ from }}' /* required */,
'{{ query_settings }}',
'{{ filter_settings }}',
'{{ default_table_select_expression }}' /* required */,
'{{ timestamp_value_expression }}' /* required */,
'{{ service_name_expression }}',
'{{ severity_text_expression }}',
'{{ body_expression }}',
'{{ event_attributes_expression }}',
'{{ resource_attributes_expression }}' /* required */,
'{{ displayed_timestamp_value_expression }}',
'{{ metric_source_id }}',
'{{ trace_source_id }}' /* required */,
'{{ trace_id_expression }}' /* required */,
'{{ span_id_expression }}' /* required */,
'{{ implicit_column_expression }}',
'{{ known_columns_list_expression }}',
'{{ use_text_index_for_implicit_column }}',
'{{ highlighted_trace_attribute_expressions }}',
'{{ highlighted_row_attribute_expressions }}',
'{{ materialized_views }}',
'{{ metadata_materialized_views }}',
'{{ duration_expression }}' /* required */,
{{ duration_precision }} /* required */,
'{{ parent_span_id_expression }}' /* required */,
'{{ span_name_expression }}' /* required */,
'{{ span_kind_expression }}' /* required */,
'{{ log_source_id }}',
'{{ session_source_id }}',
'{{ status_code_expression }}',
'{{ status_message_expression }}',
'{{ span_events_value_expression }}',
'{{ metric_tables }}' /* required */,
'{{ service_id }}',
'{{ organization_id }}'
RETURNING
request_id,
result,
status
;
# Description fields are for documentation purposes
- name: sources
props:
- name: service_id
value: "{{ service_id }}"
description: Required parameter for the sources resource.
- name: organization_id
value: "{{ organization_id }}"
description: Required parameter for the sources resource.
- name: id
value: "{{ id }}"
description: |
Unique source ID. Server-generated; ignored if sent in create/update requests.
- name: name
value: "{{ name }}"
description: |
Display name for the source.
- name: section
value: "{{ section }}"
description: |
Optional grouping label used to organize sources in the source selector. Sources that share a section value are displayed together.
- name: disabled
value: {{ disabled }}
description: |
When true, the source is hidden from source selectors in the UI. Defaults to false.
- name: kind
value: "{{ kind }}"
description: |
Source kind discriminator. Must be "log" for log sources.
valid_values: ['log']
- name: connection
value: "{{ connection }}"
description: |
ID of the ClickHouse connection used by this source.
- name: from
value:
databaseName: "{{ databaseName }}"
tableName: "{{ tableName }}"
- name: query_settings
description: |
Optional ClickHouse query settings applied when querying this source.
value:
- setting: "{{ setting }}"
value: "{{ value }}"
- name: filter_settings
value:
databaseName: "{{ databaseName }}"
tableName: "{{ tableName }}"
columns:
- name: "{{ name }}"
label: "{{ label }}"
- name: default_table_select_expression
value: "{{ default_table_select_expression }}"
description: |
Default columns selected in search results (this can be customized per search later)
- name: timestamp_value_expression
value: "{{ timestamp_value_expression }}"
description: |
DateTime column or expression that is part of your table's primary key.
- name: service_name_expression
value: "{{ service_name_expression }}"
description: |
Expression to extract the service name from log rows.
- name: severity_text_expression
value: "{{ severity_text_expression }}"
description: |
Expression to extract the severity/log level text.
- name: body_expression
value: "{{ body_expression }}"
description: |
Expression to extract the log message body.
- name: event_attributes_expression
value: "{{ event_attributes_expression }}"
description: |
Expression to extract event-level attributes.
- name: resource_attributes_expression
value: "{{ resource_attributes_expression }}"
description: |
Expression to extract resource-level attributes.
- name: displayed_timestamp_value_expression
value: "{{ displayed_timestamp_value_expression }}"
description: |
This DateTime column is used to display and order search results.
- name: metric_source_id
value: "{{ metric_source_id }}"
description: |
HyperDX Source for metrics associated with logs. Optional
- name: trace_source_id
value: "{{ trace_source_id }}"
description: |
HyperDX Source for traces associated with logs. Optional
- name: trace_id_expression
value: "{{ trace_id_expression }}"
description: |
Expression to extract the trace ID for correlating logs with traces.
- name: span_id_expression
value: "{{ span_id_expression }}"
description: |
Expression to extract the span ID for correlating logs with traces.
- name: implicit_column_expression
value: "{{ implicit_column_expression }}"
description: |
Column used for full text search if no property is specified in a Lucene-based search. Typically the message body of a log.
- name: known_columns_list_expression
value: "{{ known_columns_list_expression }}"
description: |
For Distributed table sources whose target tables have non-matching column sets. A list of columns supported across all target tables, used instead of SELECT * when fetching full row data. Leave blank to select all columns.
- name: use_text_index_for_implicit_column
value: "{{ use_text_index_for_implicit_column }}"
description: |
Controls whether lucene rendering uses ClickHouse text indices via hasAllTokens() against the implicit column. "auto" detects a covering index at query time, "enabled" forces text index usage, "disabled" forces a LIKE/hasToken fallback.
valid_values: ['auto', 'enabled', 'disabled']
- name: highlighted_trace_attribute_expressions
description: |
Expressions defining trace-level attributes which are displayed in the trace view for the selected trace.
value:
- sqlExpression: "{{ sqlExpression }}"
luceneExpression: "{{ luceneExpression }}"
alias: "{{ alias }}"
- name: highlighted_row_attribute_expressions
description: |
Expressions defining row-level attributes which are displayed in the row side panel for the selected row.
value:
- sqlExpression: "{{ sqlExpression }}"
luceneExpression: "{{ luceneExpression }}"
alias: "{{ alias }}"
- name: materialized_views
description: |
Configure materialized views for query optimization. These pre-aggregated views can significantly improve query performance on aggregation queries.
value:
- databaseName: "{{ databaseName }}"
tableName: "{{ tableName }}"
dimensionColumns: "{{ dimensionColumns }}"
minGranularity: "{{ minGranularity }}"
minDate: "{{ minDate }}"
timestampColumn: "{{ timestampColumn }}"
aggregatedColumns: "{{ aggregatedColumns }}"
- name: metadata_materialized_views
value:
keyRollupTable: "{{ keyRollupTable }}"
kvRollupTable: "{{ kvRollupTable }}"
granularity: "{{ granularity }}"
- name: duration_expression
value: "{{ duration_expression }}"
description: |
Expression to extract span duration.
- name: duration_precision
value: {{ duration_precision }}
description: |
Number of decimal digits in the duration value (e.g., 3 for milliseconds, 6 for microseconds, 9 for nanoseconds).
- name: parent_span_id_expression
value: "{{ parent_span_id_expression }}"
description: |
Expression to extract the parent span ID.
- name: span_name_expression
value: "{{ span_name_expression }}"
description: |
Expression to extract the span name.
- name: span_kind_expression
value: "{{ span_kind_expression }}"
description: |
Expression to extract the span kind (e.g., client, server, internal).
- name: log_source_id
value: "{{ log_source_id }}"
description: |
HyperDX Source for logs associated with traces. Optional
- name: session_source_id
value: "{{ session_source_id }}"
description: |
HyperDX Source for sessions associated with traces. Optional
- name: status_code_expression
value: "{{ status_code_expression }}"
description: |
Expression to extract the span status code.
- name: status_message_expression
value: "{{ status_message_expression }}"
description: |
Expression to extract the span status message.
- name: span_events_value_expression
value: "{{ span_events_value_expression }}"
description: |
Expression to extract span events. Used to capture events associated with spans. Expected to be Nested ( Timestamp DateTime64(9), Name LowCardinality(String), Attributes Map(LowCardinality(String), String)
- name: metric_tables
value:
gauge: "{{ gauge }}"
histogram: "{{ histogram }}"
sum: "{{ sum }}"
summary: "{{ summary }}"
exponential histogram: "{{ exponential histogram }}"
UPDATE examples
- update
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Updates an existing source. The full source object must be provided; this is a replace, not a patch. The request body is a source object without the id field. If an id is sent anyway it is silently ignored (stripped before validation — never a 400); the path parameter alone identifies the source. Granularity fields (materializedViews[].minGranularity and metadataMaterializedViews.granularity) accept the same short format the API returns (e.g. 5m, 15s, 1h, 1d).
UPDATE clickhouse.clickstack.sources
SET
id = '{{ id }}',
name = '{{ name }}',
section = '{{ section }}',
disabled = {{ disabled }},
kind = '{{ kind }}',
connection = '{{ connection }}',
from = '{{ from }}',
query_settings = '{{ query_settings }}',
filter_settings = '{{ filter_settings }}',
default_table_select_expression = '{{ default_table_select_expression }}',
timestamp_value_expression = '{{ timestamp_value_expression }}',
service_name_expression = '{{ service_name_expression }}',
severity_text_expression = '{{ severity_text_expression }}',
body_expression = '{{ body_expression }}',
event_attributes_expression = '{{ event_attributes_expression }}',
resource_attributes_expression = '{{ resource_attributes_expression }}',
displayed_timestamp_value_expression = '{{ displayed_timestamp_value_expression }}',
metric_source_id = '{{ metric_source_id }}',
trace_source_id = '{{ trace_source_id }}',
trace_id_expression = '{{ trace_id_expression }}',
span_id_expression = '{{ span_id_expression }}',
implicit_column_expression = '{{ implicit_column_expression }}',
known_columns_list_expression = '{{ known_columns_list_expression }}',
use_text_index_for_implicit_column = '{{ use_text_index_for_implicit_column }}',
highlighted_trace_attribute_expressions = '{{ highlighted_trace_attribute_expressions }}',
highlighted_row_attribute_expressions = '{{ highlighted_row_attribute_expressions }}',
materialized_views = '{{ materialized_views }}',
metadata_materialized_views = '{{ metadata_materialized_views }}',
duration_expression = '{{ duration_expression }}',
duration_precision = {{ duration_precision }},
parent_span_id_expression = '{{ parent_span_id_expression }}',
span_name_expression = '{{ span_name_expression }}',
span_kind_expression = '{{ span_kind_expression }}',
log_source_id = '{{ log_source_id }}',
session_source_id = '{{ session_source_id }}',
status_code_expression = '{{ status_code_expression }}',
status_message_expression = '{{ status_message_expression }}',
span_events_value_expression = '{{ span_events_value_expression }}',
metric_tables = '{{ metric_tables }}'
WHERE
service_id = '{{ service_id }}' --required
AND click_stack_source_id = '{{ click_stack_source_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
AND name = '{{ name }}' --required
AND kind = '{{ kind }}' --required
AND connection = '{{ connection }}' --required
AND from = '{{ from }}' --required
AND default_table_select_expression = '{{ default_table_select_expression }}' --required
AND timestamp_value_expression = '{{ timestamp_value_expression }}' --required
AND duration_expression = '{{ duration_expression }}' --required
AND duration_precision = '{{ duration_precision }}' --required
AND trace_id_expression = '{{ trace_id_expression }}' --required
AND span_id_expression = '{{ span_id_expression }}' --required
AND parent_span_id_expression = '{{ parent_span_id_expression }}' --required
AND span_name_expression = '{{ span_name_expression }}' --required
AND span_kind_expression = '{{ span_kind_expression }}' --required
AND metric_tables = '{{ metric_tables }}' --required
AND resource_attributes_expression = '{{ resource_attributes_expression }}' --required
AND trace_source_id = '{{ trace_source_id }}' --required
RETURNING
request_id,
result,
status;
DELETE examples
- delete
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Deletes a source
DELETE FROM clickhouse.clickstack.sources
WHERE service_id = '{{ service_id }}' --required
AND click_stack_source_id = '{{ click_stack_source_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
;