You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(instrumentations-mysql): support net.* and database semconv migration (open-telemetry#3288)
This adds support for using `OTEL_SEMCONV_STABILITY_OPT_IN` for controlled migration to stable `net.*` and `db.*` semconv. The `net.*` attributes are controlled by the `http[/dup]` token in `OTEL_SEMCONV_STABILITY_OPT_IN` (as [discussed here](open-telemetry/opentelemetry-js#5663 (comment))) and `db.*` with the `database[/dup]` token.
Refs: open-telemetry/opentelemetry-js#5663
Refs: open-telemetry#2953
Copy file name to clipboardExpand all lines: packages/instrumentation-mysql/README.md
+31-15Lines changed: 31 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,27 +44,43 @@ See [examples/mysql](https://github.com/open-telemetry/opentelemetry-js-contrib/
44
44
45
45
### MySQL instrumentation Options
46
46
47
-
| Options | Type | Default | Description |
48
-
| ------- | ---- | ------- | ----------- |
49
-
|[`enhancedDatabaseReporting`](./src/types.ts#L24)|`boolean`|`false`| If true, an attribute containing the query's parameters will be attached the spans generated to represent the query |
|[`enhancedDatabaseReporting`](./src/types.ts#L24)|`boolean`|`false`| If true, a `db.mysql.values` attribute containing the query's parameters will be add to database spans. Note that this is not an attribute defined in [Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/database/mysql/). |
51
50
52
51
## Semantic Conventions
53
52
54
-
This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)
53
+
This instrumentation implements Semantic Conventions (semconv) v1.7.0. Since then, networking (in semconv v1.23.1) and database (in semconv v1.33.0) semantic conventions were stabilized. As of `@opentelemetry/instrumentation-mysql@0.55.0` support has been added for migrating to the stable semantic conventions using the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable as follows:
54
+
55
+
1. Upgrade to the latest version of this instrumentation package.
56
+
2. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http/dup,database/dup` to emit both old and stable semantic conventions. (The `http` token is used to control the `net.*` attributes, the `database` token to control to `db.*` attributes.)
57
+
3. Modify alerts, dashboards, metrics, and other processes in your Observability system to use the stable semantic conventions.
58
+
4. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http,database` to emit only the stable semantic conventions.
59
+
60
+
By default, if `OTEL_SEMCONV_STABILITY_OPT_IN` includes neither of the above tokens, the old v1.7.0 semconv is used.
61
+
The intent is to provide an approximate 6 month time window for users of this instrumentation to migrate to the new database and networking semconv, after which a new minor version will use the new semconv by default and drop support for the old semconv.
62
+
See [the HTTP migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/) and the [database migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/) for details.
|`db.connection_string`| Removed | The connection string used to connect to the database. |
70
+
|`db.statement`|`db.query.text`| The database query being executed. |
71
+
|`db.user`| Removed | Username for accessing the database. |
72
+
|`db.name`| Removed | Integrated into new `db.namespace`. |
73
+
| (not included) |`db.namespace`| The database associated with the connection, as provided at connection time. (This does not track changes made via `SELECT DATABASE()`.) |
74
+
|`net.peer.name`|`server.address`| Remote hostname or similar. |
75
+
|`net.peer.port`|`server.port`| Remote port number. |
|`db.client.connections.usage`| (removed) | The number of connections currently in a given state. See note below. |
82
+
83
+
Note: While `db.client.connections.usage` was replaced with `db.client.connection.count` in the [semconv database migration](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/#database-client-connection-count), the replacement metric is still unstable, so cannot be enabled via `OTEL_SEMCONV_STABILITY_OPT_IN=database`.
0 commit comments