All Projects → bia-technologies → statsbit

bia-technologies / statsbit

Licence: Apache-2.0 License
NewRelic drop-in replacement on top of Grafana and TimescaleDB

Programming Languages

clojure
4091 projects
ruby
36898 projects - #4 most used programming language
HTML
75241 projects
PLpgSQL
1095 projects

Projects that are alternatives of or similar to statsbit

gitactionboard
GitactionBoard - Ultimate Dashboard for GithubActions.
Stars: ✭ 30 (+57.89%)
Mutual labels:  monitoring-tool
aws-clustered-video-streams
A clustered video stream is an AWS architecture that increases the quality and reliability of live events by providing seamless regional failover capabilities for live video steams. Operators can monitor the status of the clustered stream from a single pane of glass and dynamically control from which region the stream consumed by a player origin…
Stars: ✭ 35 (+84.21%)
Mutual labels:  monitoring-tool
dawgmon
dawg the hallway monitor - monitor operating system changes and analyze introduced attack surface when installing software
Stars: ✭ 52 (+173.68%)
Mutual labels:  monitoring-tool
ros jetson stats
🐢 The ROS jetson-stats wrapper. The status of your NVIDIA jetson in diagnostic messages
Stars: ✭ 55 (+189.47%)
Mutual labels:  monitoring-tool
treblle-laravel
The offical Treblle package for Laravel
Stars: ✭ 43 (+126.32%)
Mutual labels:  monitoring-tool
rclshark
Tool for ROS 2 IP Discovery + System Monitoring
Stars: ✭ 32 (+68.42%)
Mutual labels:  monitoring-tool
MonitoFi
MonitoFi: Health & Performance Monitor for your Apache NiFi
Stars: ✭ 40 (+110.53%)
Mutual labels:  monitoring-tool
newrelic
💎 NewRelic PHP agent integration for Nette Framework (@nette)
Stars: ✭ 19 (+0%)
Mutual labels:  newrelic
aws-lambda-http-check
Lambda function to check http endpoint wrapped in serverless project
Stars: ✭ 30 (+57.89%)
Mutual labels:  monitoring-tool
newrelic-quickstarts
New Relic One quickstarts help accelerate your New Relic journey by providing immediate value for your specific use cases.
Stars: ✭ 46 (+142.11%)
Mutual labels:  newrelic
newrelic-telemetry-sdk-java
Java library for sending telemetry data to New Relic
Stars: ✭ 34 (+78.95%)
Mutual labels:  newrelic
newrelic-cli
Newrelic client written in Python providing both CLI and Python interfaces
Stars: ✭ 26 (+36.84%)
Mutual labels:  newrelic
wigo
Wigo, aka "What Is Going On" is a light pull/push monitoring tool written in Golang.
Stars: ✭ 33 (+73.68%)
Mutual labels:  monitoring-tool
serverless-plugin-epsagon
Epsagon's plugin for Serverless Framework ⚡️
Stars: ✭ 53 (+178.95%)
Mutual labels:  monitoring-tool
php7-alpine
Docker container for PHP 7 in Alpine Linux, with almost all extensions that you may need
Stars: ✭ 20 (+5.26%)
Mutual labels:  newrelic
netcheck
A shell script to check and log when your internet connection goes down.
Stars: ✭ 138 (+626.32%)
Mutual labels:  monitoring-tool
newrelic-context
Contains different helpers to make life easier with NewRelic and Context.
Stars: ✭ 21 (+10.53%)
Mutual labels:  newrelic
tmo-live-graph
A simpe react app that plots a live view of the T-Mobile Home Internet Nokia 5G Gateway signal stats, helpful for optimizing signal.
Stars: ✭ 15 (-21.05%)
Mutual labels:  monitoring-tool
lo2s
Linux OTF2 Sampling - A Lightweight Node-Level Performance Monitoring Tool
Stars: ✭ 24 (+26.32%)
Mutual labels:  monitoring-tool
newrelic-telemetry-sdk-python
A python library to send data to New Relic!
Stars: ✭ 23 (+21.05%)
Mutual labels:  newrelic

Statsbit

dashboard

It is the NewRelic drop-in replacement. It works with all NewRelic's agents that support the 17th protocol version. In BIA we use agents on ruby, python, go, java.

Statsbit isn't a full NewRelic replacement. It doesn't support browser monitoring, distribution tracing, and so on. But if you want to store your data behind the firewall and can use only basic features, you're in the right place.

Statsbit consists of Backend and UI. Backend is written in Clojure and stores data in TimescaleDB. UI is built on top of Grafana.

Example

  • git clone https://github.com/bia-technologies/statsbit.git
  • cd statsbit/example
  • docker-compose up -d statsbit-timescale statsbit-postgres app-postgres
  • wait a second
  • docker-compose up
  • open grafana
    • user: admin
    • password: admin_password
  • it requires some time to send the first metrics, so just wait a minute
  • that's it!

Requirements

Statsbit requires Postgres with the Timescale extension. We run it on Postgres 11, 12, 13 with Timescale 1.7.x or 2.x.

Also, every NewRelic agent requires a valid SSL certificate for the backend.

Statsbit distributes via docker images, so you need Docker to run it. We run it in our Kubernetes cluster.

And of course, you need a lot of free disk space. It takes us about 500 GB to store data for 6 months.

