-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Finer grained driver loading in SQL receivers #39918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mx-psi
merged 4 commits into
open-telemetry:main
from
nozomi-gedimitr:finer_grained_drv_loading_sql_receivers
May 7, 2025
Merged
Finer grained driver loading in SQL receivers #39918
mx-psi
merged 4 commits into
open-telemetry:main
from
nozomi-gedimitr:finer_grained_drv_loading_sql_receivers
May 7, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mx-psi
approved these changes
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, this looks good to me
sincejune
approved these changes
May 7, 2025
dragonlord93
pushed a commit
to dragonlord93/opentelemetry-collector-contrib
that referenced
this pull request
May 23, 2025
#### 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 open-telemetry#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.
dd-jasminesun
pushed a commit
to DataDog/opentelemetry-collector-contrib
that referenced
this pull request
Jun 23, 2025
#### 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 open-telemetry#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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
internal/sqlquery
receiver/postgresql
receiver/sqlquery
SQL query receiver
receiver/sqlserver
Run Windows
Enable running windows test on a PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.The generated binary size increased significantly
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 thepostgresql
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, thesqlserver
one got its dependencies accordingly trimmed.