Gathering detailed insights and metrics for @opentelemetry/instrumentation-mysql2
Gathering detailed insights and metrics for @opentelemetry/instrumentation-mysql2
Gathering detailed insights and metrics for @opentelemetry/instrumentation-mysql2
Gathering detailed insights and metrics for @opentelemetry/instrumentation-mysql2
OpenTelemetry instrumentation for JavaScript modules
npm install @opentelemetry/instrumentation-mysql2
Typescript
Module System
Min. Node Version
Node Version
NPM Version
86.2
Supply Chain
92.4
Quality
91
Maintenance
100
Vulnerability
99.6
License
instrumentation-pg: v0.51.0
Published on 28 Jan 2025
instrumentation-mysql2: v0.45.1
Published on 28 Jan 2025
instrumentation-cucumber: v0.14.0
Published on 28 Jan 2025
auto-instrumentations-node: v0.56.0
Published on 28 Jan 2025
instrumentation-fastify: v0.44.1
Published on 20 Jan 2025
instrumentation-aws-lambda: v0.50.2
Published on 20 Jan 2025
TypeScript (97.91%)
JavaScript (2.08%)
Shell (0.01%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
100,640,299
Last Day
589,083
Last Week
2,637,459
Last Month
11,072,537
Last Year
78,612,121
744 Stars
2,214 Commits
549 Forks
17 Watching
16 Branches
458 Contributors
Minified
Minified + Gzipped
Latest Version
0.45.1
Package Id
@opentelemetry/instrumentation-mysql2@0.45.1
Unpacked Size
59.43 kB
Size
14.46 kB
File Count
18
NPM Version
lerna/6.6.2/node@v18.20.5+x64 (linux)
Node Version
18.20.5
Publised On
28 Jan 2025
Cumulative downloads
Total Downloads
Last day
-2%
589,083
Compared to previous day
Last week
-12%
2,637,459
Compared to previous week
Last month
15.1%
11,072,537
Compared to previous month
Last year
331.5%
78,612,121
Compared to previous year
3
1
This module provides automatic instrumentation for the mysql2
module, which may be loaded using the @opentelemetry/sdk-trace-node
package and is included in the @opentelemetry/auto-instrumentations-node
bundle.
If total installation size is not constrained, it is recommended to use the @opentelemetry/auto-instrumentations-node
bundle with @opentelemetry/sdk-node for the most seamless instrumentation experience.
Compatible with OpenTelemetry JS API and SDK 1.0+
.
1npm install --save @opentelemetry/instrumentation-mysql2
mysql2
versions >=1.4.2 <4
OpenTelemetry MySQL2 Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems when working with mysql2.
To load a specific plugin (MySQL2 in this case), specify it in the registerInstrumentations's configuration
1const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); 2const { MySQL2Instrumentation } = require('@opentelemetry/instrumentation-mysql2'); 3const { registerInstrumentations } = require('@opentelemetry/instrumentation'); 4 5const provider = new NodeTracerProvider(); 6provider.register(); 7 8registerInstrumentations({ 9 instrumentations: [ 10 new MySQL2Instrumentation(), 11 ], 12})
You can set the following instrumentation options:
Options | Type | Description |
---|---|---|
responseHook | MySQL2InstrumentationExecutionResponseHook (function) | Function for adding custom attributes from db response |
addSqlCommenterCommentToQueries | boolean | If true, adds sqlcommenter specification compliant comment to queries with tracing context (default false). NOTE: A comment will not be added to queries that already contain -- or /* ... */ in them, even if these are not actually part of comments |
This package uses @opentelemetry/semantic-conventions
version 1.22+
, which implements Semantic Convention Version 1.7.0
Attributes collected:
Attribute | Short Description |
---|---|
db.connection_string | The connection string used to connect to the database. |
db.name | This attribute is used to report the name of the database being accessed. |
db.statement | The database statement being executed. |
db.system | An identifier for the database management system (DBMS) product being used. |
db.user | Username for accessing the database. |
net.peer.name | Remote hostname or similar. |
net.peer.port | Remote port number. |
Apache 2.0 - See LICENSE for more information.
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 14 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More