Skip to content

Instantly share code, notes, and snippets.

View DazWilkin's full-sized avatar

Daz Wilkin DazWilkin

View GitHub Profile
@DazWilkin
DazWilkin / prometheus.go
Created January 22, 2018 00:17
OpenCensus Golang Prometheus sample
package main
import (
"context"
"html/template"
"log"
"math/rand"
"net/http"
"time"
@DazWilkin
DazWilkin / prometheus.yml
Created January 22, 2018 00:30
OpenCensus Golang Prometheus sample
scrape_configs:
- job_name: "prometheus"
scrape_interval: 15s
static_configs:
- targets: [
"localhost:9090"
]
- job_name: "opencensus"
scrape_interval: 15s
static_configs:
@DazWilkin
DazWilkin / stackdriver.go
Created January 22, 2018 01:35
OpenCensus Golang Prometheus sample
package main
import (
"context"
"fmt"
"log"
"math/rand"
"time"
"go.opencensus.io/exporter/stats/stackdriver"
@DazWilkin
DazWilkin / cloudbuild.yaml
Created February 2, 2018 19:51
Shhh… Golang (!!) Cloud Functions
steps:
- name: "gcr.io/cloud-builders/go"
args: ["build", "-tags","node","main.go"]
env: [
"GOARCH=amd64",
"GOOS=linux",
"CGO_ENABLED=0",
"GOPATH=/workspace"
]
- name: "gcr.io/cloud-builders/npm"
@DazWilkin
DazWilkin / deploy.sh
Last active February 9, 2018 02:23
Simulacrum of a Jenkins deployment to App Engine
export ORG=[[ORG]]
export ROOT=[[PROJECT_ROOT]]
export PROJECT=${ROOT}-$(shuf -i 1000-9999 -n 1)
export BILLING=[[BILLING]]
export VERSION=$(shuf -i 1000-9999 -n 1)
export REGION="us-central"
export SERVICES="cloudresourcemanager"
export ACCOUNT=$(gcloud config get-value account)
@DazWilkin
DazWilkin / main.go
Created February 10, 2018 01:37
github.com/salrashid123/istio_helloworld/blob/master/nodeapp/app.js in Golang
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
)
@DazWilkin
DazWilkin / prometheus.go
Last active February 13, 2018 14:50
Return to OpenCensus
package main
import (
"context"
"html/template"
"log"
"math/rand"
"net/http"
"time"
@DazWilkin
DazWilkin / stackdriver.go
Last active February 13, 2018 15:16
Return to OpenCensus
package main
import (
"context"
"fmt"
"log"
"math/rand"
"time"
"go.opencensus.io/exporter/stackdriver"
@DazWilkin
DazWilkin / main.go
Created February 17, 2018 02:38
Stackdriver Monitoring API v3 Golang
package main
import (
"context"
"fmt"
"log"
"time"
monitoring "cloud.google.com/go/monitoring/apiv3"
googlepb "github.com/golang/protobuf/ptypes/timestamp"
@DazWilkin
DazWilkin / deployment.yaml
Created February 18, 2018 21:10
Coral Health blockchain in Go … on K8s ;-)
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: coralhealth
labels:
run: coralhealth
annotations:
deployment.kubernetes.io/revision: '1'
spec: