Skip to content

kayceenuel/gRPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC Network Prober

A simple network monitoring tool that checks website response times using gRPC.

What This Does

  • Server: Makes HTTP requests to websites and measures response times
  • Client: Asks the server to check specific websites and reports back the results

Getting Started

Install Dependencies

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@latest

Generate Code from Proto Files

protoc --go_out=. --go_opt=paths=source_relative \
    --go-grpc_out=. --go-grpc_opt=paths=source_relative \
    prober/prober.proto

How to Use

Start the Server

go run prober-server/main.go

Run the Client

go run prober_client/main.go

Project Structure

grpc-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

Monitoring

View Metrics

curl http://localhost:8080/metrics

Set Up Prometheus

Create prometheus.yml:

global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'grpc-prober'
    static_configs:
      - targets: ['localhost:8080']

Start Prometheus:

./prometheus --config.file=prometheus.yml

Open http://localhost:9090 and query:

  • probe_requests_total
  • probe_latency_milliseconds

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages