Skip to content

Commit

Permalink
Add a paragraph to the simpleclient migration docs
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Stäber <fabian@fstab.de>
  • Loading branch information
fstab committed Sep 27, 2023
1 parent 7ff57d1 commit 312ce6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/content/migration/simpleclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,6 @@ Counter counter = Counter.builder()
counter.labelValues("/hello-world").inc();
```

Reasons why we changed the API: Changing the package names was a neccessity because the previous package names were incompatible with the Java module system. However, renaming packages requires chaning code anyway, so we decided to clean up some things. For example, the name `builder()` for a builder method is very common in the Java ecosystem, it's used in Spring, Lombok, and so on. So naming the method `builder()` makes the Prometheus library more aligned with the broader Java ecosystem.

If you are using the low level `Collector` API directly, you should have a look at the new callback metric types, see [/getting-started/callbacks/](../../getting-started/callbacks/). Chances are good that the new callback metrics have an easier way to achieve what you need than the old 0.16.0 code.

0 comments on commit 312ce6d

Please sign in to comment.