Registry / devops / mao-service-discovery

mao-service-discovery

JSON →
library1.6.9-linux-rc1-master-ce9e7335ddfe100f41c491e412cc5a9311427593.0jsnpmunverified

Mao Service Discovery is a service discovery and monitoring tool that supports gRPC streams, ICMP ping, and etcd for service registration. Version 1.6.9-linux-rc1 is a release candidate for Linux. It provides a Web GUI, RESTful API, and config persistence. It is designed for microservices environments where traditional DNS-based discovery may not be sufficient. The project uses etcd v3 as its backend and supports both ICMPv4 and ICMPv6 for health checks. It has no stable release yet and is developed by a single maintainer.

npm install mao-service-discovery
INSTALL
IMPORT
SIG · MAO-SERVICE-DISCOV
M
mao-service-discovery
devopsjavascriptv1.6.9-linux-rc1-master-ce9e7335ddfe100f41c491e412cc5a9311427593.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ServiceDiscovery
import { ServiceDiscovery } from 'mao-service-discovery'
const ServiceDiscovery = require('mao-service-discovery')
ESM-only; use import syntax
ICMPMonitor
import { ICMPMonitor } from 'mao-service-discovery'
import ICMPMonitor from 'mao-service-discovery/ICMPMonitor'
Named export, not default
EtcdClient
import { EtcdClient } from 'mao-service-discovery'
Exported from main entry; see documentation for configuration

Creates a service discovery instance with etcd backend, listens for service up/down events, and starts monitoring.

import { ServiceDiscovery } from 'mao-service-discovery'; const sd = new ServiceDiscovery({ etcd: { hosts: ['localhost:2379'], prefix: '/services' } }); sd.on('serviceUp', (service) => { console.log('Service up:', service.name); }); sd.on('serviceDown', (service) => { console.log('Service down:', service.name); }); sd.start();
Debug
Known issues
breakingVersion 1.x is a release candidate; API may change without notice
fix
Pin to exact version and monitor changelog
affects: >=1.0.0 <2.0.0
deprecatedolder versions used 'ServiceDiscovery.start()' accepting callback; now returns Promise
fix
Use async/await or .then() on start()
affects: <1.5.0
gotchaICMP monitor requires root/privileged access on Linux
fix
Run with sudo or set CAP_NET_RAW capability
affects: all
gotchaServiceDiscovery constructor throws if etcd hosts unreachable; no retry by default
fix
Wrap in try-catch and implement retry logic
affects: all
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:2379
etcd not running or incorrect host/port
fix
Ensure etcd is started on the specified host and port
Error: Permission denied: cannot open ICMP socket
ICMP requires elevated privileges
fix
Run as root or grant CAP_NET_RAW: sudo setcap cap_net_raw+ep /path/to/node
TypeError: ServiceDiscovery is not a constructor
Incorrect import (default vs named)
fix
Use import { ServiceDiscovery } from 'mao-service-discovery'
Upgrade
Version history
1.6.9-linux-rc1-master-ce9e7335ddfe100f41c491e412cc5a9311427593.0latest on npm
Audit
Dependencies
etcd3requiredCore backend for service registration and discovery
grpcoptionalUsed for gRPC streaming service discovery
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
mao-service-discovery — npm install mao-service-discovery · libregistry