• This repository has been archived on 23/Mar/2023
  • Stars
    star
    171
  • Rank 215,031 (Top 5 %)
  • Language
    JavaScript
  • License
    ISC License
  • Created almost 12 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Firefly is a web application aimed at powerful, flexible time series graphing for web developers.

Firefly logo Firefly

Firefly is a web application aimed at powerful, flexible time series graphing for web developers.

Firefly provides an interface for reading time series data from any number of server-side data stores and produces corresponding real-time graphs in a web browser. Multiple metrics can combine into a single graph, and graphs combine together in grids to form a Dashboard - which you can use to get a high-level view of your services.

The current release ships with a DataSource that reads RRD files - specifically, those produced by Ganglia. However it's simple to expand to other sources, from an in-house relational database to a cross-network API.

Features

  • Line, stacked, and area graphs
  • Configure graphs with arbitrary numbers of data sources
  • Configure grids of graphs -- great for creating dashboards of related information
  • View graphs from multiple datacenters in the same dashboard
  • Show historical overlays along with your real-time data
  • Log-scale Y-axis
  • Support for isolated and embedded graphs
  • Native API support for annotations

Prerequisites

Firefly is written in Python and requires Python 2.6 or greater. In addition you will need libcurl-dev, librrd-dev, and librtmp-dev after which you can simply run pip install -e ..

YAML

Firefly's configuration is formatted entirely as YAML. YAML is pretty easy to pick up, but you'll still want to be familiar with the YAML Spec if you are not already.

Data Sources

The core of Firefly is the abstract concept of a DataSource. A DataSource just needs to expose a certain interface (methods to list available metrics, and get the data for a particular metric between particular timestamps) - beyond that, the system is datastore-agnostic and should be widely expandable. We've included a DataSource for parsing Ganglia RRD files out of the box. But Firefly is not just a front-end for Ganglia, and in time we'll be looking to release more of the metrics gathering tools we use behind Firefly.

For Ganglia support, the rrdcached integration wiki page might be of use, as Firefly will work best if it speaks to rrdcached to protect your hard disks from getting hammered.

Getting Started

To get up and running immediately, make sure you update your submodules: git submodule update --init. Then simply run python -m firefly.main --testing -c firefly.yaml.example from your Firefly checkout. The configuration option is now required due to the secret key being stored in it.

For more help: python -m firefly.main --help or take a peek in firefly.yaml.example

Note: Some configuration options can only be specified in your YAML configuration file.

Deploying

How Firefly Runs in Production

Firefly is divided into two parts: a data server and a UI server. How you deploy these parts of Firefly will depend on how your existing deployments are structured.

The UI server is a thin wrapper that mostly serves static content, so you'll likely only run one of them. The data server will be run wherever you need a local process to access stored metrics. For instance, if you have Ganglia's RRD files stored on a single server in each of two datacenters, you'd want to run data servers on those same machines. The UI server can be configured to know about both data servers, and the whole system will work from a unified interface. Additionally, the UI server can be behind HTTP Basic Auth, and will use a mildly secure short-lived token to talk to the data servers - a necessity, since browsers don't elegantly support Basic Auth dialogs when doing CORS AJAX requests.

Setting Up the Data Servers

In your data server configuration files, you will want to specify omit_ui_server: true. This will instruct Firefly to only start a data server and not a UI server. You will also want to be sure that the RRD socket and storage locations are set appropriately for any data sources you configure, including Ganglia. You may also wish to change the port of the data server if you are running it behind a reverse proxy.

Setting Up the UI Server

You will need to specify each data server you set up in the data_servers section of the ui_server configuration section. Data servers are specified by the URL they can be reached at in the name attribute and a description of the data server's environment in the desc attribute.

If you are hosting Firefly on the same machine as other web services or running behind a reverse proxy, you might want to set url_path_prefix and port to your desired values. By default Firefly runs with a url prefix of /firefly/ when not in --testing mode.

