ClickHouse / ClickHouse/ClickHouse

Cannot add TTL to `opentelemetry_span_log` via config.xml

Open
#88,366 6 comments 0 reactions 0 assignees View on GitHub
comp-system-table external potential bug
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

### Company or project name

Instructure Inc.

### Describe what's wrong

It is possible to add TTL to all system `_log` tables via

```
$ cat /etc/clickhouse-server/config.d/query_log_ttl.xml


system
query_log
event_date + INTERVAL 30 DAY DELETE

```
but not for `opentelemetry_span_log`.

The following breaks the server so it won't start. The error in logs is `Application: Code: 36. DB::Exception: If 'engine' is specified for system table, TTL parameters should be specified directly inside 'engine' and 'ttl' setting doesn't make sense. (BAD_ARGUMENTS)`

```
$ cat /etc/clickhouse-server/config.d/opentelemetry_span_log_ttl.xml


system
opentelemetry_span_log
finish_date + INTERVAL 30 DAY DELETE

```

### Does it reproduce on the most recent release?

Yes

### How to reproduce

```
$cat /etc/clickhouse-server/config.d/opentelemetry_span_log_ttl.xml


system
opentelemetry_span_log
finish_date + INTERVAL 30 DAY DELETE

```

### Expected behavior

Given ttl defined in config.yml

Then the server starts and`opentelemetry_span_log` has the TTLs defined.

### Error message and/or stacktrace

```
clickhouse-1 | 2025.10.10 21:39:38.716852 [ 1 ] {} Application: Code: 36. DB::Exception: If 'engine' is specified for system table, TTL parameters should be specified directly inside 'engine' and 'ttl' setting doesn't make sense. (BAD_ARGUMENTS), Stack trace (when copying this message, always include the lines below):
clickhouse-1 |
clickhouse-1 | 0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000010ca72f0
clickhouse-1 | 1. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000b743c98
clickhouse-1 | 2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000b743768
clickhouse-1 | 3. DB::Exception::Exception<>(int, FormatStringHelperImpl<>) @ 0x000000000b751074
clickhouse-1 | 4. std::shared_ptr DB::(anonymous namespace)::createSystemLog(std::shared_ptr, String const&, String const&, Poco::Util::AbstractConfiguration const&, String const&, String const&) @ 0x0000000015147c64
clickhouse-1 | 5. DB::SystemLogs::SystemLogs(std::shared_ptr, Poco::Util::AbstractConfiguration const&) @ 0x000000001510a58c
clickhouse-1 | 6. void std::__call_once_proxy[abi:ne190107]>(void*) (.llvm.12504200776216114822) @ 0x0000000014d8e874
clickhouse-1 | 7. std::__call_once(unsigned long volatile&, void*, void (*)(void*)) @ 0x000000001bc49218
clickhouse-1 | 8. DB::Server::main(std::vector> const&) @ 0x0000000010fc4d38
clickhouse-1 | 9. Poco::Util::Application::run() @ 0x000000001b1994bc
clickhouse-1 | 10. DB::Server::run() @ 0x0000000010fb1578
clickhouse-1 | 11. mainEntryClickHouseServer(int, char**) @ 0x0000000010fae7c8
clickhouse-1 | 12. main @ 0x000000000b73c58c
clickhouse-1 | 13. ? @ 0x0000000000027400
clickhouse-1 | 14. ? @ 0x00000000000274d8
clickhouse-1 | (version 25.8.10.7 (official build))
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.