Skip to content
Snippets Groups Projects
Commit 3b7c0a1b authored by thijsheijden's avatar thijsheijden
Browse files

Added prometheus metrics tracking

parent bbb4f41f
No related branches found
No related tags found
No related merge requests found
package main
import (
"log"
"net/http"
"query-service/internal/drivers/rpcdriver"
"query-service/internal/usecases/consume"
"query-service/internal/usecases/databaseinfo"
......@@ -11,6 +13,7 @@ import (
"git.science.uu.nl/datastrophe/keyvaluestore"
"git.science.uu.nl/datastrophe/query-conversion/aql"
"git.science.uu.nl/datastrophe/query-execution/arangodb"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/thijsheijden/alice"
)
......@@ -45,5 +48,10 @@ func main() {
go consumeService.Start()
// Expose /metrics endpoint for prometheus
logger.Log("Starting metrics server")
http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(":8080", nil))
select {}
}
apiVersion: apps/v1
kind: Deployment
metadata:
name: query-handler
name: query-service
labels:
app: query-service
monitor: go-service
spec:
replicas: 1
selector:
matchLabels:
app: query-service
monitor: go-service
template:
metadata:
labels:
app: query-service
app: query-service
monitor: go-service
spec:
containers:
- name: query-service
image: datastropheregistry.azurecr.io/query-service:latest
ports:
- containerPort: 3000
- containerPort: 8080
env:
- name: RABBIT_HOST
value: rabbitmq
......
......@@ -7,5 +7,6 @@ spec:
selector:
app: query-service
ports:
- port: 3000
targetPort: 3000
\ No newline at end of file
- name: monitoring
port: 8080
targetPort: 8080
\ No newline at end of file
......@@ -7,14 +7,11 @@ require (
git.science.uu.nl/datastrophe/keyvaluestore v0.0.0-20210517170603-34902cd5c90d
git.science.uu.nl/datastrophe/query-conversion v0.0.0-20210518093948-06ff65cdf577
git.science.uu.nl/datastrophe/query-execution v0.0.0-20210518112715-043c7046dc7b
github.com/arangodb/go-driver v0.0.0-20210518064911-4985e8be3d90
github.com/boumenot/gocover-cobertura v1.1.0 // indirect
github.com/prometheus/client_golang v1.10.0
github.com/stretchr/testify v1.7.0
github.com/thijsheijden/alice v0.1.18
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
golang.org/x/tools v0.1.1 // indirect
google.golang.org/grpc v1.37.1
google.golang.org/protobuf v1.26.0
)
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment