golang

module
v0.0.0-...-c6ccb82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2023 License: MIT

README

golang

Example project to collect metrics from clients over gRPC.

Build

  1. Requires: go, gcc, make, podman

  2. make setup to install the build tools

  3. make builder to build the builder image

  4. make build to build

  5. make check to run the checkers

  6. make images to build the images

Deploy

  1. cd deploy

  2. Install ingress-nginx

     kubectl create namespace ingress-nginx
     helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
     helm install ingress-nginx ingress-nginx/ingress-nginx -n ingress-nginx
    
  3. Install prometheus

     helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
     helm install prometheus prometheus-community/prometheus -f prometheus-values.yaml
     kubectl apply -f prometheus-ingress.yaml
    
  4. Install grafana

     helm repo add grafana https://grafana.github.io/helm-charts
     helm install grafana grafana/grafana -f grafana-values.yaml \
     --set-file dashboards.default.client-metrics.json=client-metrics.json
     kubectl apply -f grafana-ingress.yaml
     kubectl get secret grafana -o jsonpath="{.data.admin-password}" | base64 --decode; echo
    
  5. Deploy http service

     kubectl apply -f http-deployment.yaml
     kubectl apply -f http-service.yaml
     kubectl apply -f http-ingress.yaml
    
  6. Deploy grpc service

     kubectl apply -f server-deployment.yaml
     kubectl apply -f server-service.yaml
    

Collect metrics

  1. ./bin/client | jq .msg to run the client

  2. Navigate to /grafana and open the Client Metrics dashboard

Directories

Path Synopsis
cmd
grpc/client
Command client
Command client
grpc/server
Command server
Command server
http
Command http
Command http
Package internal is an internal package
Package internal is an internal package
grpc
Package grpc handles the grpc connection
Package grpc handles the grpc connection
proto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL