@kaname-png/plugin-influxdb v1.3.1
@kaname-png/plugin-influxdb
Plugin for @sapphire/framework to post stats on InfluxDB.
Description
This plugin lets you send your bot's statistics to InfluxDB
More information about InfluxDB can be found on its website.
Features
- Fully ready for TypeScript!
- Includes ESM ready entrypoint
- Easy to use
Installation
@kaname-png/plugin-influxDB
depends on the following packages. Be sure to install these along with this package!
You can use the following command to install this package, or replace npm install
with your package manager of choice.
npm install @kaname-png/plugin-sentry @influxdata/influxdb-client @sapphire/framework discord.js
Usage
If your register the plugin:
import '@kaname-png/plugin-influxdb/register'
const client = new SapphireClient({
/* your bot options */
analytics: {
loadDefaultListeners: true, // (Optional) Load the default events .
// option to passed influxdb deps
}
});
async function main() {
await client.login();
}
void main();
OR
The first step, is to import the Client from the package:
import { Client } from '@kaname-png/plugin-influxdb';
You can choose between defining the options explicitly, in the following manner:
const client = new Client({ url: 'https://example.org', token: 'my-secret-token' });
Or defining the options via environment variables, they are:
Client:
INFLUX_OPTIONS_STRING
: A connection string, overrides all the options below.INFLUX_URL
:ConnectionOptions.url
, the base URL to be used.INFLUX_PROXY_URL
:ConnectionOptions.proxyUrl
, the full HTTP web proxy URL including schema.INFLUX_TIMEOUT
:ConnectionOptions.timeout
, the socket timeout, defaults to 10 seconds. If defined, this will be parsed and validated to a number.INFLUX_TOKEN
:ConnectionOptions.token
, the authentication token.
API:
INFLUX_ORG
:Client.Options.org
, the organization to use for the query and write APIs.INFLUX_WRITE_BUCKET
:Client.Options.writeBucket
, the bucket to write to in the write API.INFLUX_WRITE_PRECISION
:Client.Options.writePrecision
, the write precision to use in the write API.
Note: If
Client.Options.org
is unset, none of the APIs will be created. Note: IfClient.Options.writeBucket
is unset, the Write API will not be created.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
14 days ago
3 months ago
3 months ago
8 months ago
8 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
8 months ago
8 months ago
6 months ago
8 months ago
6 months ago
8 months ago
7 months ago
8 months ago
6 months ago
7 months ago
6 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago