Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial prometheus metrics #37

Merged
merged 16 commits into from Dec 22, 2023
Merged

initial prometheus metrics #37

merged 16 commits into from Dec 22, 2023

Conversation

ultd
Copy link
Contributor

@ultd ultd commented Sep 18, 2023

Implements #60

Forked zig-prometheus, using the following types with misc improvements:

  • Registry (support new metrics)
  • Gauge (renamed to GaugeFn)
  • Counter (conform to official api)
  • Metric (support new metrics)

Implemented from scratch:

  • Gauge
  • Histogram
  • http adapter

ultd and others added 5 commits September 18, 2023 14:10
implement histogram and gauge. make existing counter conform to standard. rename old "gauge" to "gauge_fn" since it is not a true prometheus gauge but an equivalent of the golang GaugeFunc
@dnut dnut added enhancement New feature or request and removed enhancement New feature or request labels Dec 18, 2023
@dnut dnut self-assigned this Dec 18, 2023
@dnut dnut linked an issue Dec 18, 2023 that may be closed by this pull request
@dnut dnut added the enhancement New feature or request label Dec 18, 2023
metrics structs can use normal initialization so they aren's so esoteric. the registry is the context where we'd like to allocate everything in an arena and manage the memory centrally. so, for clarity, that scope can also be in charge of allocating the structs. that way, the structs can behave as normal structs on their own, without requiring special memory management
@dnut dnut changed the title initial prometheus metrics and thread pool fork initial prometheus metrics Dec 18, 2023
- initialize prometheus registry and http adapter with sig main()
- add global registry singleton.
- implement OnceCell to safely support global singletons that need to be initialized at runtime
- make Counter a normal looking struct (not a file struct)
- switch unnecessary .Release operation in histogram to .Monotonic
- switch from std.http to httpz
@ultd ultd merged commit e8e50dc into main Dec 22, 2023
2 checks passed
@ultd ultd deleted the ultd/metrics-and-thread-pool branch December 22, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Prometheus Metric Collection
2 participants