Skip to content

Commit 044353c

Browse files
nicohrubecclaude
andcommitted
ref(node): Vendor @opentelemetry/instrumentation-pg
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f1723da commit 044353c

14 files changed

Lines changed: 1486 additions & 26 deletions

File tree

.oxlintrc.base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@
158158
"**/integrations/tracing/mongoose/vendored/**/*.ts",
159159
"**/integrations/tracing/amqplib/vendored/**/*.ts",
160160
"**/integrations/tracing/prisma/vendored/**/*.ts",
161-
"**/integrations/tracing/graphql/vendored/**/*.ts"
161+
"**/integrations/tracing/graphql/vendored/**/*.ts",
162+
"**/integrations/tracing/postgres/vendored/**/*.ts"
162163
],
163164
"rules": {
164165
"typescript/no-explicit-any": "off"

packages/node/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"@opentelemetry/instrumentation": "^0.214.0",
7171
"@opentelemetry/instrumentation-http": "0.214.0",
7272
"@opentelemetry/sql-common": "^0.41.2",
73-
"@opentelemetry/instrumentation-pg": "0.66.0",
7473
"@opentelemetry/sdk-trace-base": "^2.6.1",
7574
"@opentelemetry/semantic-conventions": "^1.40.0",
7675
"@fastify/otel": "0.18.0",

packages/node/src/integrations/tracing/postgres.ts renamed to packages/node/src/integrations/tracing/postgres/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
1+
import { PgInstrumentation } from './vendored/instrumentation';
22
import type { IntegrationFn } from '@sentry/core';
33
import { defineIntegration } from '@sentry/core';
44
import { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* NOTICE from the Sentry authors:
17+
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/ed97091c9890dd18e52759f2ea98e9d7593b3ae4/packages/instrumentation-pg
18+
* - Upstream version: @opentelemetry/instrumentation-pg@0.66.0
19+
*/
20+
/* eslint-disable */
21+
22+
// Postgresql specific attributes not covered by semantic conventions
23+
export enum AttributeNames {
24+
PG_VALUES = 'db.postgresql.values',
25+
PG_PLAN = 'db.postgresql.plan',
26+
IDLE_TIMEOUT_MILLIS = 'db.postgresql.idle.timeout.millis',
27+
MAX_CLIENT = 'db.postgresql.max.client',
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* NOTICE from the Sentry authors:
17+
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/ed97091c9890dd18e52759f2ea98e9d7593b3ae4/packages/instrumentation-pg
18+
* - Upstream version: @opentelemetry/instrumentation-pg@0.66.0
19+
*/
20+
/* eslint-disable */
21+
22+
// Contains span names produced by instrumentation
23+
export enum SpanNames {
24+
QUERY_PREFIX = 'pg.query',
25+
CONNECT = 'pg.connect',
26+
POOL_CONNECT = 'pg-pool.connect',
27+
}

0 commit comments

Comments
 (0)