A command line tool for filling missing metric values on Mackerel.

mackerel-null-bridge

Latest GitHub release Github Actions test Go Report Card License

A command line tool for filling missing metric values on Mackerel.

Description

When sending error metrics, etc., you may be forced to send them intermittently. When monitoring such intermittent metrics in Mackerel, alerts may not close automatically. This tool is designed to be run periodically, so it will fetch the values of the specified metrics not more than 15 minutes apart and interpolate the missing values. As a result, it expects to close alerts automatically, even for intermittent metrics.

Note: As of v0.0.0, only service metrics are still supported. This is because I can't think of any case where intermittent values are sent in the host metric.

Install

binary packages

Releases.

Homebrew tap

$ brew install mashiike/tap/mackerel-null-bridge

Usage

as CLI command

$mackerel-null-bridge
NAME:
   mackerel-null-bridge - A command line tool for filling missing metric values on Mackerel.

USAGE:
   mackerel-null-bridge --config 
   
     --apikey 
    
   

VERSION:
   0.0.0

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --apikey value, -k value  for access mackerel API (default: *********) [$MACKEREL_APIKEY]
   --config value, -c value  config file path, can set multiple [$CONFIG_FILE]
   --deploy                  deploy flag (cli only) (default: false)
   --dry-run                 dry-run flag (lambda only) (default: false) [$DRY_RUN]
   --log-level value         output log level (default: info) [$LOG_LEVEL]
   --help, -h                show help (default: false)
   --version, -v             print the version (default: false)

as AWS Lambda function

mackerel-null-bridge binary also runs as AWS Lambda function. mackerel-null-bridge implicitly behaves as a run command when run as a bootstrap with a Lambda Function

CLI options can be specified from environment variables. For example, when MACKEREL_APIKEY environment variable is set, the value is set to -apikey option.

Example Lambda functions configuration.

" } }, "Handler": "bootstrap", "MemorySize": 128, "Role": "arn:aws:iam::0123456789012:role/lambda-function", "Runtime": "provided.al2", "Timeout": 300 }">
{
  "FunctionName": "mackerel-null-bridge",
  "Environment": {
    "Variables": {
      "CONFIG_FILE": "config.yaml",
      "MACKEREL_APIKEY": "
   
    "
   
    }
  },
  "Handler": "bootstrap",
  "MemorySize": 128,
  "Role": "arn:aws:iam::0123456789012:role/lambda-function",
  "Runtime": "provided.al2",
  "Timeout": 300
}

Configuration file

YAML format.

=0.0.0" targets: - service: prod metric_name: hoge.fuga.piyo value: 0.0 delay_seconds: 300">
required_version: ">=0.0.0"

targets:
  - service: prod
    metric_name: hoge.fuga.piyo
    value: 0.0
    delay_seconds: 300

Special Thanks

@handlename gave me the idea to name this tool.

LICENSE

MIT

Comments
An open-source GitLab command line tool bringing GitLab's cool features to your command line
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Dec 30, 2022
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Dec 22, 2021
Json-match - Command line util for matching values in a JSON input

json-match Match JSON input by specifying key and value > json-match -json '{\"p

Jan 12, 2022
The standard library flag package with its missing features

cmd Package cmd is a minimalistic library that enables easy sub commands with the standard flag library. This library extends the standard library fla

Oct 4, 2022
The missing git branch --interactive

git branch-i I got cross that there's no git branch --interactive, so I made this. It's a very (very) simple curses-mode git branch/git checkout alter

Nov 2, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022
A command line tool for simplified docker volume command built with go

dockervol A command line tool for simplified docker volume command built with go. Features: Remove anonymous volume (beta) Remove volume by matching n

Dec 18, 2021
fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.
fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.

fofaX 0x00 Introduction fofax is a fofa query tool written in go, positioned as

Jan 8, 2023
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Jan 8, 2023
Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

Jan 16, 2022
Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Watcher - Develop your programs easily Watcher watches all the files present in the directory it is run from of the directory that is specified while

Mar 27, 2022
A rich tool for parsing flags and values in pure Golang

A rich tool for parsing flags and values in pure Golang. No additional library is required and you can use everywhere.

Jan 25, 2022
This CLI tool sends HTTP GET requests and print MD5 hash values of the response's body

HTTP Body Hash Generator This CLI (Command Line Interface) tool sends HTTP GET requests and print MD5 hash values of the response's body. Usage You ne

Feb 10, 2022
Arduino command line tool
Arduino command line tool

arduino-cli Arduino CLI is an all-in-one solution that provides builder, Boards/Library Manager, uploader, discovery and many other tools needed to us

Jan 7, 2023
Command line tool for Google Cloud Datastore, written in Go
Command line tool for Google Cloud Datastore, written in Go

dsio dsio is a command line tool for Google Cloud Datastore. This tool is under development. Please use in your own risk. Features Bulk upsert entitie

Feb 8, 2022
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Dec 31, 2022
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.

Command-line admin tool for observing and troubleshooting Postgres.

Dec 29, 2022
textnote is a command line tool for quickly creating and managing daily plain text notes.

textnote is a command line tool for quickly creating and managing daily plain text notes. It is designed for ease of use to encourage the practice of daily, organized note taking. textnote intentionally facilitates only the management (creation, opening, organizing, and consolidated archiving) of notes, following the philosophy that notes are best written in a text editor and not via a CLI.

Jan 2, 2023