Skip to content

Commit

Permalink
feat(pg): remove support for pg v7 (open-telemetry#1393)
Browse files Browse the repository at this point in the history
Co-authored-by: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com>
  • Loading branch information
blumamir and haddasbronfman authored Feb 15, 2023
1 parent 3e76af6 commit ae6d4f3
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 95 deletions.
4 changes: 0 additions & 4 deletions plugins/node/opentelemetry-instrumentation-pg/.tav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ pg:
peerDependencies: pg-pool@^3
pretest: npm run --prefix ../../../ lerna:link
commands: npm run test
- versions: "7.3.0 || 7.12.1 || 7.18.2"
peerDependencies: pg-pool@^2
pretest: npm run --prefix ../../../ lerna:link
commands: npm run test
2 changes: 1 addition & 1 deletion plugins/node/opentelemetry-instrumentation-pg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-pg

### Supported Versions

- `>=7 <9`
- `>=8 <9`

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class PgInstrumentation extends InstrumentationBase {
protected init() {
const modulePG = new InstrumentationNodeModuleDefinition<typeof pgTypes>(
'pg',
['7.*', '8.*'],
['8.*'],
moduleExports => {
if (isWrapped(moduleExports.Client.prototype.query)) {
this._unwrap(moduleExports.Client.prototype, 'query');
Expand Down
12 changes: 0 additions & 12 deletions plugins/node/opentelemetry-instrumentation-pg/test/pg-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ import {
SemanticAttributes,
DbSystemValues,
} from '@opentelemetry/semantic-conventions';
import { isSupported } from './utils';

const pgVersion = require('pg/package.json').version;
const nodeVersion = process.versions.node;

const memoryExporter = new InMemorySpanExporter();

Expand Down Expand Up @@ -118,21 +114,13 @@ describe('pg-pool', () => {
const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default)

before(function () {
const skipForUnsupported =
process.env.IN_TAV && !isSupported(nodeVersion, pgVersion);
const skip = () => {
// this.skip() workaround
// https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
this.test!.parent!.pending = true;
this.skip();
};

if (skipForUnsupported) {
console.error(
` pg - skipped - node@${nodeVersion} and pg@${pgVersion} are not compatible`
);
skip();
}
if (!shouldTest) {
skip();
}
Expand Down
12 changes: 0 additions & 12 deletions plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ import {
SemanticAttributes,
DbSystemValues,
} from '@opentelemetry/semantic-conventions';
import { isSupported } from './utils';
import { addSqlCommenterComment } from '../src/utils';

const pgVersion = require('pg/package.json').version;
const nodeVersion = process.versions.node;

const memoryExporter = new InMemorySpanExporter();

const CONFIG = {
Expand Down Expand Up @@ -120,21 +116,13 @@ describe('pg', () => {
}

before(async function () {
const skipForUnsupported =
process.env.IN_TAV && !isSupported(nodeVersion, pgVersion);
const skip = () => {
// this.skip() workaround
// https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
this.test!.parent!.pending = true;
this.skip();
};

if (skipForUnsupported) {
console.error(
` pg - skipped - node@${nodeVersion} and pg@${pgVersion} are not compatible`
);
skip();
}
if (!shouldTest) {
skip();
}
Expand Down
65 changes: 0 additions & 65 deletions plugins/node/opentelemetry-instrumentation-pg/test/utils.ts

This file was deleted.

0 comments on commit ae6d4f3

Please sign in to comment.