A simple network monitoring tool that checks website response times using gRPC.
- Server: Makes HTTP requests to websites and measures response times
- Client: Asks the server to check specific websites and reports back the results
go mod tidy
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latestprotoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
prober/prober.protogo run prober-server/main.gogo run prober_client/main.gogrpc-prober/
├── prober/
│ ├── prober.proto # API definition
│ ├── prober.pb.go # Generated Go code
│ └── prober_grpc.pb.go # Generated Go code
├── prober_server/
│ └── main.go # Server implementation
├── prober_client/
│ └── main.go # Client implementation
└── go.mod # Go dependencies
└── README.md
curl http://localhost:8080/metricsglobal:
scrape_interval: 15s
scrape_configs:
- job_name: 'grpc-prober'
static_configs:
- targets: ['localhost:8080']./prometheus --config.file=prometheus.ymlOpen http://localhost:9090 and query:
- probe_requests_total
- probe_latency_milliseconds