Skip to content

fix[receiver/sqlquery]: Null value logs collection#43985

Merged
songy23 merged 4 commits into
open-telemetry:mainfrom
observIQ:fix/sqlqueryreceiver-logs-nullvalues
Nov 18, 2025
Merged

fix[receiver/sqlquery]: Null value logs collection#43985
songy23 merged 4 commits into
open-telemetry:mainfrom
observIQ:fix/sqlqueryreceiver-logs-nullvalues

Conversation

@mrsillydog

@mrsillydog mrsillydog commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Description

This change prevents log collection from being fully halted by a single log with a NULL value. Instead, logs should drop NULL values, and other logs will be collected normally.

Link to tracking issue

Fixes #43984

Testing

Unit testing to ensure that the receiver would not error upon receiving ErrNullValueWarning from DBClient.QueryRows.
Manual testing with a distribution of the collector built off of this branch.

Comment thread receiver/sqlqueryreceiver/logs_receiver.go Outdated
Comment thread receiver/sqlqueryreceiver/logs_receiver_test.go Outdated
@crobert-1

Copy link
Copy Markdown
Member

Thanks for filing the issue and fixing as well, @mrsillydog, really appreciate your help!

@crobert-1 crobert-1 added the ready to merge Code review completed; ready to merge by maintainers label Nov 18, 2025
@songy23 songy23 merged commit 188e1b7 into open-telemetry:main Nov 18, 2025
205 checks passed
@github-actions github-actions Bot added this to the next release milestone Nov 18, 2025
@mrsillydog mrsillydog deleted the fix/sqlqueryreceiver-logs-nullvalues branch November 19, 2025 14:20
benchub added a commit to benchub/opentelemetry-collector-contrib that referenced this pull request Mar 5, 2026
This enhancement to NULL value handling allows for cleaner logs when a query
cannot be formulated to hide NULL values. For example, the SQL interface to
pgBouncer is a handy way to monitor that service, but the minimal SQL parsing
of the interface does not allow for a subset of columns to be returned. As a
result, NULL values are common in the returned rows, even if they will not
be used by the receiver.

Link to tracking issue
Enhances open-telemetry#43985

Testing
Unit testing showing that the existence of ignore_null_values=true supresses
warnings, unless the null values are in a referenced column. Likewise, tests
that show the default value, or explicitly setting the value to false, keeps
the warnings around. Errors always remain when a columned holding NULL values
is referenced.
songy23 pushed a commit that referenced this pull request Apr 15, 2026
#### Description
This enhancement to NULL value handling allows for cleaner logs when a
query cannot be formulated to hide NULL values. For example, the SQL
interface to pgBouncer is a handy way to monitor that service, but the
minimal SQL parsing of the interface does not allow for a subset of
columns to be returned. As a result, NULL values are common in the
returned rows, even if they will not be used for monitoring.

#### Link to tracking issue
Enhances #43985

#### Testing
Unit testing showing that the existence of ignore_null_values=true
suppresses warnings, unless the null values are in a referenced column.
Likewise, tests that show the default value, or explicitly setting the
value to false, keeps the warnings around. Errors always remain when a
columned holding NULL values is referenced.

#### Documentation
Documented the new option, and referenced it when talking about NULL
values in README.md.
AndrewCharlesHay pushed a commit to AndrewCharlesHay/opentelemetry-collector-contrib that referenced this pull request Apr 23, 2026
…emetry#46660)

#### Description
This enhancement to NULL value handling allows for cleaner logs when a
query cannot be formulated to hide NULL values. For example, the SQL
interface to pgBouncer is a handy way to monitor that service, but the
minimal SQL parsing of the interface does not allow for a subset of
columns to be returned. As a result, NULL values are common in the
returned rows, even if they will not be used for monitoring.

#### Link to tracking issue
Enhances open-telemetry#43985

#### Testing
Unit testing showing that the existence of ignore_null_values=true
suppresses warnings, unless the null values are in a referenced column.
Likewise, tests that show the default value, or explicitly setting the
value to false, keeps the warnings around. Errors always remain when a
columned holding NULL values is referenced.

#### Documentation
Documented the new option, and referenced it when talking about NULL
values in README.md.
gracewehner pushed a commit to gracewehner/opentelemetry-collector-contrib that referenced this pull request Apr 29, 2026
…emetry#46660)

#### Description
This enhancement to NULL value handling allows for cleaner logs when a
query cannot be formulated to hide NULL values. For example, the SQL
interface to pgBouncer is a handy way to monitor that service, but the
minimal SQL parsing of the interface does not allow for a subset of
columns to be returned. As a result, NULL values are common in the
returned rows, even if they will not be used for monitoring.

#### Link to tracking issue
Enhances open-telemetry#43985

#### Testing
Unit testing showing that the existence of ignore_null_values=true
suppresses warnings, unless the null values are in a referenced column.
Likewise, tests that show the default value, or explicitly setting the
value to false, keeps the warnings around. Errors always remain when a
columned holding NULL values is referenced.

#### Documentation
Documented the new option, and referenced it when talking about NULL
values in README.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal/sqlquery ready to merge Code review completed; ready to merge by maintainers receiver/sqlquery SQL query receiver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix[receiver/sqlquery] Null values result in a hard error instead of a warning.

5 participants