From a2c011ad04809392223562331ac8e34b9f6029e9 Mon Sep 17 00:00:00 2001 From: gulshank0 Date: Wed, 4 Feb 2026 23:20:29 +0530 Subject: [PATCH 1/3] Fix errors in tutorial/instrumenting HTTP server Signed-off-by: gulshank0 --- docs/tutorials/instrumenting_http_server_in_go.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/instrumenting_http_server_in_go.md b/docs/tutorials/instrumenting_http_server_in_go.md index a5cf455fe..f3d4a378a 100644 --- a/docs/tutorials/instrumenting_http_server_in_go.md +++ b/docs/tutorials/instrumenting_http_server_in_go.md @@ -39,7 +39,7 @@ Now open `http://localhost:8090/ping` in your browser and you must see `pong`. [![Server](/assets/docs/tutorial/server.png)](/assets/docs/tutorial/server.png) -Now lets add a metric to the server which will instrument the number of requests made to the ping endpoint, the counter metric type is suitable for this as we know the request count doesn’t go down and only increases. +Now let's add a metric to the server which will instrument the number of requests made to the ping endpoint. The counter metric type is suitable for this as we know the request count doesn’t go down and only increases. Create a Prometheus counter @@ -88,8 +88,7 @@ The `prometheus.MustRegister` function registers the pingCounter to the default To expose the metrics the Go Prometheus client library provides the promhttp package. `promhttp.Handler()` provides a `http.Handler` which exposes the metrics registered in the Default Register. -The sample code depends on the -The sample code depends on the +The sample code is now ```go package main @@ -142,13 +141,13 @@ go mod tidy go run server.go ``` -Now hit the localhost:8090/ping endpoint a couple of times and sending a request to localhost:8090 will provide the metrics. +Now hit the localhost:8090/ping endpoint a couple of times and sending a request to localhost:8090/metrics will provide the metrics. [![Ping Metric](/assets/docs/tutorial/ping_metric.png)](/assets/docs/tutorial/ping_metric.png) Here the `ping_request_count` shows that `/ping` endpoint was called 3 times. -The Default Register comes with a collector for go runtime metrics and that is why we see other metrics like `go_threads`, `go_goroutines` etc. +The Default Registry comes with a collector for go runtime metrics and that is why we see other metrics like `go_threads`, `go_goroutines` etc. We have built our first metric exporter. Let’s update our Prometheus config to scrape the metrics from our server. From 8bad120f5148254927ad71f26cbd8711ab0f119a Mon Sep 17 00:00:00 2001 From: gulshank0 Date: Wed, 18 Feb 2026 00:05:10 +0530 Subject: [PATCH 2/3] fixes: more spells errors Signed-off-by: gulshank0 --- docs/tutorials/instrumenting_http_server_in_go.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/instrumenting_http_server_in_go.md b/docs/tutorials/instrumenting_http_server_in_go.md index f3d4a378a..372aecb5a 100644 --- a/docs/tutorials/instrumenting_http_server_in_go.md +++ b/docs/tutorials/instrumenting_http_server_in_go.md @@ -53,14 +53,14 @@ func newMetrics(reg prometheus.Registerer) *metrics { pingCounter: promauto.With(reg).NewCounter( prometheus.CounterOpts{ Name: "ping_request_count", - Help: "No of request handled by Ping handler", + Help: "No of requests handled by Ping handler", }), } return m } ``` -Next lets update the ping Handler to increase the count of the counter using `metrics.pingCounter.Inc()`. +Next let's update the ping Handler to increase the count of the counter using `metrics.pingCounter.Inc()`. ```go func ping(m *metrics) func(w http.ResponseWriter, req *http.Request) { @@ -86,9 +86,9 @@ func main() { The `prometheus.MustRegister` function registers the pingCounter to the default Register. To expose the metrics the Go Prometheus client library provides the promhttp package. -`promhttp.Handler()` provides a `http.Handler` which exposes the metrics registered in the Default Register. +`promhttp.Handler()` provides an `http.Handler` which exposes the metrics registered in the Default Register. -The sample code is now +The sample code is now: ```go package main @@ -145,7 +145,7 @@ Now hit the localhost:8090/ping endpoint a couple of times and sending a request [![Ping Metric](/assets/docs/tutorial/ping_metric.png)](/assets/docs/tutorial/ping_metric.png) -Here the `ping_request_count` shows that `/ping` endpoint was called 3 times. +Here the `ping_request_count` shows that the `/ping` endpoint was called 3 times. The Default Registry comes with a collector for go runtime metrics and that is why we see other metrics like `go_threads`, `go_goroutines` etc. From 47ae9ed3e9396672968c307fc12c50ed0661f639 Mon Sep 17 00:00:00 2001 From: gulshank0 Date: Wed, 18 Feb 2026 00:22:10 +0530 Subject: [PATCH 3/3] fixes: more spells errors with cross verifications Signed-off-by: gulshank0 --- .../instrumenting_http_server_in_go.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/tutorials/instrumenting_http_server_in_go.md b/docs/tutorials/instrumenting_http_server_in_go.md index 372aecb5a..b26c33459 100644 --- a/docs/tutorials/instrumenting_http_server_in_go.md +++ b/docs/tutorials/instrumenting_http_server_in_go.md @@ -3,7 +3,7 @@ title: Instrumenting HTTP server written in Go sort_rank: 3 --- -In this tutorial we will create a simple Go HTTP server and instrumentation it by adding a counter +In this tutorial, we will create a simple Go HTTP server and instrument it by adding a counter metric to keep count of the total number of requests processed by the server. Here we have a simple HTTP server with `/ping` endpoint which returns `pong` as response. @@ -60,7 +60,7 @@ func newMetrics(reg prometheus.Registerer) *metrics { } ``` -Next let's update the ping Handler to increase the count of the counter using `metrics.pingCounter.Inc()`. +Next, let's update the ping Handler to increase the count of the counter using `metrics.pingCounter.Inc()`. ```go func ping(m *metrics) func(w http.ResponseWriter, req *http.Request) { @@ -71,7 +71,7 @@ func ping(m *metrics) func(w http.ResponseWriter, req *http.Request) { } ``` -Then register the metrics (in this case only one counter) to a Prometheus Register and expose the metrics. +Then register the metrics (in this case, only one counter) with a Prometheus registry and expose the metrics. ```go func main() { @@ -84,9 +84,9 @@ func main() { } ``` -The `prometheus.MustRegister` function registers the pingCounter to the default Register. -To expose the metrics the Go Prometheus client library provides the promhttp package. -`promhttp.Handler()` provides an `http.Handler` which exposes the metrics registered in the Default Register. +The `prometheus.MustRegister` function registers the pingCounter with the default registry. +To expose the metrics, the Go Prometheus client library provides the promhttp package. +`promhttp.Handler()` provides an `http.Handler` which exposes the metrics registered in the default registry. The sample code is now: @@ -141,13 +141,13 @@ go mod tidy go run server.go ``` -Now hit the localhost:8090/ping endpoint a couple of times and sending a request to localhost:8090/metrics will provide the metrics. +Now hit the localhost:8090/ping endpoint a couple of times and then send a request to localhost:8090/metrics to see the metrics. [![Ping Metric](/assets/docs/tutorial/ping_metric.png)](/assets/docs/tutorial/ping_metric.png) -Here the `ping_request_count` shows that the `/ping` endpoint was called 3 times. +Here, the `ping_request_count` shows that the `/ping` endpoint was called 3 times. -The Default Registry comes with a collector for go runtime metrics and that is why we see other metrics like `go_threads`, `go_goroutines` etc. +The default registry comes with a collector for Go runtime metrics, and that is why we see other metrics like `go_threads`, `go_goroutines`, etc. We have built our first metric exporter. Let’s update our Prometheus config to scrape the metrics from our server.