File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
packages/instrumentation-mongodb/src Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
3737 ATTR_NET_PEER_NAME ,
3838 ATTR_NET_PEER_PORT ,
3939 DB_SYSTEM_VALUE_MONGODB ,
40+ METRIC_DB_CLIENT_CONNECTIONS_USAGE ,
4041} from './semconv' ;
4142import { MongoDBInstrumentationConfig , CommandResult } from './types' ;
4243import {
@@ -74,7 +75,7 @@ export class MongoDBInstrumentation extends InstrumentationBase<MongoDBInstrumen
7475
7576 override _updateMetricInstruments ( ) {
7677 this . _connectionsUsage = this . meter . createUpDownCounter (
77- 'db.client.connections.usage' ,
78+ METRIC_DB_CLIENT_CONNECTIONS_USAGE ,
7879 {
7980 description :
8081 'The number of connections that are currently in state described by the state attribute.' ,
Original file line number Diff line number Diff line change @@ -118,3 +118,13 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const;
118118 * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
119119 */
120120export const DB_SYSTEM_VALUE_MONGODB = 'mongodb' as const ;
121+
122+ /**
123+ * Deprecated, use `db.client.connection.count` instead.
124+ *
125+ * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
126+ *
127+ * @deprecated Replaced by `db.client.connection.count`.
128+ */
129+ export const METRIC_DB_CLIENT_CONNECTIONS_USAGE =
130+ 'db.client.connections.usage' as const ;
You can’t perform that action at this time.
0 commit comments