You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finer grained driver loading in SQL receivers (#39918)
#### Description
Between 0.123.0 and 0.124.0, the footprint of the `postgresql` receiver
increased sharply when participating in custom builds. As an experiment,
builds using the configuration below were done for both 0.123.0 and
0.124.0 releases in MacOS.
```
dist:
name: otelcol-custom
description: Local OpenTelemetry Collector binary
output_path: /tmp/dist
exporters:
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.124.0
receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.124.0
processors:
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.124.0
```
The generated binary size increased significantly
* 0.123.0 --> 25 MB
* 0.124.0 --> 63 MB
The problem was found to be the recent inclusion of the internal
`sqlquery` package (PR #39311): this package registers drivers for all
kinds of databases, and thus the `postgresql` receiver got many new
(unneeded) dependencies.
With this PR, the `internal/sqlquery` package no longer registers
drivers for all possible databases: instead this task is expected to be
done by the actual users of the package, who know best what drivers they
are going to need.
Apart from the `postgresql` receiver, the `sqlserver` one got its
dependencies accordingly trimmed.
0 commit comments