Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spm-agent

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spm-agent - npm Package Compare versions

Comparing version 1.24.5 to 1.24.6

   

4

lib/agent.js

@@ -75,5 +75,7 @@ /*

var line = ''
if ((/collectd\-/.test(metric.name))) {
if ((/collectd.*\-/.test(metric.name))) {
if (/collectd\-cpu/.test(metric.name)) {
line = (now2 + '\t' + metric.name + '-' + dateString + ',' + metricsTs2 + ',' + metric.value)
} else if (/disk\-space/.test(metric.name)) {
line = (now + '\t' + metric.name + '-' + dateString + ',' + metricsTs2 + ',' + metric.value.toFixed(3))
} else {

@@ -80,0 +82,0 @@ line = now2 + '\t' + metric.name + '\t' + metricsTs2 + ',' + metric.value

@@ -199,4 +199,5 @@ /*

SpmSender.prototype.formatLine = function (metric) {
logger.debug(metric.spmLine)
return metric.spmLine
var line = metric.spmLine
logger.debug(line)
return line
}

@@ -203,0 +204,0 @@ /**

{
"name": "spm-agent",
"version": "1.24.5",
"version": "1.24.6",
"description": "Node.js agent framework for SPM by Sematext",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -1,2 +0,41 @@

# spm-agent
SPM Agent Framework for NodeJS
# SPM Agent Framework for Node.js
## Functionality
- Sender interface to SPM backend receivers
- Buffering metrics to disk in case of network outages (using NeDB)
- Limit the file size of buffers
- Reconnect after failures
- Logging functions
- Configuration handling
- Pluggable agents
Example to implement a monitoring agent:
```js
var SpmAgent = require('spm-agent')
var client = new SpmAgent()
var testAgent = client.createAgent(new SpmAgent.Agent ({
start: function (agent) {
// initialize your metrics collector ...
this.tid = setInterval(function () {
// get every 30 seconds some metrics
// SPM gets an array of metrics for a specific app
agent.addMetrics({name: 'test-app', value: [1, 2, 3]})
}, client.config.collectionInterval)
}
}))
// monitor which values we added by "addMetrics"
testAgent.on ('metrics', console.log)
```
Currently spm-agent is part of
- [spm-agent-nodejs](https://github.com/sematext/spm-agent-nodejs) and
- [spm-agent-docker](https://github.com/sematext/spm-agent-docker)
Let us know about monitoring agents you need, maybe you like to contribute with your domain expertise!
## Related Modules
Please check [spm-metrics-js](https://github.com/sematext/spm-metrics-js) to ship your application specific metrics to SPM.

@@ -36,4 +36,7 @@ /*

setTimeout(function () {
agent.addMetrics({name: 'collectd5-disk-space-used\tdf-xvda1/df_complex-used', value: 3380457472.0, sct: 'OS'})
agent.addMetrics({name: 'test', sct: 'OS', value: [1, 2, 3]})
agent.addMetrics({name: 'test', value: [1, 2, 3]})
//console.log ('add Metric')

@@ -40,0 +43,0 @@ }, 900)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc