diff --git a/.chloggen/oracledbreceiver_memoryleak_fix.yaml b/.chloggen/oracledbreceiver_memoryleak_fix.yaml new file mode 100644 index 0000000000000..a4dc07170f4ed --- /dev/null +++ b/.chloggen/oracledbreceiver_memoryleak_fix.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: oracledbreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix for memory leak in top queries and query samples collection. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [43074] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/receiver/oracledbreceiver/obfuscate.go b/receiver/oracledbreceiver/obfuscate.go index 9e71feabe81f9..2e8d0108467a4 100644 --- a/receiver/oracledbreceiver/obfuscate.go +++ b/receiver/oracledbreceiver/obfuscate.go @@ -7,16 +7,18 @@ import ( "github.com/DataDog/datadog-agent/pkg/obfuscate" ) -var obfuscateSQLConfig = obfuscate.SQLConfig{DBMS: "oracle"} - type obfuscator obfuscate.Obfuscator func newObfuscator() *obfuscator { - return (*obfuscator)(obfuscate.NewObfuscator(obfuscate.Config{})) + return (*obfuscator)(obfuscate.NewObfuscator(obfuscate.Config{ + SQL: obfuscate.SQLConfig{ + DBMS: "oracle", + }, + })) } func (o *obfuscator) obfuscateSQLString(sql string) (string, error) { - obfuscatedQuery, err := (*obfuscate.Obfuscator)(o).ObfuscateSQLStringWithOptions(sql, &obfuscateSQLConfig, "") + obfuscatedQuery, err := (*obfuscate.Obfuscator)(o).ObfuscateSQLString(sql) if err != nil { return "", err }