-
Notifications
You must be signed in to change notification settings - Fork 889
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
Add yaml semantic conventions for Database #928
Add yaml semantic conventions for Database #928
Conversation
**Additional attribute requirements:** At least one of the following sets of attributes is required: | ||
|
||
* [`net.peer.name`](span-general.md) | ||
* [`net.peer.ip`](span-general.md) |
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.
Strictly speaking, this single attribute is not a set, at least not in that notation. Should we add surrounding parentheses in the MD generator or is it clear enough that it is either the first or the second line (not both together as one set)?
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.
+1 to @arminru. I am confused by the reference to "sets".
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.
Would the phrase "At least one of the following is required:" be a good replacement?
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.
If we then add "All of:" to each set with more than one attribute (we have none here, but for example in the HTTP conventions), that would be a good improvement I think.
type: string | ||
brief: > | ||
Username for accessing the database. | ||
examples: ['readonly_user', 'reporting_user'] |
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.
It is not completely obvious in the resulting markdown that these are 2 distinct examples. It was clear in the original markdown. Perhaps remove one of the examples to avoid confusion.
tag: connection-level | ||
required: | ||
conditional: See below. | ||
- ref: net.peer.ip |
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.
Being able to reference other attributes is very nice!
**Additional attribute requirements:** At least one of the following sets of attributes is required: | ||
|
||
* [`net.peer.name`](span-general.md) | ||
* [`net.peer.ip`](span-general.md) |
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.
+1 to @arminru. I am confused by the reference to "sets".
<!-- semconv db.mssql(tag=connection-level-tech-specific,remove_constraints) --> | ||
| Attribute | Type | Description | Example | Required | | ||
|---|---|---|---|---| | ||
| `db.jdbc.driver_classname` | string | The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. | `org.postgresql.Driver`<br>`com.microsoft.sqlserver.jdbc.SQLServerDriver` | No | |
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.
The example is confusing, not clear that it is 2 examples since I can just imagine it one line that is wrapped in a table cell.
Either use one example or enumerate them somehow to make it clear.
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.
this is not new to this document. My suggestion would be to address it in different PR.
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.
In the rendered view it is displayed more nicely:
We could update the markdown generator to add a comma in between, to make it even clearer. That would be a separate issue in https://github.com/open-telemetry/build-tools/, however.
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.
The example is confusing
I think with the new generator, you should either read the YAML source or the rendered markdown. The raw, unrendered markdown tables were barely readable already previously, and with the addition of the type column, its just unreadable IMHO. But that's OK, that's why we use a generator.
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.
Just to make it clear I meant: it is rendered differently by the generator. In the original we had this:
in the new generated version we have this:
I think the usage of "or" in the original version makes it clear that these 2 examples. In the new version it is not so apparent even though they are on 2 separate lines.
We can probably try to improve the generator to add an "or" between examples. Doesn't have to be done in this PR, can be improved in the future. Looks good otherwise to me.
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've created open-telemetry/build-tools#8 to track these changes :)
tag: call-level | ||
type: string | ||
required: | ||
conditional: Required, if `db.statement` is not applicable. |
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.
would be cool to be able to use attribute reference in descriptions as well =)
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.
Yeah, also for generated Javadoc, etc. But that's a rather complex feature as we would need to parse the markdown in the tool then.
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.
beyond small comments from @arminru and @tigrannajaryan it looks good.
<!-- semconv db.mssql(tag=connection-level-tech-specific,remove_constraints) --> | ||
| Attribute | Type | Description | Example | Required | | ||
|---|---|---|---|---| | ||
| `db.jdbc.driver_classname` | string | The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. | `org.postgresql.Driver`<br>`com.microsoft.sqlserver.jdbc.SQLServerDriver` | No | |
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.
Just to make it clear I meant: it is rendered differently by the generator. In the original we had this:
in the new generated version we have this:
I think the usage of "or" in the original version makes it clear that these 2 examples. In the new version it is not so apparent even though they are on 2 separate lines.
We can probably try to improve the generator to add an "or" between examples. Doesn't have to be done in this PR, can be improved in the future. Looks good otherwise to me.
please rebase so I can merge this PR. |
* Add yaml semantic conventions for Database * Address feedback
Changes
Updated Database semantic convention to the YAML format.
Related issues #547