diff --git a/plugins/node/opentelemetry-plugin-mysql/package.json b/plugins/node/opentelemetry-plugin-mysql/package.json index 8d8c89da93..0fabcd0c21 100644 --- a/plugins/node/opentelemetry-plugin-mysql/package.json +++ b/plugins/node/opentelemetry-plugin-mysql/package.json @@ -46,7 +46,7 @@ "@opentelemetry/test-utils": "^0.9.0", "@opentelemetry/tracing": "0.10.1", "@types/mocha": "7.0.2", - "@types/mysql": "2.15.14", + "@types/mysql": "2.15.15", "@types/node": "12.12.47", "@types/shimmer": "1.0.1", "codecov": "3.7.1", diff --git a/plugins/node/opentelemetry-plugin-mysql/src/types.ts b/plugins/node/opentelemetry-plugin-mysql/src/types.ts index 71ad19e4de..349fadd58a 100644 --- a/plugins/node/opentelemetry-plugin-mysql/src/types.ts +++ b/plugins/node/opentelemetry-plugin-mysql/src/types.ts @@ -14,13 +14,6 @@ * limitations under the License. */ -export type ConnectionConfig = Partial<{ - host: string; - port: number; - database: string; - user: string; -}>; - export type Query = Partial<{ sql: string; }>; diff --git a/plugins/node/opentelemetry-plugin-mysql/src/utils.ts b/plugins/node/opentelemetry-plugin-mysql/src/utils.ts index 98d846f670..662ba1072e 100644 --- a/plugins/node/opentelemetry-plugin-mysql/src/utils.ts +++ b/plugins/node/opentelemetry-plugin-mysql/src/utils.ts @@ -16,7 +16,8 @@ import { Attributes } from '@opentelemetry/api'; import { AttributeNames } from './enums'; -import { ConnectionConfig, Query } from './types'; +import { Query } from './types'; +import { ConnectionConfig, PoolActualConfig } from 'mysql'; /** * Get a span name from a mysql query @@ -49,7 +50,7 @@ function getCommand(query: string | Query) { * * @param config ConnectionConfig */ -export function getConnectionAttributes(config: ConnectionConfig): Attributes { +export function getConnectionAttributes(config: ConnectionConfig | PoolActualConfig): Attributes { const { host, port, database, user } = getConfig(config); return {