Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Use a build tag to toggle Prometheus/metrics

Open
#5,179 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, prometheus

Research direction

Start by reading the linked Go build-tags article and identify the Prometheus and API endpoint imports in the Bee codebase. Use the proposed metrics tag to assess whether those imports are excluded, then run gsa and confirm that the resulting bundle no longer includes Prometheus metrics.

Written by the indexing model from the issue text.

Description

Summary

Not always metrics are needed to be enabled. In certain cases, you'd want to have them disabled to decrease bundle size and gain slight performance gains. Would be very nice if all metrics (including both prometheus and API endpoints) could be disabled using a build tag

Motivation

There is no point for Prometheus metrics in WASM or low-end environments such as EFI modules. Additionally, Prometheus blocks compilation for tinygo.

Implementation

Use build tags. Here's an article explaining how they work: https://leapcell.io/blog/understanding-go-build-tags

Example name: -tag metrics

Drawbacks

Would require a bunch of manual rewriting. You can also check whether Prometheus is included or not by running gsa and observing imports: https://github.com/Zxilly/go-size-analyzer/issues

Dominant language
Go
Stars
1.5k
Forks
390
Avg merge
2d 11h
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ethersphere/bee

All issues in ethersphere/bee

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.