File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
packages/instrumentation-mysql/src Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import {
3131 DB_SYSTEM_VALUE_MYSQL ,
3232 ATTR_DB_STATEMENT ,
3333 ATTR_DB_SYSTEM ,
34+ METRIC_DB_CLIENT_CONNECTIONS_USAGE ,
3435} from './semconv' ;
3536import type * as mysqlTypes from 'mysql' ;
3637import { AttributeNames } from './AttributeNames' ;
@@ -63,7 +64,7 @@ export class MySQLInstrumentation extends InstrumentationBase<MySQLInstrumentati
6364
6465 protected override _updateMetricInstruments ( ) {
6566 this . _connectionsUsage = this . meter . createUpDownCounter (
66- 'db.client.connections.usage' , //TODO:: use semantic convention
67+ METRIC_DB_CLIENT_CONNECTIONS_USAGE ,
6768 {
6869 description :
6970 'The number of connections that are currently in state described by the state attribute.' ,
Original file line number Diff line number Diff line change @@ -106,3 +106,13 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const;
106106 * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
107107 */
108108export const DB_SYSTEM_VALUE_MYSQL = 'mysql' as const ;
109+
110+ /**
111+ * Deprecated, use `db.client.connection.count` instead.
112+ *
113+ * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
114+ *
115+ * @deprecated Replaced by `db.client.connection.count`.
116+ */
117+ export const METRIC_DB_CLIENT_CONNECTIONS_USAGE =
118+ 'db.client.connections.usage' as const ;
You can’t perform that action at this time.
0 commit comments