-
Notifications
You must be signed in to change notification settings - Fork 407
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
feat: Added segment synthesis for db client otel spans to db trace #2820
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2820 +/- ##
=======================================
Coverage 97.26% 97.27%
=======================================
Files 297 299 +2
Lines 46907 46983 +76
=======================================
+ Hits 45626 45702 +76
Misses 1281 1281
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems straightforward enough.
return this.createExternalSegment(otelSpan) | ||
} else if (rule.type === 'db') { | ||
return this.createDatabaseSegment(otelSpan) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file is going to become difficult to understand if we keep adding methods to it. We'll probably want to split things out after we PoC everything to stuff like return new DatabaseSegment(otelSpan)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea. Ive already noted that for the next story I do
Description
The transformation rules key off of client as span kind and db.system to do its matching. However some of the required attributes for naming do not exist in Node.js opentelemetry instrumetation. Most
db.sql.table
. For traditional sql database libs we must parse the SQL to extract the operation and table. I also cross referenced our instrumentation to determine how we name segments for databases:Segment naming for all dbs:
Datastore/statement/MySQL/<table>/<operation>
Datastore/statement/Postgres/<table>/<operation>
Datastore/operation/Redis/<operation>
Datastore/statement/MongoDB/<collection
orDatastore/operation/MongoDB/<operation>
Datastore/statement/ElasticSearch/<index>/<operation>
orDatastore/operation/ElasticSearch/<operation>
Datastore/statement/Cassandra/<keyspace>.<table>/<operation>
orDatastore/operation/Cassandra/<operation>
Datastore/operation/Memcache/<operation>
The only difference here will be mongodb/elasticsearch as all will be prefixed with
Datastore/statement
How to Test
Related Issues
Closes #2647