4.1.1 • Published 9 months ago
@sigyn/agent v4.1.1
🚧 Requirements
- Node.js version 20 or higher
🚀 Getting Started
This package is available in the Node Package Repository and can be easily installed with npm or yarn
$ npm i @sigyn/agent
# or
$ yarn add @sigyn/agentAdd environment variables
$ touch .envAdd these variables:
# Required
GRAFANA_API_TOKEN=your_token
# Default to sigyn.sqlite3
SIGYN_DB=your_dbAdd Sigyn config
$ touch sigyn.config.jsonPlease see here for config documentation
📚 Usage
import { start } from "@sigyn/agent";
await start();🌐 API
start(location?: string, options?: StartOptions): Promise<ToadScheduler>
Run Sigyn agent. It will fetch logs depending your rules polling and send alerts when count threshold is reached.
location: stringOptional, default toprocess.cwd(). The path to your SQLite database, it will create the file if it doesn't exists but the directory must exists.options.logger: LoggerOptional, default topino. You can use your own logger which must be an object with theses 3 methods:debug,info&error.options.levelOptional, only works if no logger given. Set log level:"info" | "debug" | "error".options.timeoutOptional, you can provide a timeout for Grafana API requests. Default:30_000.
The returned scheduler instance allow you to put some extra logic if needed, see API for scheduler.
🖋️ Interfaces
interface Logger {
info: (message: string) => void;
error: (message: string) => void;
debug: (message: string) => void;
}
interface StartOptions {
logger?: Logger;
level?: "info" | "debug" | "error";
timeout?: number;
}License
MIT
4.1.1
9 months ago
4.1.0
1 year ago
4.0.1
1 year ago
4.0.0
2 years ago
3.4.1
2 years ago
3.4.0
2 years ago
3.3.0
2 years ago
3.2.1
2 years ago
3.2.0
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.0
2 years ago
2.6.0
2 years ago
2.5.1
2 years ago
2.5.0
2 years ago
2.4.1
2 years ago
2.4.0
2 years ago
2.3.1
2 years ago
2.3.0
2 years ago
2.2.0
2 years ago
2.1.0
2 years ago
2.0.0
2 years ago
1.0.0
2 years ago