专用属性列
专用属性列通过将最常用的属性存储在各自的列中,而不是存储在通用属性键值列表中,从而提高了查询性能。
专用属性列随 vParquet3
引入,仅在使用此存储格式时可用。要详细了解 vParquet3
的设计,请参阅设计提案。
配置
专用属性列可以在存储块中或通过覆盖项配置。
# Storage configuration for traces
storage:
trace:
block:
version: vParquet3
# Default dedicated columns for all blocks
parquet_dedicated_columns:
- name: <string>, # name of the attribute
type: <string>, # type of the attribute. options: string
scope: <string> # scope of the attribute. options: resource, span
overrides:
# Global overrides for dedicated columns configuration
parquet_dedicated_columns:
- name: <string>, # name of the attribute
type: <string>, # type of the attribute. options: string
scope: <string> # scope of the attribute. options: resource, span
per_tenant_override_config: /conf/overrides.yaml
---
# /conf/overrides.yaml
# Tenant-specific overrides configuration
overrides:
"<tenant id>":
parquet_dedicated_columns:
- name: <string>, # name of the attribute
type: <string>, # type of the attribute. options: string
scope: <string> # scope of the attribute. options: resource, span
# A "wildcard" override can be used that will apply to all tenants if a match is not found.
"*":
parquet_dedicated_columns:
- name: <string>, # name of the attribute
type: <string>, # type of the attribute. options: string
scope: <string> # scope of the attribute. options: resource, span
优先考虑最具体的配置,因此租户特定的覆盖项将优先于全局覆盖项。类似地,默认覆盖项优先于存储块配置。
使用
专用属性列仅限于 10 个 span 属性和 10 个具有字符串值的资源属性。一般来说,即使不常查询,对块大小贡献最大的属性是专用属性列的良好候选项。减小通用属性键值列表的大小显著提高了查询性能。
Tempo-cli
您可以使用 tempo-cli
工具查找专用属性列的良好候选项。tempo-cli
提供了 analyse block <tenant-id> <block-id>
和 analyse blocks <tenant-id>
命令,这些命令将输出给定块或租户中所有块按大小排序的前 N 个属性。
示例
tempo-cli analyse blocks --backend=local --bucket=./cmd/tempo-cli/test-data/ single-tenant
有关更多信息,请参阅tempo-cli 文档。