This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: > | |
| SAM template for lambstatus application | |
| # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst | |
| Globals: | |
| Function: | |
| Timeout: 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_status_status_from_victorops_status (victorops_status, victorOps_current_alert_phase): | |
| if victorops_status == "CRITICAL" and victorOps_current_alert_phase == "UNACKED": | |
| return "Identified" | |
| elif victorops_status == "CRITICAL" and victorOps_current_alert_phase == "ACKED": | |
| return "Investigating" | |
| elif victorOps_current_alert_phase == "RESOLVED" or victorops_status == "RESOLVED" : | |
| return "Resolved" | |
| else: | |
| return "Monitoring" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| def get_api_headers(config): | |
| headers = { | |
| "x-api-key": config.get("apiKey"), | |
| "Content-Type": "application/json" | |
| } | |
| return headers | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #REQUIRES THE FOLLOWING ENVIRONMENT VARIABLES: APPD_USER, APPD_PASS | |
| require "rest-client" | |
| require "json" | |
| require "date" | |
| require "active_support/all" | |
| class AppD | |
| def get_time(datapoint) | |
| time = datapoint[:startTimeInMillis] || "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Dashing.Hotmeter extends Dashing.Widget | |
| @accessor 'value', Dashing.AnimatedValue | |
| getMeterColour: (stage) -> | |
| return switch | |
| when stage == 0 then "#88C100" | |
| when stage == 1 then "#88C100" | |
| when stage == 2 then "#FABE28" | |
| when stage == 3 then "#FF8A00" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.thehutgroup.bootstarters.metrics | |
| import io.micrometer.core.instrument.MeterRegistry | |
| import io.micrometer.spring.autoconfigure.MeterRegistryCustomizer | |
| import org.springframework.beans.factory.annotation.Value | |
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| @Configuration | |
| open class MetricsConfiguration(@Value("\${aws.region}") val region: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.thehutgroup.example.event.processor; | |
| import com.thehutgroup.voyager.event.DomainEventPublisher; | |
| import io.micrometer.core.instrument.Counter; | |
| import io.micrometer.core.instrument.MeterRegistry; | |
| import io.micrometer.core.instrument.Tags; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Component; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: Cloudformation for the Prometheus stack | |
| Parameters: | |
| VPC: | |
| Description: VPC | |
| Type: AWS::EC2::VPC::Id | |
| AppSubnet1: | |
| Description: AppSubnet1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - debug: msg="Deploying prometheus and m3coordinator" | |
| - name: Fetch m3db | |
| shell: wget https://github.com/m3db/m3/releases/download/v0.4.8/m3_0.4.8_linux_amd64.tar.gz -O /tmp/m3_0.4.8_linux_amd64.tar.gz | |
| - name: Make directory if not present | |
| file: path=/opt/m3 state=directory | |
| - name: Make directory if not present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: Database cluster for the creation of m3db cluster. | |
| Parameters: | |
| ... | |
| AZ1SeedNode: | |
| Description: AZ Seed node | |
| Type: String |