Skip to content

Commit 582bb44

Browse files
committed
feat(instrumentation-pg): copy incubating attribute names from @opentelemetry/semantic-conventions/incubating package
1 parent 5679d8b commit 582bb44

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import {
6565
METRIC_DB_CLIENT_OPERATION_DURATION,
6666
ATTR_DB_NAMESPACE,
6767
ATTR_DB_OPERATION_NAME,
68-
} from '@opentelemetry/semantic-conventions/incubating';
68+
} from './semconv';
6969

7070
export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConfig> {
7171
private _operationDuration!: Histogram;
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+
17+
export const ATTR_DB_CLIENT_CONNECTION_POOL_NAME =
18+
'db.client.connection.pool.name';
19+
export const ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state';
20+
export const ATTR_DB_NAMESPACE = 'db.namespace';
21+
export const ATTR_DB_OPERATION_NAME = 'db.operation.name';
22+
export const DB_CLIENT_CONNECTION_STATE_VALUE_USED = 'used';
23+
export const DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = 'idle';
24+
export const METRIC_DB_CLIENT_CONNECTION_COUNT = 'db.client.connection.count';
25+
export const METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS =
26+
'db.client.connection.pending_requests';
27+
export const METRIC_DB_CLIENT_OPERATION_DURATION =
28+
'db.client.operation.duration';

plugins/node/opentelemetry-instrumentation-pg/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
ATTR_DB_CLIENT_CONNECTION_STATE,
4343
DB_CLIENT_CONNECTION_STATE_VALUE_USED,
4444
DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,
45-
} from '@opentelemetry/semantic-conventions/incubating';
45+
} from './semconv';
4646
import {
4747
PgClientExtended,
4848
PostgresCallback,

plugins/node/opentelemetry-instrumentation-pg/test/pg-pool.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import {
5555
METRIC_DB_CLIENT_CONNECTION_COUNT,
5656
METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,
5757
METRIC_DB_CLIENT_OPERATION_DURATION,
58-
} from '@opentelemetry/semantic-conventions/incubating';
58+
} from '../src/semconv';
5959

6060
const memoryExporter = new InMemorySpanExporter();
6161

plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import {
5656
import {
5757
METRIC_DB_CLIENT_OPERATION_DURATION,
5858
ATTR_DB_OPERATION_NAME,
59-
} from '@opentelemetry/semantic-conventions/incubating';
59+
} from '../src/semconv';
6060
import { addSqlCommenterComment } from '@opentelemetry/sql-common';
6161

6262
const memoryExporter = new InMemorySpanExporter();

0 commit comments

Comments
 (0)