Skip to content

Commit 54275e8

Browse files
committed
Merge branch 'update-sem-pg' of github.com:maryliag/opentelemetry-js-contrib into update-sem-pg
2 parents d304167 + 658133f commit 54275e8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/instrumentation-pg/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ PostgreSQL instrumentation has few options available to choose from. You can set
5656
Prior to version `0.55.0`, this instrumentation created spans and metrics targeting an experimental semantic convention Version 1.27.0.
5757

5858
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.
59+
`@opentelemetry/instrumentation-pg` versions 0.55.0 and later include support for migrating to stable Database semantic conventions, as described below.
6060
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.
6161

6262
To select which semconv version(s) is emitted from this instrumentation, use the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable.

packages/instrumentation-pg/test/pg-pool.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,10 @@ describe('pg semantic conventions env variable', () => {
994994
const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available
995995
const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker
996996
const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default)
997+
// Here we are `require`ing *before* the instrumentation is created below.
998+
// In *general* this is a potential instrumentation issue, but this works for
999+
// `pg-pool` instrumentation because it patches the `pgPool.prototype`
1000+
// (i.e. not a top-level export).
9971001
const pgPool = require('pg-pool');
9981002
pool = new pgPool(CONFIG);
9991003

0 commit comments

Comments
 (0)