-
Notifications
You must be signed in to change notification settings - Fork 253
Add in Surreal DB client spans #1107 #2571
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
base: main
Are you sure you want to change the base?
Add in Surreal DB client spans #1107 #2571
Conversation
Is there an instrumentation that needs it? Please also provide links to prototype(s) |
db5fa6e
to
edff90b
Compare
yes, there is and the health check example was already linked. Have added client library example as well. |
docs/database/surrealdb.md
Outdated
| [`db.operation.name`](/docs/registry/attributes/db.md) | string | The name of the operation or command being executed. [9] | `EXECUTE`; `INSERT` | `Recommended` [10] |  | | ||
| [`db.query.summary`](/docs/registry/attributes/db.md) | string | Low cardinality summary of a database query. [11] | `SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id` | `Recommended` [12] |  | | ||
| [`db.query.text`](/docs/registry/attributes/db.md) | string | The database query being executed. [13] | `SELECT * FROM wuser_table where username = ?`; `SET mykey ?` | `Recommended` [14] |  | | ||
| [`db.stored_procedure.name`](/docs/registry/attributes/db.md) | string | The name of a stored procedure within the database. [15] | `GetCustomer` | `Recommended` [16] |  | |
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.
question: SurrealDB does not provide a notion of Stored procedure but a similar one named Functions, see https://surrealdb.com/docs/surrealql/statements/define/function. Should we keep the name using Functions, or should we rename that attribute?
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.
Will update the description of the attribute to indicate that these are referred to as functions in surrealdb.
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.
Changes have been made.
docs/database/surrealdb.md
Outdated
|
||
**[1] `db.namespace`:** If a database system has multiple namespace components (e.g. schema name and database name), they SHOULD be concatenated | ||
from the most general to the most specific namespace component, | ||
using `|` as a separator between the components. |
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.
suggestion: given that SurrealDB has a notion of both namespace & database for each client, shouldn't we add a small section around this specific feature, associated with a proper example? (e.g. Namespace|Database
?)
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.
Can do
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.
Done
docs/database/surrealdb.md
Outdated
|
||
**[8] `db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. | ||
|
||
**[9] `db.operation.name`:** The operation name SHOULD NOT be extracted from `db.query.text`. |
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.
suggestion: A good idea would be to list all possible operation names, given we already have that here: https://github.com/surrealdb/surrealdb/blob/3540101309327da9f2f9336a3d0486f4ae41f455/crates/core/src/rpc/method.rs#L3
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.
What I will do is update the description to indicate that the operation name should be set based on the api method being called.
836c630
to
086d88e
Compare
@Odonno it would be appreciated if you could give this another review from the surrealdb perspective. 🙂 |
086d88e
to
865b839
Compare
|
||
**[6] `db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. | ||
|
||
**[7] `db.operation.name`:** The operation name is to reflect the api method being called ie upsert. |
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.
suggestion: I would have expect a list item or table for each operation name, so that every client uses the same name/convention. What do you think?
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 have looked at other db provider docs and none of them except for cosmosdb provide table/lists of operation names.
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.
Gonna add @kearfy as a second reviewer
Progresses #1107
Changes
This adds SurrealDB as a db system, so that it can be used in telemetry and defines client spans.
Usage Example
Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.
Merge requirement checklist
[chore]