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
Optionally suppress warnings about unreferenced NULL values (#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 #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.
Copy file name to clipboardExpand all lines: receiver/sqlqueryreceiver/README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,7 @@ Additionally, each `query` section supports the following properties:
82
82
See the below section [Tracking processed results](#tracking-processed-results).
83
83
-`tracking_start_value` (optional, default `""`) Applies only to logs. In case of a parameterized query, defines the initial value for the parameter.
84
84
See the below section [Tracking processed results](#tracking-processed-results).
85
+
-`ignore_null_values` (optional, default `false`) When set to `true`, suppresses warning logs about NULL values encountered in query result columns. This is useful when queries return NULL in columns that are not referenced in the metric or log configuration.
85
86
-`attribute_columns`(optional): a list of column names in the returned dataset used to set attributes on the signal.
86
87
These attributes may be case-sensitive, depending on the driver (e.g. Oracle DB).
87
88
@@ -314,8 +315,8 @@ This produces three separate metrics (`pgbouncer.lists.pools`, `pgbouncer.lists.
314
315
315
316
#### NULL values
316
317
317
-
Avoid queries that produce any NULL values. If a query produces a NULL value, a warning will be logged. Furthermore,
318
-
if a configuration references the column that produces a NULL value, an additional error will be logged. However, in
318
+
If a query produces a NULL value, a warning will be logged unless `ignore_null_values` is set to true. Furthermore,
319
+
if a configuration references the column that produces a NULL value, an error will always be logged. However, in
319
320
either case, the receiver will continue to operate.
0 commit comments