Skip to content

Commit 67a4217

Browse files
committed
feat(instrumentation-pg): copy incubating attribute comments too
1 parent db75c70 commit 67a4217

File tree

1 file changed

+72
-0
lines changed
  • plugins/node/opentelemetry-instrumentation-pg/src

1 file changed

+72
-0
lines changed

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

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,87 @@
1414
* limitations under the License.
1515
*/
1616

17+
/**
18+
* The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation **SHOULD** use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns **SHOULD** document it.
19+
*
20+
* @example myDataSource
21+
*
22+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
23+
*/
1724
export const ATTR_DB_CLIENT_CONNECTION_POOL_NAME =
1825
'db.client.connection.pool.name';
26+
27+
/**
28+
* The state of a connection in the pool
29+
*
30+
* @example idle
31+
*
32+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
33+
*/
1934
export const ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state';
35+
36+
/**
37+
* The name of the database, fully qualified within the server address and port.
38+
*
39+
* @example customers
40+
* @example test.users
41+
*
42+
* @note If a database system has multiple namespace components, they **SHOULD** be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces **SHOULD NOT** be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid.
43+
* Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system.
44+
* It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.
45+
* This attribute has stability level RELEASE CANDIDATE.
46+
*
47+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
48+
*/
2049
export const ATTR_DB_NAMESPACE = 'db.namespace';
50+
51+
/**
52+
* The name of the operation or command being executed.
53+
*
54+
* @example findAndModify
55+
* @example HMSET
56+
* @example SELECT
57+
*
58+
* @note It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.
59+
* If the operation name is parsed from the query text, it **SHOULD** be the first operation name found in the query.
60+
* For batch operations, if the individual operations are known to have the same operation name then that operation name **SHOULD** be used prepended by `BATCH `, otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database system specific term if more applicable.
61+
* This attribute has stability level RELEASE CANDIDATE.
62+
*
63+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
64+
*/
2165
export const ATTR_DB_OPERATION_NAME = 'db.operation.name';
66+
67+
/**
68+
* Enum value "used" for attribute {@link ATTR_DB_CLIENT_CONNECTION_STATE}.
69+
*/
2270
export const DB_CLIENT_CONNECTION_STATE_VALUE_USED = 'used';
71+
72+
/**
73+
* Enum value "idle" for attribute {@link ATTR_DB_CLIENT_CONNECTION_STATE}.
74+
*/
2375
export const DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = 'idle';
76+
77+
/**
78+
* The number of connections that are currently in state described by the `state` attribute
79+
*
80+
* @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
81+
*/
2482
export const METRIC_DB_CLIENT_CONNECTION_COUNT = 'db.client.connection.count';
83+
84+
/**
85+
* The number of current pending requests for an open connection
86+
*
87+
* @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
88+
*/
2589
export const METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS =
2690
'db.client.connection.pending_requests';
91+
92+
/**
93+
* Duration of database client operations.
94+
*
95+
* @note Batch operations **SHOULD** be recorded as a single operation.
96+
*
97+
* @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
98+
*/
2799
export const METRIC_DB_CLIENT_OPERATION_DURATION =
28100
'db.client.operation.duration';

0 commit comments

Comments
 (0)