Skip to content

Add a system.error_log table with counters from system.errors #64501

@qoega

Description

@qoega

Use case

I want to use data from system.errors as from system.events table. It is just an event happening at some point in time. We can get this information from system.text_log or partially from system.query_log and other specific tables, but it is easier to just have them.

Describe the solution you'd like

CREATE TABLE system.error_log
    `hostname` LowCardinality(String) COMMENT 'Hostname of the server executing the query.' CODEC(ZSTD(1)),
    `event_date` Date COMMENT 'Event date.' CODEC(Delta(2), ZSTD(1)),
    `event_time` DateTime COMMENT 'Event time.' CODEC(Delta(4), ZSTD(1)),
    `code` Int32 COMMENT 'Error code.' CODEC(ZSTD(1)),
    `error` LowCardinality(String) MATERIALIZED errorCodeToName(code) COMMENT 'Error name.' CODEC(ZSTD(1)),
    `value` UInt64 COMMENT 'Number of errors happened in time interval.' CODEC(ZSTD(3))

Describe alternatives you've considered

Add the same data to system.metric_log as for events. It will add a column per error type and will make table even wider.

Additional context

for naming:
metrics -> metric_log
errors->error_log

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions