percolate:server-info

v0.2.3Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

percolate:server-info

Description

Meteor package for querying a meteor app for diagnostics information.

The package sets up a route (By default at /info) that returns a json object containing useful debugging about your running Meteor app.

This is really useful for querying your application state from an external source, such as shell scripts that may forward the data to cloudwatch or other logs.

Example output

1{
2    "extras": {
3      "commit": "fb5954a395612c260d78d4a44df7bee12131c5ef"
4    },
5    "counts": {
6        "nCollectionsWithLRSes": {
7            "foos": 1,
8            "bars": 1,
9            "meteor_accounts_loginServiceConfiguration": 1,
10            "notifications": 1,
11            "users": 3
12        },
13        "nDocuments": {
14            "foos": 1,
15            "bars": 3,
16            "meteor_accounts_loginServiceConfiguration": 1,
17            "users": 1
18        },
19        "nLiveResultsSets": 7,
20        "nObserveHandles": 7,
21        "nSessions": null,
22        "nSockets": 1,
23        "nSocketsWithLivedataSessions": 0,
24        "nSubs": {
25            "base": 1,
26            "meteor.loginServiceConfiguration": 1
27        }
28    },
29    "ec2": {
30        "ami-id": "XXX",
31        "ami-launch-index": "0",
32        "ami-manifest-path": "(unknown)",
33        "ancestor-ami-ids": "unavailable",
34        "availability-zone": "us-west-1a",
35        "block-device-mapping": "ami",
36        "instance-action": "none",
37        "instance-id": "XXX",
38        "instance-type": "m1.medium",
39        "kernel-id": "XXX",
40        "local-hostname": "XXX",
41        "local-ipv4": "XXX",
42        "mac": "unavailable",
43        "product-codes": "unavailable",
44        "profile": "default-paravirtual",
45        "public-hostname": "XXX",
46        "public-ipv4": "XXX",
47        "ramdisk-id": "unavailable",
48        "reserveration-id": "unavailable",
49        "security-groups": "web",
50        "user-data": "unavailable"
51    }
52}

Installation

Meteor ServerInfo can be installed with Meteorite. From inside a Meteorite-managed app:

$ meteor add percolate:server-info

Usage

Install the package, then access /info on your running application. By default, the route is protected by a username/password combinbation of insecure:secureme that you should promptly change.

From the command line, you could run curl http://insecure:secureme@localhost:3000/info.

Configuration

You can set the path and http basic authentication credentials like

1ServerInfo.settings = {
2  path: '/info',
3  user: 'insecure',
4  password: 'secureme',
5  extras: undefined //a function or any other data to add
6};

extras is an optional field that will be returned as part of the json object. If you provide a function, it will be evaluated and it's return value will be added to the json object.

License

MIT. (c) Percolate Studio