-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from zapier/combine-steps
Add some production metrics
- Loading branch information
Showing
9 changed files
with
125 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,11 +50,12 @@ build-binary: | |
build-docker: | ||
FROM alpine:${ALPINE_VERSION} | ||
COPY +build-binary/prom-aggregation-gateway . | ||
ENV GIN_MODE=release | ||
ENTRYPOINT ["/prom-aggregation-gateway"] | ||
SAVE IMAGE --push ${image_name}:${version} | ||
|
||
continuous-deploy: | ||
BUILD +release-helm | ||
BUILD +build-helm | ||
|
||
build-binaries: | ||
FROM golang:${GOLANG_VERSION} | ||
|
@@ -162,21 +163,13 @@ test-helm: | |
build-helm: | ||
FROM quay.io/helmpack/chart-releaser:v${CHART_RELEASER_VERSION} | ||
|
||
WORKDIR /src | ||
COPY . /src | ||
|
||
RUN cr --config .github/cr.yaml package charts/* | ||
SAVE ARTIFACT .cr-release-packages/ AS LOCAL ./dist | ||
|
||
release-helm: | ||
FROM quay.io/helmpack/chart-releaser:v${CHART_RELEASER_VERSION} | ||
|
||
ARG token | ||
|
||
WORKDIR /src | ||
COPY . /src | ||
|
||
RUN cr --config .github/cr.yaml package charts/* | ||
SAVE ARTIFACT .cr-release-packages/ AS LOCAL ./dist | ||
|
||
RUN mkdir -p .cr-index | ||
RUN git config --global user.email "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
```mermaid | ||
graph TD | ||
lint-golang --> test | ||
test-golang --> test | ||
test-helm --> test | ||
build-binary --> build | ||
build-docker --> build | ||
build-helm --> build | ||
build-binary --> build-docker | ||
release-binary --> release | ||
release-binary -.create release.-> github | ||
release-docker --> release | ||
release-docker -.push package.-> github | ||
build-binary --> release-binary | ||
build-docker --> release-docker | ||
release-helm --> continuous-deploy | ||
release-helm -.push to gh-pages.-> github | ||
go-deps --> build-binary | ||
go-deps --> lint-golang | ||
go-deps --> test-golang | ||
build --> build-docker | ||
build --> build-helm | ||
build-docker --> build-binary | ||
continuous-deploy --> build-helm | ||
lint-golang --> go-deps | ||
test-golang --> go-deps | ||
test --> ci-golang | ||
release --> build-docker | ||
release --> release-binaries | ||
build-binary --> go-deps | ||
ci-golang --> lint-golang | ||
ci-golang --> test-golang | ||
ci-helm --> test-helm | ||
release-binaries --> build-binaries | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
const MetricsNamespace = "prom_agg_gateway" | ||
|
||
var promRegistry = prometheus.NewRegistry() | ||
|
||
func init() { | ||
promRegistry.MustRegister( | ||
TotalFamiliesGauge, | ||
MetricCountByFamily, | ||
MetricPushes, | ||
) | ||
} | ||
|
||
var TotalFamiliesGauge = prometheus.NewGauge( | ||
prometheus.GaugeOpts{ | ||
Namespace: MetricsNamespace, | ||
Name: "total_families", | ||
Help: "Total number of metric families", | ||
}, | ||
) | ||
|
||
var MetricCountByFamily = prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Namespace: MetricsNamespace, | ||
Name: "metrics_by_family", | ||
Help: "Metric count by family", | ||
}, | ||
[]string{ | ||
"family", | ||
}, | ||
) | ||
|
||
var MetricCountByType = prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Namespace: MetricsNamespace, | ||
Name: "metrics_by_type", | ||
Help: "Metric count by type", | ||
}, | ||
[]string{ | ||
"metric_type", | ||
}, | ||
); | ||
|
||
var MetricPushes = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: MetricsNamespace, | ||
Name: "metric_pushes", | ||
Help: "Total number of metric push requests, per job", | ||
}, | ||
[]string{ | ||
"push_job", | ||
}, | ||
) |
This file contains 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
This file contains 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
This file contains 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