Skip to content
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

feat(pg): remove support for pg v7 #1393

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.