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
Copy file name to clipboardExpand all lines: plugins/node/opentelemetry-instrumentation-pg/README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,48 @@ PostgreSQL instrumentation has few options available to choose from. You can set
51
51
|`requireParentSpan`|`boolean`| If true, requires a parent span to create new spans (default false) |
52
52
|`addSqlCommenterCommentToQueries`|`boolean`| If true, adds [sqlcommenter](https://github.com/open-telemetry/opentelemetry-sqlcommenter) specification compliant comment to queries with tracing context (default false). _NOTE: A comment will not be added to queries that already contain `--` or `/* ... */` in them, even if these are not actually part of comments_|
53
53
54
+
## Semantic Conventions
55
+
56
+
Prior to version `0.55.0`, this instrumentation created spans and metrics targeting an experimental semantic convention Version 1.27.0.
57
+
58
+
Database semantic conventions (semconv) were stabilized in v1.34.0, and a [migration process](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/db-migration.md) was defined.
59
+
`opentelemetry-instrumentation-pg` versions 0.55.0 and later include support for migrating to stable Database semantic conventions, as described below.
60
+
The intent is to provide an approximate 6 month time window for users of this instrumentation to migrate to the new Database semconv, after which a new minor version will use the *new* semconv by default and drop support for the old semconv.
61
+
62
+
To select which semconv version(s) is emitted from this instrumentation, use the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable.
63
+
64
+
-`database`: emit the new (stable) v1.34.0+ semantics
65
+
-`database/dup`: emit **both** the old v1.27.0 and the new (stable) v1.34.0+ semantics
66
+
- By default, if `OTEL_SEMCONV_STABILITY_OPT_IN` includes neither of the above tokens, the old v1.27.0 semconv is used.
67
+
68
+
### Attributes collected
69
+
70
+
| v1.27.0 semconv | v1.34.0 semconv | Short Description |
* If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
116
116
*
117
117
* Note: In some SQL databases, the database name to be used is called "schema name".
118
118
*
119
119
*/
120
-
exportconstATTR_DB_NAME="db.name";
120
+
exportconstATTR_DB_NAME='db.name';
121
121
122
122
/**
123
123
* The connection string used to connect to the database. It is recommended to remove embedded credentials.
0 commit comments