Skip to content

Fix errors in tutorial/instrumenting HTTP server #2815

Open

Description

@jan--f

In #2348 an attempt was made to fix some valid errors. We should still fix those.

Activity

  1. added
    kind/bugDocumentation errors, broken links, incorrect information
    on Jan 20, 2026
  2. added a commit that references this issue on Sep 2, 2026
    d6072aa
  3. santhiprakash commented on Oct 1, 2026

    @santhiprakash
    Contributor

    I compared the tutorial prose in docs/tutorials/instrumenting_http_server_in_go.md against the sample code on current main (605cf81). Three statements still contradict the code:

    1. L87: "The prometheus.MustRegister function registers the pingCounter with the default registry." — the sample code doesn't call MustRegister anywhere; main() creates a custom registry (reg := prometheus.NewRegistry(), L78/L128) and the counter is registered through promauto.With(reg) (L53/L111).

    2. L89: "promhttp.Handler() provides an http.Handler which exposes the metrics registered in the default registry." — the code uses promhttp.HandlerFor(reg, promhttp.HandlerOpts{}) (L82/L132), which serves the custom registry, not the default one.

    3. L150: "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." — a bare prometheus.NewRegistry() starts empty and no Go collector is registered in the sample, so running the tutorial as written only exposes ping_request_count. The go_*/promhttp_* series in ping_metric.png look like they date from before the tutorial switched to a custom registry (292bc32).

    Is fixing these three sentences the remaining scope of this issue, or was the grammar-only pass #2824 considered sufficient? Happy to put together a PR if it's still wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugDocumentation errors, broken links, incorrect information

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions