Skip to content

Commit

Permalink
fix prom startup and add block profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
gfr10598 committed Oct 28, 2019
1 parent 7901d44 commit a2fe94b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/gardener/gardener.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,24 @@ func init() {
}

func main() {
flag.Parse()

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

if env.Error != nil {
log.Println(env.Error)
log.Println(env)
os.Exit(1)
}

// Enable block profiling
runtime.SetBlockProfileRate(1000000) // One event per msec.

// Expose prometheus and pprof metrics on a separate port.
prometheusx.MustServeMetrics()


// Check if invoked as a service.
isService, _ := strconv.ParseBool(os.Getenv("GARDENER_SERVICE"))
if isService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
containers:
- image: gcr.io/{{GCLOUD_PROJECT}}/github-m-lab-etl-gardener:{{GIT_COMMIT}}
name: etl-gardener
args: ["--prometheusx.listen-address=:9090"]
env:
- name: GARDENER_SERVICE
value: "true"
Expand Down

0 comments on commit a2fe94b

Please sign in to comment.