Repository navigation
client-1.24.0
·
22 commits
to main
since this release
New features
- OpenTelemetry: richer, more actionable spans (requested by Langfuse, #948). (#950)
- The
X-ClickHouse-Summarycounters are now attached to theclickhouse.queryspan as well (previously only oncommand/exec/insert), so the request-level metrics are visible on the outer client span. - Every key present in the summary header is now recorded as
clickhouse.summary.<key>(the set is no longer a hardcoded subset). This surfacestotal_rows_to_read(already typed but never recorded) andmemory_usage(peak query memory, in bytes; sent by newer servers), and picks up future server-side additions (e.g.real_time_microseconds) automatically. db.response.returned_rowsis now recorded for non-streaming result consumption too (json()onJSON/JSONObjectEachRow/ the other single-document JSON formats), not just row-streaming paths.- Added a
span_attributesfield to the per-request query params (query/command/exec/insert/ping). Use it to enrich the operation span with application-level context — e.g. mirroring the tags you also send via thelog_commentsetting (route, tenant, surface, etc.). Caller-provided attributes never override the client's owndb.*/server.*/clickhouse.*attributes. - Added a
dangerously_log_query_textclient option (defaultfalse). When enabled, the raw SQL statement is attached to spans as the OpenTelemetrydb.query.textattribute and included in theerror-level logs emitted for a failed request. The query text may contain sensitive literals, which is why it is off by default; boundquery_paramsvalues and credentials are never logged or traced regardless of this setting.
- The
Bug fixes
- Fixed
Array(Date)/Array(Date32)query-parameter binding (and other temporal element types nested in arrays, tuples, and maps). A JSDateinside a container was serialized as a bare Unix timestamp (e.g.[1683244800]), which the server'sArray(Date)element parser rejects (CANNOT_PARSE_INPUT_ASSERTION_FAILED). Container-nestedDatevalues are now emitted as a quoted UTC date string (e.g.['2023-05-05']), the one encoding every temporal element type accepts. Note: aDateused insideArray(DateTime)/Array(DateTime64)is now bound at day precision (the time-of-day is dropped), since date-only is the only formArray(Date)accepts; scalarDate/DateTimebinding is unchanged. (#947) - Export the
QueryParamsWithFormat,ClickHouseSummary,WithClickHouseSummary,ResultJSONType,RowJSONTypeandPingParamstypes from@clickhouse/client. They are used in the signatures of the public API (query,ping, the result types), but could not be imported from the package root (#997). (#1024)