[DOCS] Observability - #3096
Conversation
…umentation and partner spec
|
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
|
|
||
| For a complete production-style Spring Boot application demonstrating Client V2 configuration, connection pooling, trace context propagation across `@Async` boundaries, and full telemetry integration, see the `examples/demo-spring-service` module in this repository. | ||
|
|
||
| ### Client Builder Observability API |
There was a problem hiding this comment.
This overlaps with docs/clickhouse-docs/client.mdx with similar content. I suggest consolidating it into a single document and referencing other pages. I’m concerned about content discrepancies over time
| .setUsername("default") | ||
| .setPassword("secret") | ||
| .setMaxConnections(50) | ||
| .setConnectionRequestTimeout(5, TimeUnit.SECONDS) |
There was a problem hiding this comment.
not ChronoUnit? as per
| @@ -0,0 +1,221 @@ | |||
| # IoT Ingest Demo Service | |||
There was a problem hiding this comment.
we already have another Spring demo service https://github.com/ClickHouse/clickhouse-java/tree/40464dde1c7f3de958a765a756ef6f4c70e98ad3/examples/demo-service. Should we delete ore rename the old one?
|
|
||
| ### HTTP Connection Pooling (`client-v2`) | ||
|
|
||
| The `Client` instance owns an internal Apache HttpClient 5 connection pool. It manages persistent HTTP connections to ClickHouse endpoints. |
There was a problem hiding this comment.
should we add a link to Apache HttpClient 5 docs? one time is enough
|
|
||
| - **Layering:** HikariCP manages JDBC `Connection` instances, while each JDBC connection wraps a `Client` instance with its own internal HTTP socket pool. | ||
| - **Sizing Alignment:** Avoid over-allocating HikariCP connections. Because ClickHouse processes HTTP requests concurrently over pooled sockets, a smaller HikariCP pool (e.g., 10–20 connections) paired with a properly sized `Client` HTTP pool is typically optimal. | ||
| - **Connection Lifecycle:** Configure HikariCP's `maxLifetime` slightly shorter than any network or load-balancer idle timeout to prevent stale socket exceptions. |
There was a problem hiding this comment.
than any network or load-balancer idle timeout to prevent stale socket exceptions.
Do we have any anecdotal values to recommend?
| |---------|----------------|---------|-------------| | ||
| | Max Connections | `setMaxConnections(int)` | `10` | Maximum open HTTP connections per server endpoint. | | ||
| | Connection TTL | `setConnectionTTL(long, TimeUnit)` | `-1` (disabled) | Time-to-live after which an active connection is closed and recreated. | | ||
| | Keep-Alive Timeout | `setKeepAliveTimeout(long, TimeUnit)` | Server default | HTTP Keep-Alive duration for idle pooled connections. | |
There was a problem hiding this comment.
any recommendations for aligning the value with server config value? AFAIK it should be lower than https://clickhouse.com/docs/reference/settings/server-settings/settings/other#keep_alive_timeout to avoid an attempt to reuse a server-closed connection
|
|
||
| ### 2. Correlating Application Traces with ClickHouse Server Logs (`system.query_log`) | ||
|
|
||
| **Symptom:** Need to trace an expensive or failing query from APM traces down to ClickHouse server execution logs. |
There was a problem hiding this comment.
not only APM traces - any query, no?
|
|
||
| Tracing in Client V2 produces two types of spans arranged in a parent-child hierarchy: | ||
|
|
||
| 1. **Operation Span**: Represents a high-level client operation (`query <database>` or `insert <database>.<table_name>`). Started under the current thread's trace context (`Context.current()`) so that database operations join the caller's active trace span. |
There was a problem hiding this comment.
(
query <database>orinsert <database>.<table_name>)
not related to this PR: there is inconsistency across language clients that we need to address. see ClickHouse/clickhouse-rs#390



Summary
examples/demo-spring-serviceas showcase for observabilitydocs/integration-ops.mdas part of partner spec for operationsCloses: #2147
Checklist
Delete items not relevant to your PR: