Skip to content

Commit

Permalink
Convert Oracle PDB and CDB tags to lowecase (DataDog#18907)
Browse files Browse the repository at this point in the history
* eliminate duplicate pdb and cdb tags

* Update releasenotes/notes/oracle-duplicate-uppercase-tags-d3548c99c3139903.yaml

Co-authored-by: Heston Hoffman <[email protected]>

---------

Co-authored-by: Heston Hoffman <[email protected]>
  • Loading branch information
nenadnoveljic and hestonhoffman authored Aug 29, 2023
1 parent 03d062c commit 59bc18b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/collector/corechecks/oracle-dbm/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (c *Check) Connect() (*sqlx.DB, error) {
db.SetMaxOpenConns(MAX_OPEN_CONNECTIONS)

if c.cdbName == "" {
row := db.QueryRow("SELECT /* DD */ name FROM v$database")
row := db.QueryRow("SELECT /* DD */ lower(name) FROM v$database")
err = row.Scan(&c.cdbName)
if err != nil {
return nil, fmt.Errorf("failed to query db name: %w", err)
Expand Down Expand Up @@ -462,7 +462,7 @@ func appendPDBTag(tags []string, pdb sql.NullString) []string {
if !pdb.Valid {
return tags
}
return append(tags, "pdb:"+pdb.String)
return append(tags, "pdb:"+strings.ToLower(pdb.String))
}

func selectWrapper[T any](c *Check, s T, sql string, binds ...interface{}) error {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Each section from every release note are combined when the
# CHANGELOG.rst is rendered. So the text needs to be worded so that
# it does not depend on any information only available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
fixes:
- |
Eliminate duplicate upper case ``cdb`` and ``pdb`` tags.

0 comments on commit 59bc18b

Please sign in to comment.