-
Notifications
You must be signed in to change notification settings - Fork 204
Feat: Add Mysql2 and Trilogy db.collection.name
attribute
#1109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
43d24ee
8bd5818
146bd71
f9c244e
6047052
cc43b33
b61e51e
bc7df18
a23b954
f099af3
8134ee3
8328668
8f42fa2
e73b23a
46616da
4af3e2c
d6ffcdf
d9f1975
b8d5a96
68f42ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ def _otel_span_attributes(sql) | |
attributes = _otel_client_attributes(sql) | ||
|
||
if sql | ||
attributes[SemanticConventions::Trace::DB_SQL_TABLE] = db_sql_table_name(sql) if config[:db_sql_table] == :include | ||
attributes[SemanticConventions::Trace::DB_SQL_TABLE] = db_sql_table_name(sql) if db_sql_table_name(sql) && config[:db_sql_table] == :include | ||
|
||
case config[:db_statement] | ||
when :include | ||
|
@@ -98,6 +98,7 @@ def _otel_client_attributes(sql) | |
def db_sql_table_name(sql) | ||
Regexp.last_match(1) if sql =~ TABLE_NAME | ||
rescue StandardError | ||
OpenTelemetry.handle_error(message: 'Error extracting collection name', exception: e) | ||
nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If an error occurs and the attribute is set to Please ensure that the attribute is not set in cases where the table name could not be extracted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made some changes! Will log an error if trouble getting the table name and won't report. Is the error logging here okay? 4af3e2c |
||
end | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.