-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: collect pg db.collection_name attribute (#1087)
The db.collection.name attribute is conditionally required for Database spans. This PR uses regex to detect the collection name (called table name in PG) and report it as the db.collection.name attribute for PG instrumentation. --------- Co-authored-by: Ariel Valentin <arielvalentin@users.noreply.github.com> Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
- Loading branch information
1 parent
cac6b47
commit 70fdad6
Showing
4 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[ | ||
{ | ||
"name": "from", | ||
"sql": "SELECT * FROM test_table" | ||
}, | ||
{ | ||
"name": "select_count_from", | ||
"sql": "SELECT COUNT(*) FROM test_table WHERE condition" | ||
}, | ||
{ | ||
"name": "from_with_subquery", | ||
"sql": "SELECT * FROM (SELECT * FROM test_table) AS table_alias" | ||
}, | ||
{ | ||
"name": "insert_into", | ||
"sql": "INSERT INTO test_table (column1, column2) VALUES (value1, value2)" | ||
}, | ||
{ | ||
"name": "update", | ||
"sql": "UPDATE test_table SET column1 = value1 WHERE condition" | ||
}, | ||
{ | ||
"name": "delete_from", | ||
"sql": "DELETE FROM test_table WHERE condition" | ||
}, | ||
{ | ||
"name": "create_table", | ||
"sql": "CREATE TABLE test_table (column1 datatype, column2 datatype)" | ||
}, | ||
{ | ||
"name": "create_table_if_not_exists", | ||
"sql": "CREATE TABLE IF NOT EXISTS test_table (column1 datatype, column2 datatype)" | ||
}, | ||
{ | ||
"name": "alter_table", | ||
"sql": "ALTER TABLE test_table ADD column_name datatype" | ||
}, | ||
{ | ||
"name": "drop_table", | ||
"sql": "DROP TABLE test_table" | ||
}, | ||
{ | ||
"name": "drop_table_if_exists", | ||
"sql": "DROP TABLE IF EXISTS test_table" | ||
}, | ||
{ | ||
"name": "insert_into", | ||
"sql": "INSERT INTO test_table values('', 'a''b c',0, 1 , 'd''e f''s h')" | ||
}, | ||
{ | ||
"name": "from_with_join", | ||
"sql": "SELECT columns FROM test_table JOIN table2 ON test_table.column = table2.column" | ||
} | ||
] |
This file contains 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