![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@opentelemetry/sql-common
Advanced tools
@opentelemetry/sql-common is a package that provides common utilities and types for instrumenting SQL databases with OpenTelemetry. It helps in tracing and monitoring SQL queries by providing a standardized way to collect and report telemetry data.
Instrumentation of SQL Queries
This feature allows you to create spans around SQL query executions, which helps in tracing the performance and errors of SQL queries.
const { createSpan, context } = require('@opentelemetry/sql-common');
function executeQuery(query) {
const span = createSpan('executeQuery');
try {
// Execute the SQL query
const result = database.execute(query);
span.setStatus({ code: 0 }); // Success
return result;
} catch (error) {
span.setStatus({ code: 2, message: error.message }); // Error
throw error;
} finally {
span.end();
}
}
Context Propagation
This feature allows you to propagate context across asynchronous operations, ensuring that telemetry data is correctly associated with the originating request.
const { context, setSpan } = require('@opentelemetry/sql-common');
function executeQueryWithContext(query) {
const span = createSpan('executeQueryWithContext');
const ctx = setSpan(context.active(), span);
return context.with(ctx, () => {
try {
// Execute the SQL query
const result = database.execute(query);
span.setStatus({ code: 0 }); // Success
return result;
} catch (error) {
span.setStatus({ code: 2, message: error.message }); // Error
throw error;
} finally {
span.end();
}
});
}
@opentelemetry/instrumentation is a core package for OpenTelemetry that provides a framework for instrumenting various libraries and frameworks. It is more general-purpose compared to @opentelemetry/sql-common, which is specifically focused on SQL databases.
Winston is a popular logging library for Node.js. While it is not specifically designed for telemetry, it can be used to log SQL queries and errors, providing some level of monitoring. However, it lacks the built-in context propagation and span creation features of @opentelemetry/sql-common.
Datadog is a comprehensive monitoring and analytics platform that offers SQL query monitoring as part of its APM (Application Performance Monitoring) suite. It provides more out-of-the-box features compared to @opentelemetry/sql-common but is a paid service.
This is an internal utils package used for the different SQL instrumentations:
FAQs
Utilities for SQL instrumentations
The npm package @opentelemetry/sql-common receives a total of 0 weekly downloads. As such, @opentelemetry/sql-common popularity was classified as not popular.
We found that @opentelemetry/sql-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.