Skip to content
Switch branches/tags
This branch is 1 commit behind intelsdi-x:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Snap publisher plugin - PostgreSQL

Build Status Go Report Card

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

Getting Started

System Requirements


Run PostgreSQL server.

docker run --name postgres_server -p 5432:5432 --env 'DB_USER=snap' \
--env 'DB_PASS=snap' -d sameersbn/postgresql:9.4-8

Download File plugin binary:

You can get the pre-built binaries for your OS and architecture at plugin's GitHub Releases page.

To build the plugin binary:


Clone repo into $GOPATH/src/

$ git clone<yourGithubID>/snap-plugin-publisher-postgresql.git

Build the plugin by running make within the cloned repo:

$ make

This builds the plugin in ./build

Configuration and Usage


Task Manifest Config

In task manifest, the config section of PostgreSQL publisher describes how to establish a connection to the PostgreSQL server.

Name | Data Type | Description ----------|-----------|---------------|------------- hostname | string | the host of PostgreSQL service port | number | the port number of PostgreSQL service username | string | the name of user password | string | the password of user database | string | the name of database table_name | string | the name of table


Example of running psutil collector plugin and publishing data to PostgreSQL database.

Set up the Snap framework

Ensure Snap daemon is running:

  • initd: service snap-telemetry start
  • systemd: systemctl start snap-telemetry
  • command line: sudo snapteld -l 1 -t 0 &

Download and load Snap plugins (paths to binary files for Linux/amd64):

$ wget
$ wget
$ snaptel plugin load snap-plugin-publisher-postgresql
$ snaptel plugin load snap-plugin-collector-psutil

Create a task manifest (see exemplary tasks), for example psutil-postgresql.json with following content:

  "version": 1,
  "schedule": {
    "type": "simple",
    "interval": "10s"
  "workflow": {
    "collect": {
      "metrics": {
        "/intel/psutil/load/load1": {},
        "/intel/psutil/load/load15": {}
      "publish": [
          "plugin_name": "postgresql",
          "config": {
            "hostname": "localhost",
            "port": 5432,
            "username": "snap",
            "table_name": "snap",
            "database": "snap",
            "password": "snap"

Create a task:

$ snaptel task create -t psutil-postgresql.json

Watch created task:

$ snaptel task watch <task_id>

To stop previously created task:

$ snaptel task stop <task_id>

Example postgresql table

time_posted key_column value_column
2015-09-24 10:06:15+00 intel.psutil.load.load1 1.58
2015-09-24 10:06:15+00 intel.psutil.load.load15 2.43


As we launch this plugin, we do not have any outstanding requirements for the next release. If you have a feature request, please add it as an issue.

If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at To reach out to other users, head to the main framework


We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in


Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.


And thank you! Your contribution, through code and participation, is incredibly important to us.

This software has been contributed by MIKELANGELO, a Horizon 2020 project co-funded by the European Union.


Publishes snap metrics to PostreSQL




No packages published