├── github-fetcher ├── requirements.txt ├── Dockerfile ├── README.md └── github-fetcher.py ├── img ├── KairosDB-UI.png ├── Grafana-dashboard.png ├── Grafana-datasource.png ├── Grafana-dashboard-import.png ├── install-cassandra-with-rpc.png └── kairos-tutorial-architecture.png ├── fetcher.json ├── grafana.json ├── kairosdb.json ├── .gitignore ├── manual-launch.md ├── README.md ├── dashboard.json └── LICENSE /github-fetcher/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.6.2 2 | -------------------------------------------------------------------------------- /img/KairosDB-UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesosphere-backup/cassandra-kairosdb-tutorial/HEAD/img/KairosDB-UI.png -------------------------------------------------------------------------------- /img/Grafana-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesosphere-backup/cassandra-kairosdb-tutorial/HEAD/img/Grafana-dashboard.png -------------------------------------------------------------------------------- /img/Grafana-datasource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesosphere-backup/cassandra-kairosdb-tutorial/HEAD/img/Grafana-datasource.png -------------------------------------------------------------------------------- /img/Grafana-dashboard-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesosphere-backup/cassandra-kairosdb-tutorial/HEAD/img/Grafana-dashboard-import.png -------------------------------------------------------------------------------- /img/install-cassandra-with-rpc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesosphere-backup/cassandra-kairosdb-tutorial/HEAD/img/install-cassandra-with-rpc.png -------------------------------------------------------------------------------- /img/kairos-tutorial-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesosphere-backup/cassandra-kairosdb-tutorial/HEAD/img/kairos-tutorial-architecture.png -------------------------------------------------------------------------------- /github-fetcher/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:2.7.11-onbuild 2 | MAINTAINER Michael Hausenblas "michael.hausenblas@gmail.com" 3 | ENV REFRESHED_AT 2016-02-10T13:25 4 | ENV GITHUB_ORG mesosphere 5 | ENV POLL_INTERVAL 30 6 | CMD python github-fetcher.py -k $KAIROSDB_API -o $GITHUB_ORG -p $POLL_INTERVAL -------------------------------------------------------------------------------- /fetcher.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/github-fetcher", 3 | "instances": 1, 4 | "cpus": 0.5, 5 | "mem": 100, 6 | "env": { 7 | "KAIROSDB_API": "http://52.11.127.207:24653", 8 | "GITHUB_ORG": "mesosphere", 9 | "POLL_INTERVAL": "60" 10 | }, 11 | "container": { 12 | "type": "DOCKER", 13 | "docker": { 14 | "image": "mhausenblas/kairosdb-tutorial" 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /grafana.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/grafana", 3 | "instances": 1, 4 | "cpus": 0.2, 5 | "mem": 300, 6 | "container": { 7 | "type": "DOCKER", 8 | "docker": { 9 | "image": "grafana/grafana:2.6.0", 10 | "network": "BRIDGE", 11 | "portMappings": [ 12 | { 13 | "containerPort": 3000, 14 | "hostPort": 0 15 | } 16 | ] 17 | } 18 | }, 19 | "acceptedResourceRoles": [ 20 | "slave_public" 21 | ], 22 | "constraints": [ 23 | [ 24 | "hostname", 25 | "UNIQUE" 26 | ] 27 | ] 28 | } -------------------------------------------------------------------------------- /kairosdb.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/kairos", 3 | "instances": 1, 4 | "cpus": 0.5, 5 | "mem": 500, 6 | "env": { 7 | "CASS_HOSTS": "node-0.cassandra.mesos:9160", 8 | "REPFACTOR": "1" 9 | }, 10 | "container": { 11 | "type": "DOCKER", 12 | "docker": { 13 | "image": "mesosphere/archlinux-kairosdb:master", 14 | "network": "BRIDGE", 15 | "portMappings": [ 16 | { 17 | "containerPort": 8080, 18 | "hostPort": 0 19 | }, 20 | { 21 | "containerPort": 4242, 22 | "hostPort": 0 23 | }, 24 | { 25 | "containerPort": 2003, 26 | "hostPort": 0 27 | }, 28 | { 29 | "containerPort": 2004, 30 | "hostPort": 0 31 | } 32 | ] 33 | } 34 | }, 35 | "acceptedResourceRoles": [ 36 | "slave_public" 37 | ], 38 | "constraints": [ 39 | [ 40 | "hostname", 41 | "UNIQUE" 42 | ] 43 | ] 44 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | 55 | # Sphinx documentation 56 | docs/_build/ 57 | 58 | # PyBuilder 59 | target/ 60 | 61 | #Ipython Notebook 62 | .ipynb_checkpoints 63 | -------------------------------------------------------------------------------- /github-fetcher/README.md: -------------------------------------------------------------------------------- 1 | # GitHub Fetcher 2 | 3 | The GitHub Fetcher fetches [events](https://developer.github.com/v3/activity/events/) from an organisation and ingests the data into KairosDB: 4 | 5 | $ ./github-fetcher.py -h 6 | usage: github-fetcher.py [-h] [-o ORG] [-k KAIROSDB_API] [-p POLL_INTERVAL] 7 | [-d] 8 | 9 | Fetches events from an organization in GitHub and ingests it into KairosDB. 10 | 11 | optional arguments: 12 | -h, --help show this help message and exit 13 | -o ORG The organisation handle on GitHub, the default is 14 | `mesosphere` 15 | -k KAIROSDB_API The URL of the KairosDB API, the default is 16 | `http://localhost:8080` 17 | -p POLL_INTERVAL The poll interval in seconds, the default is 10 18 | -d Enables debug messages 19 | 20 | Example: github-fetcher.py -k http://52.11.127.207:24653 21 | 22 | A [Docker image](https://hub.docker.com/r/mhausenblas/kairosdb-tutorial) is available to run the GitHub Fetcher. You will have to set the KairosDB endpoint `KAIROSDB_API` as shown below: 23 | 24 | $ docker run mhausenblas/kairosdb-tutorial -e "KAIROSDB_API=http://52.11.127.207:24653" 25 | 26 | Note that you can also specify a different organization to watch when you supply `-e "GITHUB_ORG=xxxxx"` and change the poll intervall (how frequently the GitHub API is queried), for example, `-e "POLL_INTERVAL=100"` means to fetch events every 100 seconds. 27 | -------------------------------------------------------------------------------- /github-fetcher/github-fetcher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Fetches events from an organization in GitHub and ingests it into KairosDB. 5 | 6 | @author: Michael Hausenblas, http://mhausenblas.info/#i 7 | @since: 2016-02-09 8 | @status: init 9 | """ 10 | 11 | import argparse 12 | import logging 13 | import os 14 | import sys 15 | import requests 16 | import json 17 | import time 18 | 19 | GITHUB_API = "https://api.github.com/orgs/" 20 | KAIROS_WRITE_PATH = "/api/v1/datapoints" 21 | 22 | def push_data(kairos_base, event_type, event_repo, event_actor): 23 | tags = { 24 | "action" : event_type, 25 | "actor" : event_actor 26 | } 27 | metric = { 28 | "name" : event_repo, 29 | "timestamp" : int(round(time.time() * 1000)), 30 | "value" : 1, 31 | "tags" : tags 32 | } 33 | kairos_url = "".join([kairos_base, KAIROS_WRITE_PATH]) 34 | logging.debug("Pushing the following data to %s\n%s" %(kairos_url, json.dumps(metric))) 35 | res = requests.post(kairos_url, json.dumps(metric)) 36 | logging.debug(res.text) 37 | 38 | def extract(org_event): 39 | event_type = "unknown" 40 | event_repo = "unknown" 41 | event_actor = "unknown" 42 | try: 43 | if org_event["type"].endswith("Event"): 44 | event_type = org_event["type"][:-(len("Event"))] 45 | event_repo = org_event["repo"]["name"].split("/")[1] 46 | event_actor = org_event["actor"]["login"] 47 | except: 48 | pass 49 | logging.debug((event_type, event_repo, event_actor)) 50 | return(event_type, event_repo, event_actor) 51 | 52 | def ingest(org, kairos_base): 53 | logging.info("Fetching events from GitHub organization `%s`" %(org)) 54 | event_url = "".join([GITHUB_API, org, "/events"]) 55 | org_events = requests.get(event_url).json() 56 | logging.debug("Got %d events" %(len(org_events))) 57 | for org_event in org_events: 58 | event_type, event_repo, event_actor = extract(org_event) 59 | push_data(kairos_base, event_type, event_repo, event_actor) 60 | logging.info("Ingested events into KairosDB at %s" %(kairos_base)) 61 | 62 | if __name__ == "__main__": 63 | try: 64 | parser = argparse.ArgumentParser( 65 | description="Fetches events from an organization in GitHub and ingests it into KairosDB.", 66 | epilog="Example: github-fetcher.py -k http://52.11.127.207:24653") 67 | parser.add_argument("-o", action="store", dest="org", default="mesosphere", help="The organisation handle on GitHub, the default is `mesosphere`") 68 | parser.add_argument("-k", action="store", dest="kairosdb_api", default="http://localhost:8080", help="The URL of the KairosDB API, the default is `http://localhost:8080`") 69 | parser.add_argument("-p", action="store", dest="poll_interval", default=10, type=int, help="The poll interval in seconds, the default is 10") 70 | parser.add_argument("-d", action="store_true", dest="enable_debug", default=False, help="Enables debug messages") 71 | args = parser.parse_args() 72 | if args.enable_debug: 73 | FORMAT = "%(asctime)-0s %(levelname)s %(message)s [at line %(lineno)d]" 74 | logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt="%Y-%m-%dT%I:%M:%S") 75 | else: 76 | FORMAT = "%(asctime)-0s %(message)s" 77 | logging.basicConfig(level=logging.INFO, format=FORMAT, datefmt="%Y-%m-%dT%I:%M:%S") 78 | logging.getLogger("requests").setLevel(logging.WARNING) 79 | logging.debug("Arguments %s" %(args)) 80 | 81 | while True: 82 | ingest(args.org, args.kairosdb_api) 83 | time.sleep(args.poll_interval) 84 | 85 | except (Exception) as e: 86 | print("Something went wrong:\n%s" %(e)) 87 | sys.exit(1) -------------------------------------------------------------------------------- /manual-launch.md: -------------------------------------------------------------------------------- 1 | # Manually launching KairosDB 2 | 3 | Using [mesosphere/docker-archlinux-kairosdb](https://github.com/mesosphere/docker-archlinux-kairosdb/) via `docker run` on the DCOS Master node: 4 | 5 | $ ssh -A core@54.69.109.145 6 | core@ip-10-0-6-244 ~ $ docker run -P -e "CASS_HOSTS=cassandra-dcos-node.cassandra.dcos.mesos:9160" -e "REPFACTOR=1" mesosphere/archlinux-kairosdb:master 7 | - env ------------------------------------------------------------------ 8 | CASS_HOSTS=cassandra-dcos-node.cassandra.dcos.mesos:9160 9 | HOME=/ 10 | HOSTNAME=ed1df85ad35c 11 | JAVA_HOME=/opt/java 12 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin 13 | PORT_CARBON_PICKLE=2004 14 | PORT_CARBON_TEXT=2003 15 | PORT_HTTP=8080 16 | PORT_TELNET=4242 17 | PWD=/ 18 | READ_CONSISTENCY_DATA=ONE 19 | READ_CONSISTENCY_INDEX=QUORUM 20 | REPFACTOR=1 21 | SHLVL=1 22 | WRITE_CONSISTENCY_DATA=QUORUM 23 | _=/usr/sbin/env 24 | ... 25 | 16:52:01.415 [main] DEBUG [AbstractLifeCycle.java:172] - STARTED SelectChannelConnector@0.0.0.0:8080 26 | 16:52:01.415 [main] DEBUG [AbstractLifeCycle.java:172] - STARTED org.eclipse.jetty.server.Server@2d854f2f 27 | 16:52:01.415 [main] INFO [Main.java:306] - ------------------------------------------ 28 | 16:52:01.415 [main] INFO [Main.java:307] - KairosDB service started 29 | 16:52:01.416 [main] INFO [Main.java:308] - ------------------------------------------ 30 | 31 | Execute a CQL query in a new terminal: 32 | 33 | $ ssh -A core@54.69.109.145 34 | core@ip-10-0-6-244 ~ $ docker run -i -t --net=host --entrypoint=/usr/bin/cqlsh spotify/cassandra -e "SELECT * FROM system.schema_keyspaces ;" cassandra-dcos-node.cassandra.dcos.mesos 9160 35 | keyspace_name | durable_writes | strategy_class | strategy_options 36 | ---------------+----------------+---------------------------------------------+---------------------------- 37 | kairosdb | True | org.apache.cassandra.locator.SimpleStrategy | {"replication_factor":"1"} 38 | system | True | org.apache.cassandra.locator.LocalStrategy | {} 39 | system_traces | True | org.apache.cassandra.locator.SimpleStrategy | {"replication_factor":"2"} 40 | core@ip-10-0-6-244 ~ $ docker run -i -t --net=host --entrypoint=/usr/bin/cqlsh spotify/cassandra -e "SELECT * FROM system.schema_columns ;" cassandra-dcos-node.cassandra.dcos.mesos 9160 41 | keyspace_name | columnfamily_name | column_name | component_index | index_name | index_options | index_type | type | validator 42 | ---------------+-------------------------+-----------------------------+-----------------+------------+---------------+------------+----------------+----------------------------------------------------------------------------------------------------------------------------- 43 | kairosdb | data_points | column1 | null | null | null | null | clustering_key | org.apache.cassandra.db.marshal.BytesType 44 | kairosdb | data_points | key | null | null | null | null | partition_key | org.apache.cassandra.db.marshal.BytesType 45 | kairosdb | data_points | value | null | null | null | null | compact_value | org.apache.cassandra.db.marshal.BytesType 46 | kairosdb | row_key_index | column1 | null | null | null | null | clustering_key | org.apache.cassandra.db.marshal.BytesType 47 | kairosdb | row_key_index | key | null | null | null | null | partition_key | org.apache.cassandra.db.marshal.BytesType 48 | kairosdb | row_key_index | value | null | null | null | null | compact_value | org.apache.cassandra.db.marshal.BytesType 49 | kairosdb | string_index | column1 | null | null | null | null | clustering_key | org.apache.cassandra.db.marshal.UTF8Type 50 | kairosdb | string_index | key | null | null | null | null | partition_key | org.apache.cassandra.db.marshal.BytesType 51 | kairosdb | string_index | value | null | null | null | null | compact_value | org.apache.cassandra.db.marshal.BytesType 52 | 53 | Interacting with the KairosDB HTTP API: 54 | 55 | core@ip-10-0-6-244 ~ $ docker ps 56 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 57 | ed1df85ad35c mesosphere/archlinux-kairosdb:master "/usr/bin/runKairos. 29 minutes ago Up 29 minutes 0.0.0.0:32771->2003/tcp, 0.0.0.0:32770->2004/tcp, 0.0.0.0:32769->4242/tcp, 0.0.0.0:32768->8080/tcp goofy_bell 58 | 59 | Noting down the port `32768` since that's the KairosDB HTTP API: 60 | 61 | core@ip-10-0-6-244 ~ $ curl http://127.0.0.1:32768/api/v1/version 62 | {"version": "KairosDB 1.1.1-1.20151207194217"} 63 | 64 | Remove the KairosDB data from Cassandra: 65 | 66 | $ ssh -A core@54.69.109.145 67 | core@ip-10-0-6-244 ~ $ docker run -i -t --net=host --entrypoint=/usr/bin/cqlsh spotify/cassandra -e "DROP KEYSPACE kairosdb ;" cassandra-dcos-node.cassandra.dcos.mesos 9160 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub stream data demo with KairosDB 2 | 3 | In this tutorial you'll learn how to set up the time series database [KairosDB](http://kairosdb.github.io/) 4 | along with the popular NoSQL database [Cassandra](http://cassandra.apache.org/) on [DC/OS](https://dcos.io). 5 | We will use the [GitHub API](https://developer.github.com/v3/) as a stream datasource and build a dashboard 6 | using [Grafana](http://grafana.org/). 7 | 8 | The overall application architecture looks as follows: 9 | 10 | ![Architecture](img/kairos-tutorial-architecture.png) 11 | 12 | Note that above exemplary IP addresses and ports are shown, which varies based on the actual deployment. 13 | 14 | This demo assumes you have a [DC/OS 1.8](https://dcos.io) cluster with at least 3 private nodes and 1 public node (the latter for the end-user facing components) up and running as well as the [DC/OS CLI](https://dcos.io/docs/1.8/usage/cli/install/) installed. 15 | 16 | ## Install Cassandra 17 | 18 | First, we need to install [Cassandra](https://docs.mesosphere.com/manage-service/cassandra/) from the public Universe with the RPC enabled (note the checked `start_rpc` option): 19 | 20 | ![Cassandra install with RPC enabled](img/install-cassandra-with-rpc.png) 21 | 22 | Or, alternatively, you can install Cassandra via the DC/OS CLI: 23 | 24 | $ dcos package install --options=copt.json cassandra 25 | 26 | With the following content for `copt.json`: 27 | 28 | ```json 29 | { 30 | "cassandra": { 31 | "start_rpc": true, 32 | "rpc_port": 9160, 33 | "rpc_keepalive": true 34 | } 35 | } 36 | ``` 37 | 38 | Note that it takes a couple of minutes until Cassandra is marked as healthy in the DC/OS dashboard; the Cassandra nodes are available via `$DCOS_DASHBOARD/service/cassandra/v1/nodes/connect`. 39 | 40 | ## Launch KairosDB 41 | 42 | KairosDB is a time series database that runs on top of Cassandra, offering a HTTP data API as well as a Web UI, both exposed via port `8080`. 43 | Use the DC/OS CLI to launch the [KairosDB](kairosdb.json): 44 | 45 | $ dcos marathon app add https://raw.githubusercontent.com/mesosphere/cassandra-kairosdb-tutorial/master/kairosdb.json 46 | 47 | Once you see KairosDB running as a service, you can access its Web UI by looking up the [IP address of the public agent](https://dcos.io/docs/1.8/administration/locate-public-agent/) (`35.156.43.3` in my case) along with the port that DC/OS has assigned to the container: 48 | 49 | $ dcos marathon task list 50 | APP HEALTHY STARTED HOST ID 51 | /cassandra True 2016-11-13T05:49:27.871Z 10.0.0.68 cassandra.ed41b93d-a964-11e6-83aa-9ac7779d790a 52 | /kairos True 2016-11-13T06:04:13.650Z 10.0.7.32 kairos.00021191-a967-11e6-83aa-9ac7779d790a 53 | $ dcos marathon task show kairos.00021191-a967-11e6-83aa-9ac7779d790a 54 | { 55 | "appId": "/kairos", 56 | "host": "10.0.4.20", 57 | "id": "kairos.ce522993-c9b6-11e5-bf2e-02181a13a4a7", 58 | "ipAddresses": [ 59 | { 60 | "ipAddress": "172.17.0.2", 61 | "protocol": "IPv4" 62 | } 63 | ], 64 | "ports": [ 65 | 24653, 66 | 24654, 67 | 24655, 68 | 24656 69 | ], 70 | ... 71 | 72 | The first port (in out example this is `24653`) is mapped to container port `8080` and if you combine that with the IP address of the public agent you can now access the KairosDB Web UI: 73 | 74 | ![KairosDB UI](img/KairosDB-UI.png) 75 | 76 | Even now, without any data ingested from GitHub, you can toy around with the internal metrics available. Also, if you're interested in the internals of KairosDB on DC/OS, check out the [manual launch notes](manual-launch.md). 77 | 78 | ## Launch Grafana 79 | 80 | We want to build a dashboard with Grafana, plotting the time series data from KairosDB. For that we need to first launch [Grafana](grafana.json): 81 | 82 | $ dcos marathon app add grafana.json 83 | 84 | Note that you can look up Grafana's serving port on the public agent in the same fashion as described above for KairosDB. 85 | 86 | Next step is to connect Grafana to KairosDB as a backend, which is supported since [v2.1](http://docs.grafana.org/v2.6/datasources/kairosdb/). 87 | Start by visiting the Grafana Web UI and authenticating with `user:**admin**` and `password:**admin**`. Next, add a new data source as shown below: 88 | 89 | ![Grafana KairosDB](img/Grafana-datasource.png) 90 | 91 | Once you've completed this step you're almost good to go. 92 | 93 | ## Get data from GitHub 94 | 95 | In this demo we use GitHub activity as the data source. To ingest data from GitHub into KairosDB, a custom Docker image is used, called the [GitHub Fetcher](github-fetcher/). In a nutshell, it polls `https://api.github.com/orgs/$ORG/events` with a configurable time interval and uses the KairosDB HTTP API to ingest the datapoints. 96 | 97 | We launch the [GitHub fetcher](fetcher.json) with a customized value for `KAIROSDB_API` value in `fetcher.json`. The value must point to the IP/port that we found earlier for the KairosDB Web UI. The provided endpoint must *not* end in a slash: 98 | 99 | ... 100 | "env": { 101 | "KAIROSDB_API": "http://52.11.127.207:24653", 102 | "GITHUB_ORG": "mesosphere", 103 | "POLL_INTERVAL": "60" 104 | }, 105 | ... 106 | 107 | Note: 108 | 109 | - You can customize the Github organization by editing `GITHUB_ORG`. 110 | - The period between refreshes can be customized by changing `POLL_INTERVAL` with a default value of 60 sec. 111 | 112 | And now you're ready to launch the GitHub fetcher: 113 | 114 | $ dcos marathon app add github-fetcher.json 115 | 116 | ## Usage 117 | 118 | Once you've gone through the preparation steps and launched both KairosDB and Grafana as well as configured the GitHub fetcher as discussed in the previous section, you're ready to start importing and visualizing Github statistics. 119 | 120 | As data is ingested from the GitHub API into Cassandra and available in Grafana you can either create your own dashboards or import the one [we've prepared](dashboard.json) and take it from there: 121 | 122 | ![Grafana dashboard import](img/Grafana-dashboard-import.png) 123 | 124 | The result of the import is the GitHub activity of an organization: 125 | 126 | ![Grafana dashboard](img/Grafana-dashboard.png) 127 | 128 | Note that you can play around with the tags to show a drilldown in terms of activities (such as pull requests, comments, etc.) and actors (GitHub users). -------------------------------------------------------------------------------- /dashboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "title": "Mesosphere GitHub activity", 4 | "originalTitle": "Mesosphere GitHub activity", 5 | "tags": [], 6 | "style": "dark", 7 | "timezone": "browser", 8 | "editable": true, 9 | "hideControls": false, 10 | "sharedCrosshair": false, 11 | "rows": [ 12 | { 13 | "collapse": false, 14 | "editable": true, 15 | "height": "250px", 16 | "panels": [ 17 | { 18 | "aliasColors": {}, 19 | "bars": false, 20 | "datasource": null, 21 | "editable": true, 22 | "error": false, 23 | "fill": 1, 24 | "grid": { 25 | "leftLogBase": 1, 26 | "leftMax": null, 27 | "leftMin": null, 28 | "rightLogBase": 1, 29 | "rightMax": null, 30 | "rightMin": null, 31 | "threshold1": null, 32 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 33 | "threshold2": null, 34 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 35 | }, 36 | "id": 1, 37 | "isNew": true, 38 | "legend": { 39 | "avg": false, 40 | "current": false, 41 | "max": false, 42 | "min": false, 43 | "show": true, 44 | "total": false, 45 | "values": false 46 | }, 47 | "lines": true, 48 | "linewidth": 2, 49 | "nullPointMode": "connected", 50 | "percentage": false, 51 | "pointradius": 5, 52 | "points": false, 53 | "renderer": "flot", 54 | "seriesOverrides": [], 55 | "span": 12, 56 | "stack": false, 57 | "steppedLine": false, 58 | "targets": [ 59 | { 60 | "alias": "all", 61 | "currentHorizontalAggregatorName": "sum", 62 | "currentTagKey": "action", 63 | "currentTagValue": "PullRequest", 64 | "downsampling": "sum", 65 | "errors": {}, 66 | "groupBy": { 67 | "timeInterval": "1s" 68 | }, 69 | "horAggregator": { 70 | "factor": "1", 71 | "percentile": "0.75", 72 | "samplingRate": "1s", 73 | "unit": "millisecond" 74 | }, 75 | "metric": "marathon", 76 | "refId": "A", 77 | "sampling": "60s" 78 | } 79 | ], 80 | "timeFrom": null, 81 | "timeShift": null, 82 | "title": "mesosphere/marathon", 83 | "tooltip": { 84 | "shared": true, 85 | "value_type": "cumulative" 86 | }, 87 | "type": "graph", 88 | "x-axis": true, 89 | "y-axis": true, 90 | "y_formats": [ 91 | "short", 92 | "short" 93 | ], 94 | "downsampling": "sum", 95 | "sampling": "60s", 96 | "links": [] 97 | } 98 | ], 99 | "title": "Row" 100 | }, 101 | { 102 | "title": "New row", 103 | "height": "250px", 104 | "editable": true, 105 | "collapse": false, 106 | "panels": [ 107 | { 108 | "title": "mesosphere/marathon-ui", 109 | "error": false, 110 | "span": 12, 111 | "editable": true, 112 | "type": "graph", 113 | "isNew": true, 114 | "id": 2, 115 | "datasource": null, 116 | "renderer": "flot", 117 | "x-axis": true, 118 | "y-axis": true, 119 | "y_formats": [ 120 | "short", 121 | "short" 122 | ], 123 | "grid": { 124 | "leftLogBase": 1, 125 | "leftMax": null, 126 | "rightMax": null, 127 | "leftMin": null, 128 | "rightMin": null, 129 | "rightLogBase": 1, 130 | "threshold1": null, 131 | "threshold2": null, 132 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 133 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 134 | }, 135 | "lines": true, 136 | "fill": 1, 137 | "linewidth": 2, 138 | "points": false, 139 | "pointradius": 5, 140 | "bars": false, 141 | "stack": false, 142 | "percentage": false, 143 | "legend": { 144 | "show": true, 145 | "values": false, 146 | "min": false, 147 | "max": false, 148 | "current": false, 149 | "total": false, 150 | "avg": false 151 | }, 152 | "nullPointMode": "connected", 153 | "steppedLine": false, 154 | "tooltip": { 155 | "value_type": "cumulative", 156 | "shared": true 157 | }, 158 | "timeFrom": null, 159 | "timeShift": null, 160 | "targets": [ 161 | { 162 | "refId": "A", 163 | "groupBy": { 164 | "timeInterval": "1s" 165 | }, 166 | "horAggregator": { 167 | "samplingRate": "1s", 168 | "unit": "millisecond", 169 | "factor": "1", 170 | "percentile": "0.75" 171 | }, 172 | "metric": "marathon-ui", 173 | "errors": {}, 174 | "downsampling": "sum", 175 | "sampling": "60s", 176 | "alias": "all" 177 | } 178 | ], 179 | "aliasColors": {}, 180 | "seriesOverrides": [], 181 | "downsampling": "sum", 182 | "sampling": "60s", 183 | "links": [] 184 | } 185 | ] 186 | }, 187 | { 188 | "title": "New row", 189 | "height": "250px", 190 | "editable": true, 191 | "collapse": false, 192 | "panels": [ 193 | { 194 | "title": "mesosphere/spark", 195 | "error": false, 196 | "span": 12, 197 | "editable": true, 198 | "type": "graph", 199 | "isNew": true, 200 | "id": 3, 201 | "datasource": null, 202 | "renderer": "flot", 203 | "x-axis": true, 204 | "y-axis": true, 205 | "y_formats": [ 206 | "short", 207 | "short" 208 | ], 209 | "grid": { 210 | "leftLogBase": 1, 211 | "leftMax": null, 212 | "rightMax": null, 213 | "leftMin": null, 214 | "rightMin": null, 215 | "rightLogBase": 1, 216 | "threshold1": null, 217 | "threshold2": null, 218 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 219 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 220 | }, 221 | "lines": true, 222 | "fill": 1, 223 | "linewidth": 2, 224 | "points": false, 225 | "pointradius": 5, 226 | "bars": false, 227 | "stack": false, 228 | "percentage": false, 229 | "legend": { 230 | "show": true, 231 | "values": false, 232 | "min": false, 233 | "max": false, 234 | "current": false, 235 | "total": false, 236 | "avg": false 237 | }, 238 | "nullPointMode": "connected", 239 | "steppedLine": false, 240 | "tooltip": { 241 | "value_type": "cumulative", 242 | "shared": true 243 | }, 244 | "timeFrom": null, 245 | "timeShift": null, 246 | "targets": [ 247 | { 248 | "refId": "A", 249 | "groupBy": { 250 | "timeInterval": "1s" 251 | }, 252 | "horAggregator": { 253 | "samplingRate": "1s", 254 | "unit": "millisecond", 255 | "factor": "1", 256 | "percentile": "0.75" 257 | }, 258 | "metric": "spark", 259 | "errors": {}, 260 | "downsampling": "sum", 261 | "sampling": "60s", 262 | "alias": "all" 263 | } 264 | ], 265 | "aliasColors": {}, 266 | "seriesOverrides": [], 267 | "downsampling": "sum", 268 | "sampling": "60s", 269 | "links": [] 270 | } 271 | ] 272 | } 273 | ], 274 | "time": { 275 | "from": "2016-02-11T10:55:00.337Z", 276 | "to": "2016-02-11T11:04:00.106Z" 277 | }, 278 | "timepicker": { 279 | "now": true, 280 | "refresh_intervals": [ 281 | "5s", 282 | "10s", 283 | "30s", 284 | "1m", 285 | "5m", 286 | "15m", 287 | "30m", 288 | "1h", 289 | "2h", 290 | "1d" 291 | ], 292 | "time_options": [ 293 | "5m", 294 | "15m", 295 | "1h", 296 | "6h", 297 | "12h", 298 | "24h", 299 | "2d", 300 | "7d", 301 | "30d" 302 | ] 303 | }, 304 | "templating": { 305 | "list": [] 306 | }, 307 | "annotations": { 308 | "list": [] 309 | }, 310 | "refresh": false, 311 | "schemaVersion": 8, 312 | "version": 7, 313 | "links": [] 314 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------