Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Field fieldju

View GitHub Profile
View patch.yaml
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker
spec:
spinnakerConfig:
profiles:
spinnaker:
spinnaker:
extensibility:
@fieldju
fieldju / microk8s-dev.yaml
Last active Nov 24, 2020
Justin's Operator Config for his microk8s operator shrek env
View microk8s-dev.yaml
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker-armory-dev
namespace: spinnaker-armory-dev
spec:
spinnakerConfig:
config:
version: 2.22.0
persistentStorage:
View new-relic-api.ts
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 }) {
View dashboard.ts
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 Jun 23, 2020
monitor-daemon-prometheus-output.txt
View 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 Jun 23, 2020
armory-plugin-prometheus-output.txt
View 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
View ArcUnhealthyException.ts
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);
}
}
View HealthCheckController.ts
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;
View gist:41c72296c905142edf3930bbb42dfe4e
"clouddriver.clouddriver.authorization.missingApplication_count",
"clouddriver.clouddriver.authorization_count",
"clouddriver.clouddriver.aws.request.httpClientGetConnectionTime_count",
"clouddriver.clouddriver.aws.request.httpClientGetConnectionTime_max",
"clouddriver.clouddriver.aws.request.httpClientGetConnectionTime_total",
"clouddriver.clouddriver.cats.redisCache.evict.delOperations_count",
"clouddriver.clouddriver.cats.redisCache.evict.hashesDeleted_count",
"clouddriver.clouddriver.cats.redisCache.evict.hdelOperations_count",
"clouddriver.clouddriver.cats.redisCache.evict.itemCount_count",
"clouddriver.clouddriver.cats.redisCache.evict.keysDeleted_count",
View create-minikube-config-bundle.sh
#! /bin/bash
BUNDLE_HOME=${HOME}/minikube-config-bundle
rm -fr ${BUNDLE_HOME}
mkdir -p ${BUNDLE_HOME}
cp ${HOME}/.minikube/ca.crt ${BUNDLE_HOME}/ca.crt
cp ${HOME}/.minikube/profiles/minikube/client.crt ${BUNDLE_HOME}/client.crt.crt
cp ${HOME}/.minikube/profiles/minikube/client.key ${BUNDLE_HOME}/client.key
You can’t perform that action at this time.