![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@cs-chatbots/knex-prometheus-exporter
Advanced tools
Prometheus exporter for knex
npm i -S knex-prometheus-exporter prom-client
Knex exporter
Metrics:
# HELP knex_query_duration_seconds histogram of query responses
# TYPE knex_query_duration_seconds histogram
knex_query_duration_seconds_bucket{le="0.003"} 1
knex_query_duration_seconds_bucket{le="0.03"} 2
knex_query_duration_seconds_bucket{le="0.1"} 2
knex_query_duration_seconds_bucket{le="0.3"} 2
knex_query_duration_seconds_bucket{le="1.5"} 2
knex_query_duration_seconds_bucket{le="10"} 2
knex_query_duration_seconds_bucket{le="+Inf"} 2
knex_query_duration_seconds_sum 0.021
knex_query_duration_seconds_count 2
# HELP knex_query_errors_total counter of query errors with labels: error
# TYPE knex_query_errors_total counter
knex_query_errors_total 0
knex_query_errors_total{error="error message"} 1
Parameters
knex
Knex knex instanceopts
Object? options
opts.register
String? register to useopts.labels
Object extra labels (optional, default {}
)opts.prefix
String metric name prefix (optional, default "knex_"
)opts.queryDurarionName
String query duration metric name (histogram) (optional, default "query_duration_seconds"
)opts.responseTimeBuckets
Array<Number> query duration buckets (optional, default [0.003,0.03,0.1,0.3,1.5,10]
)opts.queryErrorName
String query errorr total name (counter) (optional, default "query_errors_total"
)opts.queryErrorWithErrorLabel
Boolean collect err.message as "error" label (optional, default true
)Examples
const promClient = require('prom-client');
const Knex = require('knex');
const knexExporter = require('knex-prometheus-exporter');
const knex = Knex({
client: 'mysql'
...
});
const exporter = knexExporter(knex);
console.log(promClient.register.metrics())
// =>
// # HELP knex_query_duration_seconds histogram of query responses
// # TYPE knex_query_duration_seconds histogram
// knex_query_duration_seconds_bucket{le="0.003"} 1
// knex_query_duration_seconds_bucket{le="0.03"} 2
// knex_query_duration_seconds_bucket{le="0.1"} 2
// knex_query_duration_seconds_bucket{le="0.3"} 2
// knex_query_duration_seconds_bucket{le="1.5"} 2
// knex_query_duration_seconds_bucket{le="10"} 2
// knex_query_duration_seconds_bucket{le="+Inf"} 2
// knex_query_duration_seconds_sum 0.021
// knex_query_duration_seconds_count 2
// # HELP knex_query_errors_total counter of query errors with labels: error
// # TYPE knex_query_errors_total counter
// knex_query_errors_total 0
// knex_query_errors_total{error="error message"} 1
// Unsubscribe:
exporter.off();
Returns Object { off, registry }- off: unscribe from metrics, registry: prom-client registry
FAQs
Knex Prometheus exporter
The npm package @cs-chatbots/knex-prometheus-exporter receives a total of 3 weekly downloads. As such, @cs-chatbots/knex-prometheus-exporter popularity was classified as not popular.
We found that @cs-chatbots/knex-prometheus-exporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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.