Starting Your Firefly Servers

Simply start each Firefly instance you have in your various environments with the appropriate configuration files:

python -m firefly.main -c <configuration file>

Developing

First, give yourself a base YAML configuration file. cp firefly.yaml.example firefly.yaml. Firefly reads from firefly.yaml first and then overrides the values specified in this file with any command line options specified. This is allows you to flip various switches during development which you can then set later in your production config (configuration files specified with -c will always override other command line options).

There are a few configuration options you'll want to fill in before you can start graphing. Firefly is divided into two parts: a data server and a ui server, each of which has its own set of configuration options. Below are the various options you'll want to set to get started from a fresh checkout.

Data Server Configuration

If you have an accessible Ganglia instance running, you should set the location of the Ganglia RRD socket and storage in the rrdcached_socket and rrdcached_storage settings of data_sources.ganglia_rrd.GangliaRRD:

data_source_config:
	data_sources.ganglia_rrd.GangliaRRD:
		rrdcached_socket: "/path/to/your/ganglia/rrd/unix/domain/socket.sock"
		rrdcached_storage: "/path/to/your/ganglia/rrd/storage"

If you do not have Ganglia running, comment out this data source in the data_sources section:

data_sources:
	# - data_sources.ganglia_rrd.GangliaRRD
	- data_sources.stat_monster_rrd.StatMonsterRRD

If you want to run with any additional custom data sources, add them to the data_sources section and provide the kwargs they will be passed in the data_source_config section.

Vagrant

If you have Vagrant installed running vagrant up will get you started. When the virtual machine is up you can point your browser to http://localhost:8889. See Vagrantfile for the details of the setup.

Running Firefly

python -m firefly.main -c <configuration file> --testing

This starts both a data server and a UI server in the same web server running on the local machine. The UI server is accessible on localhost:8889 by default. Note that you do not need to have any data servers configured in the UI server for the UI server to know about the local data server running alongside it!

Firefly will also give you a test data source to use, which will produce a constant sine wave across all time periods.

Miscellaneous Configuration

Annotations

