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

deployment-tracker

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deployment-tracker

Collect deployment metadata and store it in purpose-driven data stores

  • 0.1.20
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-79.31%
Maintainers
1
Weekly downloads
 
Created
Source

Deployment Tracker

Collect deployment metadata from various deployment engines and forward them along to purpose-driven application endpoints for storage and analysis later.

Outputs include:

  1. Logstash (ELK stack) via Redis for log messages
  2. Statsd for metrics aggregation
  3. SQL database table for long-lived deployment summary information

Installation

npm install deployment-tracker
node deployment-tracker

Note: Not compatible with Node.js versions 4.x

Usage

# Record the start of a deployment
curl -X POST -H 'Content-Type:application/json' http://server:port/v1/deployments/84e803f7-9562-4d95-b828-25b167aea34b -d '{"deployment_id": 84e803f7-9562-4d95-b828-25b167aea34b, "engine": "vagrant_orchestrate", "engine_version": "0.6.3", "host": "localhost", "user": "cbaldauf", "environment": "dev", "package": "test", "package_url": "http://mypackage.mydomain.com", "version": "4.5.6", "arguments": "--strategy parallel" }'

# Record some log messages
curl -X POST -H 'Content-Type: application/json' http://server:port/v1/deployments/84e803f7-9562-4d95-b828-25b167aea34b -d '{"message": "Starting deployment phase 1", "severity": "info"}'

# Record the completion of a deployment
curl -X PUT -H 'Content-Type:application/json' http://server:port/v1/deployments/84e803f7-9562-4d95-b828-25b167aea34b -d '{"deployment_id": "84e803f7-9562-4d95-b828-25b167aea34b", "result": "success", "elapsed_seconds": 234}'

The service also supports tracking deployments on individual servers, using the /v1/deployments/{id}/servers route

API Docs

Full API docs are available at http://localhost:8080/swagger.json

Configuration

Configuration lives in the config.js file at the root of the package. Currently the recommendation is to overwrite the file, but support for specifying an alternate file via an environment variable is envisioned.

A sample config might look something like this:

{
  redis :
  {
    host: "myredishost.mydomain.com"
  },
  statsd :
  {
    host: "mystatsdhost.mydomain.com",
    prefix: "deployment-tracker"
  }
}

Redis

The redis output represents a step in the path toward showing up in Logstash (Elastic's ELK stack). Of course, there are other ways to get data into ElasticSearch / LogStash, but deployment-tracker currently only supports redis. If you're interested in a different logging output format or transport mechanism, please open an issue.

FieldTypeDefaultNotes
hoststring127.0.0.1The redis host to send log messages to
portinteger6379The redis port to send log messages to
indexstringdeployment-trackerThe index name to include in the log message
keystringlogstashThe redis key to which messages are appended
additional_filedshash{ }A hash of additional fields that will be merged into each log message that is sent to redis

The config.redis object is passed directly to the constructor of the redis client implementation (in this case ioredis), so any of the ioredis connection options should be supported.

{
  redis :
  {
    host : "myredishost.mydomain.com",
    port : 6379,
    index : "deployment-tracker",
    key : "logstash",
    additional_fields :
    {
        foo: "This will be appended to every log message"
        bar: "So will this"
    }
  }
}

Development

  1. Clone this repo
  2. Spin up required infrastructure by running vagrant up
  3. Make changes
  4. Test locally using the grunt command
  • Alternatively, you can mock the redis endpoint with DEPLOYMENT_TRACKER_MOCK_REDIS=true grunt
  1. Spin up a Vagrant box to test the deployment using the vagrant up command
  2. File a pull request

TODO:

  • Proper Exception Handling / logging
  • Configuration instructions and examples

FAQs

Package last updated on 20 Oct 2015

Did you know?

Socket

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.

Install

Related posts

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