Skip to content

Commit

Permalink
Mark public API with the public keyword (#19)
Browse files Browse the repository at this point in the history
This patch marks the public API of Prometheus.jl with the `public`
keyword in Julia versions that support it.

The public symbols are: `CollectorRegistry`, `register`, `unregister`,
`Counter`, `Gauge`, `Histogram`, `Summary`, `GCCollector`,
`ProcessCollector`, `inc`, `dec`, `set`, `set_to_current_time`,
`observe`, `@inprogress`, `@time`, `Family`, `labels`, `remove`,
`clear`, and `expose`.
  • Loading branch information
fredrikekre authored Jul 12, 2024
1 parent f58bcca commit 0a2e4ea
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.4.0] - 2024-07-12
### Changed
- The public API of Prometheus.jl is now marked `public` in Julia versions that support it.
The public names are: `CollectorRegistry`, `register`, `unregister`, `Counter`, `Gauge`,
`Histogram`, `Summary`, `GCCollector`, `ProcessCollector`, `inc`, `dec`, `set`,
`set_to_current_time`, `observe`, `@inprogress`, `@time`, `Family`, `labels`, `remove`,
`clear`, and `expose`. ([#19])

## [v1.3.0] - 2023-11-29
### Added
- `Base.getindex` is overloaded for the `Prometheus.Family` collector to have the same
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Prometheus"
uuid = "f25c1797-fe98-4e0c-b252-1b4fe3b6bde6"
version = "1.3.0"
version = "1.4.0"

[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Expand Down
4 changes: 2 additions & 2 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.10.2"
julia_version = "1.10.4"
manifest_format = "2.0"
project_hash = "53cbdb0f6aa70ecb8ff1b1f6baa22bced23c24e5"

Expand Down Expand Up @@ -244,7 +244,7 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
deps = ["CodecZlib", "HTTP", "SimpleBufferStream"]
path = ".."
uuid = "f25c1797-fe98-4e0c-b252-1b4fe3b6bde6"
version = "1.3.0"
version = "1.4.0"

[[deps.REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
Expand Down
11 changes: 11 additions & 0 deletions src/Prometheus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ using CodecZlib: GzipCompressorStream
using HTTP: HTTP
using SimpleBufferStream: BufferStream

if VERSION >= v"1.11.0-DEV.469"
eval(Meta.parse("""
public CollectorRegistry, register, unregister,
Counter, Gauge, Histogram, Summary, GCCollector, ProcessCollector,
inc, dec, set, set_to_current_time, observe, @inprogress, @time,
Family, labels, remove, clear,
expose
"""
))
end

abstract type Collector end

#########
Expand Down

2 comments on commit 0a2e4ea

@fredrikekre
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/110949

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.0 -m "<description of version>" 0a2e4ea852a3fd4e51c01c0d94982cb33786e892
git push origin v1.4.0

Please sign in to comment.