Firefly supports annotating graphs with various events that you might be interested in. To add annotations simply send an HTTP POST request to the /add_annotation endpoint on each of your data servers that the annotation applies to. This endpoint expects four arguments in the POST body:

  • token - A token obtained from the UI server (GET http://ui_server/token).
  • type - Specifies the type of annotation. Should be a single word with alphanumeric characters only. This is the text displayed on the graphs next to the annotation marker.
  • description - A description of the event this annotation is for.
  • time - The time the annotation occurred, as a floating point number of seconds since the epoch.

Database Files

You can control where the data server and UI server put their SQLite database files with the db_file configuration variable, which can be set for both data_server and ui_server.

More Repositories

1

elastalert

Easy & Flexible Alerting With ElasticSearch
Python
7,926
star
2

dumb-init

A minimal init system for Linux containers
Python
6,624
star
3

detect-secrets

An enterprise friendly way of detecting and preventing secrets in code.
Python
3,395
star
4

mrjob

Run MapReduce jobs on Hadoop or Amazon Web Services
Python
2,609
star
5

osxcollector

A forensic evidence collection & analysis toolkit for OS X
Python
1,858
star
6

paasta

An open, distributed platform as a service
Python
1,655
star
7

undebt

A fast, straightforward, reliable tool for performing massive, automated code refactoring
Python
1,632
star
8

MOE

A global, black box optimization engine for real world metric optimization.
C++
1,306
star
9

dockersh

A shell which places users into individual docker containers
Go
1,282
star
10

dataset-examples

Samples for users of the Yelp Academic Dataset
Python
1,189
star
11

yelp.github.io

A showcase of projects we've open sourced and open source projects we use
JavaScript
701
star
12

bravado

Bravado is a python client library for Swagger 2.0 services
Python
600
star
13

yelp-api

Examples of code using our v2 API
PHP
580
star
14

service-principles

A guide to service principles at Yelp for our service oriented architecture
423
star
15

swagger-gradle-codegen

💫 A Gradle Plugin to generate your networking code from Swagger
Kotlin
407
star
16

pyleus

Pyleus is a Python framework for developing and launching Storm topologies.
Python
406
star
17

mysql_streamer

MySQLStreamer is a database change data capture and publish system.
Python
405
star
18

yelp-fusion

Yelp Fusion API
Python
396
star
19

docker-custodian

Keep docker hosts tidy
Python
354
star
20

android-school

The best videos from the Android community and beyond
349
star
21

Tron

Next generation batch process scheduling and management
Python
340
star
22

kafka-utils

Python
312
star
23

bento

A delicious framework for building modularized Android user interfaces, by Yelp.
Kotlin
305
star
24

Testify

A more pythonic testing framework.
Python
303
star
25

clusterman

Cluster Autoscaler for Kubernetes and Mesos
Python
295
star
26

kotlin-android-workshop

A Kotlin Workshop for engineers familiar with Java and Android development.
Kotlin
289
star
27

threat_intel

Threat Intelligence APIs
Python
264
star
28

python-gearman

Gearman API - Client, worker, and admin client interfaces
Python
242
star
29

nrtsearch

A high performance gRPC server on top of Apache Lucene
Java
239
star
30

py_zipkin

Provides utilities to facilitate the usage of Zipkin in Python
Python
223
star
31

fuzz-lightyear

A pytest-inspired, DAST framework, capable of identifying vulnerabilities in a distributed, micro-service ecosystem through chaos engineering testing and stateful, Swagger fuzzing.
Python
193
star
32

yelp-python

A Python library for the Yelp API
Python
182
star
33

venv-update

Synchronize your virtualenv quickly and exactly.
Python
178
star
34

amira

AMIRA: Automated Malware Incident Response & Analysis
Python
151
star
35

YLTableView

Objective-C
146
star
36

love

A system to share your appreciation
Python
141
star
37

aactivator

Automatically source and unsource a project's environment
Python
139
star
38

lemon-reset

Consistent, cross-browser React DOM tags, powered by CSS Modules. 🍋
JavaScript
131
star
39

detect-secrets-server

Python
109
star
40

bravado-core

Python
108
star
41

data_pipeline

Data Pipeline Clientlib provides an interface to tail and publish to data pipeline topics.
Python
108
star
42

dataloader-codegen

🤖 dataloader-codegen is an opinionated JavaScript library for automatically generating DataLoaders over a set of resources (e.g. HTTP endpoints).
TypeScript
107
star
43

yelp-ruby

A Ruby gem for communicating with the Yelp REST API
Ruby
105
star
44

swagger_spec_validator

Python
103
star
45

ybinlogp

A fast mysql binlog parser
C
97
star
46

beans

Bringing people together, one cup of coffee at a time
Python
90
star
47

casper

A fast web application platform built in Rust and Luau
Rust
86
star
48

schematizer

A schema store service that tracks and manages all the schemas used in the Data Pipeline
Python
85
star
49

requirements-tools

requirements-tools contains scripts for working with Python requirements, primarily in applications.
Python
81
star
50

osxcollector_output_filters

Filters that process and transform the output of osxcollector
Python
76
star
51

sensu_handlers

Custom Sensu Handlers to support a multi-tenant environment, allowing checks themselves to emit the type of handler behavior they need in the event json
Ruby
75
star
52

kegmate

Arduino/iPad powered kegerator
Objective-C
72
star
53

graphql-guidelines

GraphQL @ Yelp Schema Guidelines
Makefile
70
star
54

ephemeral-port-reserve

Find an unused port, reliably
Python
66
star
55

parcelgen

Helpful tool to make data objects easier for Android
Python
65
star
56

yelp-ios

Objective-C
62
star
57

salsa

A tool for exporting iOS components into Sketch 📱💎
Swift
62
star
58

docker-observium

Observium docker image with both professional and community edition support, ldap auth, and easy plugin support.
ApacheConf
57
star
59

yelp-android

Java
55
star
60

terraform-provider-signalform

SignalForm is a terraform provider to codify SignalFx detectors, charts and dashboards
Go
44
star
61

mycroft

Python
42
star
62

terraform-provider-gitfile

Terraform provider for checking out git repositories and making changes
Go
40
star
63

pidtree-bcc

eBPF tool for logging process ancestry of outbound TCP connections
Python
40
star
64

ffmpeg-android

Shell
39
star
65

pushmanager

Pushmanager is a web application to manage source code deployments.
Python
38
star
66

zygote

A Python HTTP process management utility.
Python
38
star
67

yelp_kafka

An extension of the kafka-python package that adds features like multiprocess consumers.
Python
38
star
68

pgctl

Manage sets of developer services -- "playground control"
Python
31
star
69

EMRio

Elastic MapReduce instance optimizer
Python
31
star
70

s3mysqldump

Dump mysql tables to s3, and parse them
Python
31
star
71

pyramid_zipkin

Pyramid tween to add Zipkin service spans
Python
28
star
72

android-varanus

A client-side Android library to monitor and limit network traffic sent by your apps
Kotlin
27
star
73

puppet-netstdlib

A collection of Puppet functions for interacting with the network
Ruby
27
star
74

sqlite3dbm

sqlite-backed dictionary conforming to the dbm interface
Python
27
star
75

send_nsca

Pure-python NSCA client
Python
26
star
76

data_pipeline_avro_util

Provides a Pythonic interface for reading and writing Avro schemas
Python
26
star
77

cocoapods-readonly

Automatically locks all CocoaPod source files.
Ruby
26
star
78

uwsgi_metrics

Python
26
star
79

docker-push-latest-if-changed

Python
25
star
80

WebImageView

An enhanced and improved ImageView for Android that displays images loaded over the interwebs
Java
25
star
81

task_processing

Interfaces and shared infrastructure for generic task processing at Yelp.
Python
23
star
82

PushmasterApp

(Legacy) Yelp pushmaster application built on Google App Engine
Python
22
star
83

tlspretense-service

A Docker container that exposes tlspretense on a port.
Makefile
20
star
84

puppet-uchiwa

Puppet module for installing Uchiwa
Ruby
20
star
85

yelp_cheetah

cheetah, hacked by yelpers
Python
20
star
86

logfeeder

Python
20
star
87

fido

Asynchronous HTTP client built on top of Crochet and Twisted
Python
20
star
88

pyramid-hypernova

A Python client for Airbnb's Hypernova server, for use with the Pyramid web framework.
Python
19
star
89

swagger-spec-compatibility

Python library to check Swagger Spec backward compatibility
Python
19
star
90

mr3po

protocols for use with mrjob
Python
16
star
91

YPFastDateParser

A class for parsing strings into NSDate instances, several times faster than NSDateFormatter
Objective-C
15
star
92

yelp_uri

Utilities for dealing with URIs, invented and maintained by Yelp.
Python
14
star
93

pysensu-yelp

A Python library to emit Sensu events that the Yelp Sensu Handlers can understand for Self-Service Sensu Monitoring
Python
14
star
94

terraform-provider-cloudhealth

Terraform provider for Cloudhealth
Go
14
star
95

yelp-rails-example

An example Rails application that uses the Yelp gem to integrate with the API
Ruby
13
star
96

named_decorator

Dynamically name wrappers based on their callees to untangle profiles of large python codebases
Python
12
star
97

pt-online-schema-change-plugins

Perl
11
star
98

puppet-cron

A super great cron Puppet module with timeouts, locking, monitoring, and more!
Ruby
11
star
99

doloop

Task loop for keeping things updated
Python
10
star
100

environment_tools

Tools for programmatically describing Yelp's different environments (prod, dev, stage)
Python
10
star