![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
The metrics agent sends raw points to the zag-daemons where they will be aggregated.
var agent = require('zag-agent')([/* list of all metrics daemon "address:ports" */])
MetricsAgent#counter(String mkey[, Number value])
Increment a counter.
agent.counter("signup")
Increment a counter by a specific value.
agent.counter("search_results", results.length)
MetricsAgent#histogram(String mkey, Number value)
Track a distribution of values. All histograms automatically get a heat map.
agent.histogram("HTTP_server_latency|/index.html", 123)
MetricsAgent#scope(String scope)
Often times all of the metrics in a particular module should be scoped under
the same key. #scope(key)
returns a MetricsAgent
that automatically prepends
that key:
var latency = agent.scope("http_latency")
// This is the same as `agent.counter("http_latency>/index.html")`:
latency.counter("/index.html")
.close()
ing a scoped agent will close the parent agent (they share a socket).
MetricsAgent#on("error", function(err) { })
The socket emitted an error.
MetricsAgent#close()
Close the socket.
agent.close()
FAQs
send metrics to zag-daemon
We found that zag-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
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.