Skip to content

Instantly share code, notes, and snippets.

View ivanahuckova's full-sized avatar

Ivana Huckova ivanahuckova

View GitHub Profile
groups:
- name: AllInstances
rules:
- alert: InstanceDown
# Condition for alerting
expr: up == 0
for: 1m
# Annotation - additional informational labels to store more information
annotations:
title: 'Instance {{ $labels.instance }} down'
global:
# How frequently to scrape targets
scrape_interval: 10s
# How frequently to evaluate rules
evaluation_interval: 10s
# Rules and alerts are read from the specified file(s)
rule_files:
- rules.yml
global:
resolve_timeout: 1m
slack_api_url: 'https://hooks.slack.com/services/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'
route:
receiver: 'slack-notifications'
receivers:
- name: 'slack-notifications'
slack_configs:
global:
resolve_timeout: 1m
slack_api_url: 'https://hooks.slack.com/services/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'
route:
receiver: 'slack-notifications'
receivers:
- name: 'slack-notifications'
slack_configs:
global:
resolve_timeout: 1m
pagerduty_url: 'https://events.pagerduty.com/v2/enqueue'
route:x
receiver: 'pagerduty-notifications'
receivers:
- name: 'pagerduty-notifications'
pagerduty_configs:
global:
resolve_timeout: 1m
route:
receiver: 'gmail-notifications'
receivers:
- name: 'gmail-notifications'
email_configs:
- to: monitoringinstances@gmail.com
// Include all necessary libraries
#include <Arduino.h>
#include <WiFi.h>
#include <NTPClient.h>
#include <HTTPClient.h>
#include <DHT.h>
#include <HCSR04.h>
#include "config.h"
package main
import (
"fmt"
"math/rand"
"os"
"os/signal"
"syscall"
"time"
"github.com/afiskon/promtail-client/promtail"
)
@ivanahuckova
ivanahuckova / PromMonacoEditor.tsx
Last active January 15, 2021 17:34
Dependencies that needs to be installed: @monaco-editor and monaco-promql.
import React, { ReactNode } from 'react';
import { css } from 'emotion';
import _ from 'lodash';
import { ButtonCascader, CascaderOption, withTheme } from '@grafana/ui';
import { ExploreQueryFieldProps, QueryHint, GrafanaTheme } from '@grafana/data';
//Monaco
import { ControlledEditor as Editor, monaco } from '@monaco-editor/react';
import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",