Skip to content

Instantly share code, notes, and snippets.

@rfidelis-tc
rfidelis-tc / dry-monitor-example.rb
Created April 30, 2022 20:20 — forked from solnic/dry-monitor-example.rb
A simple dry-monitor example
require 'dry/monitor/notifications'
module MyApp
def self.notifications
@__notifications__ ||= Dry::Monitor::Notifications.new(:my_app)
end
notifications.register_event("users.created")
class Logger
@rfidelis-tc
rfidelis-tc / METRICS.md
Created July 14, 2021 13:46 — forked from fralalonde/METRICS.md
Metrics naming & standards

Metrics are a contract

An application's metrics names and types make up an implicit contract which consequences of ignoring can be serious.

Humans depend on Metrics

Metric are used by systems admins to configure monitoring systems. Good metric names accurately and consistently convey meaning of the associated metric data. Admins should not have to look at the application code to understand what each metric represents. The name of a metric is often the only documentation available. Critical human decisions may have to be quickly made based on metrics, in these situations, their names should be as helpful and trustable as possible.

Machines depend on Metrics

Dashboards and alerting systems entirely depend on the metrics applications provides them. Changing the identifiers or meaning of the metrics will break these downstream applications, negating the very reason to emit metrics in the first place :

  • Alarms that shouldn't have gone off will go off
@rfidelis-tc
rfidelis-tc / ocserv.sh
Created April 27, 2021 11:35 — forked from pzgz/ocserv.sh
OpenConnect VPN Server Configuration Files on Linode Ubuntu
#!/bin/sh
### BEGIN INIT INFO
# Provides: ocserv
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Copyright Rene Mayrhofer, Gibraltar, 1999
# This script is distibuted under the GPL