Install

You can found docker images here. There are two images:

  • biatechru/statsbit:master-backend-{{ N }}-{{ SHA }}
  • biatechru/statsbit:master-grafana-{{ N }}-{{ SHA }}

Also, you need to use the backend containers with a reverse proxy with a valid SSL certificate. For example, you can use Nginx or Kubernetes Ingress Controller.

Configuration

Both Backend and UI are configurable via environment variables.

Backend

STATSBIT_BACKEND_MIGRATION_LOCATIONS=db/migration/common,db/migration/timescale_2.x,db/migration/prod_server_2.x

STATSBIT_BACKEND_PORT=3000

STATSBIT_BACKEND_DB_POOL_ACQUIRE_INCREMENT=1
STATSBIT_BACKEND_DB_POOL_MIN_POOL_SIZE=1
STATSBIT_BACKEND_DB_POOL_MAX_POOL_SIZE=4

STATSBIT_BACKEND_JETTY_MIN_THREADS=1
STATSBIT_BACKEND_JETTY_MAX_THREADS=4

STATSBIT_BACKEND_DB_NAME=statsbit_db
STATSBIT_BACKEND_DB_HOST=1.1.1.1
STATSBIT_BACKEND_DB_PORT=5432
STATSBIT_BACKEND_DB_USER=statsbit_user
STATSBIT_BACKEND_DB_PASSWORD=statsbit_password

STATSBIT_BACKEND_MIGRATION_LOCATIONS is a comma separated list of paths:

  • db/migration/common - contains common migrations
  • db/migration/timescale_2.x - contains migrations for timescale 1.x
  • db/migration/prod_server_2.x - contains default settings for a production server that stores data for 6 months.
  • db/migration/test_server_2.x - contains default settings for a test server that stores data for 1 month.

Use this paths if you use timescale 1.7.x:

  • db/migration/timescale_1.x
  • db/migration/prod_server_1.x
  • db/migration/test_server_1.x

Statsbit uses FlyWay's migrations. So you can add custom migration in classpath, filesystem or aws s3. Please read its documentation. For example: STATSBIT_BACKEND_MIGRATION_LOCATIONS=db/migration/common,db/migration/timescale_2.x,filesystem:/path/to/your/server/migrations.

You can also configure Sentry and even NewRelic.

STATSBIT_BACKEND_SENTRY_DSN=http://some_dsn

NEW_RELIC_APP_NAME=statsbit
NEW_RELIC_LOG_LEVEL=info
NEW_RELIC_LOG=stdout
NEW_RELIC_LICENSE_KEY=some_license
NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT=false

Grafana

STATSBIT_GRAFANA_DATASOURCE_URL=1.1.1.1:5432
STATSBIT_GRAFANA_DATASOURCE_DATABASE=statsbit_db
STATSBIT_GRAFANA_DATASOURCE_USER=statsbit_grafana_user
STATSBIT_GRAFANA_DATASOURCE_PASSWORD=statsbit_grafana_password

STATSBIT_GRAFANA_DATASOURCE_MAX_OPEN_CONNS=4
STATSBIT_GRAFANA_DATASOURCE_MAX_IDLE_CONNS=2
STATSBIT_GRAFANA_DATASOURCE_CONN_MAX_LIFETIME=14400

GF_SECURITY_ADMIN_PASSWORD=admin_password

GF_DATABASE_TYPE=postgres
GF_DATABASE_HOST=1.1.1.1:5432
GF_DATABASE_NAME=grafana_db
GF_DATABASE_USER=grafana_user
GF_DATABASE_PASSWORD=grafana_password

Also you should set statement timeout for statsbit_grafana_user:

ALTER ROLE statsbit_grafana_user SET statement_timeout=120000;

Please check out other Grafana's settings. For example, you can configure LDAP.

Client configuration

You can use any NewRelic's client that supports the 17th version of the protocol. Please search protocol_version in the source code of the client.

NEW_RELIC_APP_NAME=your-cool-app
NEW_RELIC_AGENT_ENABLED=true

# It's required to use a valid ssl sertificate
NEW_RELIC_HOST=backend.your-company.com

# please check this path, it may be different
NEW_RELIC_CA_BUNDLE_PATH=/etc/ssl/certs/ca-bundle.crt
# NEW_RELIC_CA_BUNDLE_PATH=/etc/ssl/certs/ca-certificates.crt

NEW_RELIC_LICENSE_KEY=any-license # required but not used

# for debugging
NEW_RELIC_LOG=stdout
NEW_RELIC_LOG_LEVEL=debug # or 'info'

Tips

-- Drop all chunks older than 3 months ago:
SELECT drop_chunks(interval '3 months');

If you can't use an SSL certificate and you use the ruby agent, then you can disable this requirement by monkey-patching:

module NewRelicPatch
  module NewRelicService
    def setup_connection_for_ssl(conn)
      super conn
      conn.use_ssl = false
    end
  end
end

NewRelic::Agent::NewRelicService.prepend NewRelicPatch::NewRelicService

If you have a problem with Grafana migrations, please read this issue.

Naming

Early I maintained a fork of Errbit that used Postgres instead of MongoDB, so I chose a similar name.

License

Copyright © 2020 BIA-Technologies Limited Liability Company

Distributed under the Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].