Skip to content

Instantly share code, notes, and snippets.

View fieldju's full-sized avatar

Justin Field fieldju

View GitHub Profile
package io.armory.cloud.logging;
import ch.qos.logback.classic.pattern.TargetLengthBasedClassNameAbbreviator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.ThrowableProxyUtil;
import ch.qos.logback.core.LayoutBase;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.BufferedReader;
import java.io.IOException;
package main
import (
"context"
"fmt"
log "github.com/sirupsen/logrus"
"os"
"os/signal"
"sync"
"syscall"
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker
spec:
spinnakerConfig:
profiles:
spinnaker:
spinnaker:
extensibility:
@fieldju
fieldju / microk8s-dev.yaml
Last active November 24, 2020 18:13
Justin's Operator Config for his microk8s operator shrek env
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker-armory-dev
namespace: spinnaker-armory-dev
spec:
spinnakerConfig:
config:
version: 2.22.0
persistentStorage:
import axios from 'axios'
import { logger } from '../utils';
import NewRelicDashboard from '../model/NewRelicDashboard'
import { CreateDashboardRequest } from '../model/newrelic'
const { debug, info, warn, error } = logger;
export class NewRelicService {
private newRelicApiKeyByAccountIdMap: { [key: string]: string } = {}
public setApiKeys(newRelicApiKeyByAccountIdMap: { [key: string]: string }) {
import { DashboardWidget } from '../model/newrelic'
import NewRelicDashboard from '../model/NewRelicDashboard'
import Widget from '../model/Widget'
const widgets: DashboardWidget[] = [
Widget.builder()
.withTitle('Success Count')
.withNrql(
`SELECT count(controller.invocations)
FROM Metric
@fieldju
fieldju / monitor-daemon-prometheus-output.txt
Created June 23, 2020 22:07
monitor-daemon-prometheus-output.txt
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="2",minor="7",patchlevel="17",version="2.7.17"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 7.2146944e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 4.9577984e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
@fieldju
fieldju / armory-plugin-prometheus-output.txt
Created June 23, 2020 22:06
armory-plugin-prometheus-output.txt
# HELP tomcat_sessions_active_max_sessions
# TYPE tomcat_sessions_active_max_sessions gauge
tomcat_sessions_active_max_sessions{applicationName="clouddriver",armoryAppVersion="2.20.1",customerEnvName="fieldju-dev",customerName="armory",hostname="spin-clouddriver-8689585554-5cn27",lib="armory-observability-plugin",libVersion="v1.0.0-RC18",ossAppVersion="6.9.2-20200606020017",spinnakerRelease="1.20.5",version="6.9.2-20200606020017",} 0.0
# HELP redis_command_invocation_ping_total
# TYPE redis_command_invocation_ping_total counter
redis_command_invocation_ping_total{applicationName="clouddriver",armoryAppVersion="2.20.1",customerEnvName="fieldju-dev",customerName="armory",hostname="spin-clouddriver-8689585554-5cn27",lib="armory-observability-plugin",libVersion="v1.0.0-RC18",ossAppVersion="6.9.2-20200606020017",pipelined="false",poolName="primaryDefault",spinnakerRelease="1.20.5",success="true",version="6.9.2-20200606020017",} 17.0
# HELP jedis_pool_minIdle
# TYPE jedis_pool_minIdle gauge
jedis_pool_minIdle
import { HttpException, HttpStatus } from '@nestjs/common';
import HealthCheckResponse from '../domain/HealthCheckResponse';
export class ArcUnhealthyException extends HttpException {
constructor(private readonly healthCheckResponse: HealthCheckResponse) {
super(healthCheckResponse, HttpStatus.SERVICE_UNAVAILABLE);
}
}
import { Controller, Get } from '@nestjs/common';
import HealthCheckResponse from '../domain/HealthCheckResponse';
import STS from 'aws-sdk/clients/sts';
import { ArcUnhealthyException } from '../error/ArchUnhealthyException';
@Controller('/health')
export default class HealthCheckController {
private readonly secureTokenService: STS;