Slowsql Connector
Overview
Overview
Generate logs from recorded slow database statement associated with spans. Each log will have at least the following dimensions:- Service name
- Span kind
- Span name
- Status code
- Trace ID
- Span ID
- Database System
- Database Statement
- Database Statement Duration
- Span attributes. If you want to filter out some attributes (like only copying HTTP attributes starting with
http.) use the transform processor.
Configurations
If you are not already familiar with connectors, you may find it helpful to first visit the Connectors README. The following settings can be optionally configured:dimensions: the list of dimensions to add to logs with the default dimensions defined above. Each additional dimension is defined with anamewhich is looked up in the span’s collection of attributes or resource attributes (AKA process tags) such asip,host.nameorregion.db_system:the list value of span attributedb.system, Filter specific db systems, define those database’s statements need to be collected. ref: https://opentelemetry.io/docs/specs/semconv/attributes-registry/db/- Default:
[h2, mongodb, mssql, mysql, oracle, postgresql, mariadb]
- Default:
threshold: define a threshold and collect when thedb.statement, namely span duration, larger than this value.- Default:
500ms
- Default:
Examples
The following is a simple example usage of theslow sql connector.
slowsql connector using Elasticsearch as exporters.
More Examples
For more example configuration covering various other use cases, please visit the testdata directory.Configuration
Example Configuration
Last generated: 2026-04-13