Skip to content

Commit

Permalink
fix: broken links and minor typos (#913)
Browse files Browse the repository at this point in the history
Signed-off-by: Capt. Cutlass <5120290+ParanoidUser@users.noreply.github.com>
  • Loading branch information
ParanoidUser authored Jan 19, 2024
1 parent 1fd8c7d commit b229888
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/content/config/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Metrics Properties
| io.prometheus.metrics.histogramNativeMaxZeroThreshold | [Histogram.Builder.nativeMaxZeroThreshold()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeMaxZeroThreshold(double)) | |
| io.prometheus.metrics.histogramNativeMaxNumberOfBuckets | [Histogram.Builder.nativeMaxNumberOfBuckets()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeMaxNumberOfBuckets(int)) | |
| io.prometheus.metrics.histogramNativeResetDurationSeconds | [Histogram.Builder.nativeResetDuration()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeResetDuration(long,java.util.concurrent.TimeUnit)) | |
| io.prometheus.metrics.summaryQuantiles | [Summary.Builder.quantile(double)](https://prometheus.github.io/client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#quantile(double)) | (4) |
| io.prometheus.metrics.summaryQuantileErrors | [Summary.Builder.quantile(double, double)](ihttps://prometheus.github.io/client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#quantile(double,double)) | (5) |
| io.prometheus.metrics.summaryQuantiles | [Summary.Builder.quantile(double)](/client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#quantile(double)) | (4) |
| io.prometheus.metrics.summaryQuantileErrors | [Summary.Builder.quantile(double, double)](/client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#quantile(double,double)) | (5) |
| io.prometheus.metrics.summaryMaxAgeSeconds | [Summary.Builder.maxAgeSeconds()](/client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#maxAgeSeconds(long)) | |
| io.prometheus.metrics.summaryNumberOfAgeBuckets | [Summary.Builder.numberOfAgeBuckets()](/client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#numberOfAgeBuckets(int)) | |

Expand Down
6 changes: 3 additions & 3 deletions docs/content/exporters/httpserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ HTTPServer server = HTTPServer.builder()

By default, `HTTPServer` binds to any IP address, you can change this with [hostname()](/client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#hostname(java.lang.String)) or [inetAddress()](/client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#inetAddress(java.net.InetAddress)).

`HTTPServer` is configured with three endoints:
`HTTPServer` is configured with three endpoints:

* `/metrics` for Prometheus scraping.
* `/-/healthy` for simple health checks.
Expand All @@ -24,8 +24,8 @@ The default handler can be changed with [defaultHandler()](/client_java/api/io/p
Authentication and HTTPS
------------------------

* [authenticator()](https://prometheus.github.io/client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#authenticator(com.sun.net.httpserver.Authenticator)) is for configuring authentication.
* [httpsConfigurator()](https://prometheus.github.io/client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#httpsConfigurator(com.sun.net.httpserver.HttpsConfigurator)) is for configuring HTTPS.
* [authenticator()](/client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#authenticator(com.sun.net.httpserver.Authenticator)) is for configuring authentication.
* [httpsConfigurator()](/client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#httpsConfigurator(com.sun.net.httpserver.HttpsConfigurator)) is for configuring HTTPS.

You can find an example of authentication and SSL in the [jmx_exporter](https://github.com/prometheus/jmx_exporter).

Expand Down
4 changes: 2 additions & 2 deletions docs/content/exporters/spring.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Use the Prometheus Metrics Library in Spring

However, you may have your reasons why you want to use the Prometheus metrics library in Spring anyway. Maybe you want full support for all Prometheus metric types, or you want to use the new Prometheus native histograms.

The easiest way to use the Prometheus metrics library in Spring is to configure the [PrometheusMetricsServlet](http://localhost:1313/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) to expose metrics.
The easiest way to use the Prometheus metrics library in Spring is to configure the [PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) to expose metrics.

Dependencies:

Expand Down Expand Up @@ -68,7 +68,7 @@ public class DemoApplication {
}
```

The important part are the last three lines: They configure the [PrometheusMetricsServlet](http://localhost:1313/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) to expose metrics on `/metrics`:
The important part are the last three lines: They configure the [PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) to expose metrics on `/metrics`:

```java
@Bean
Expand Down
10 changes: 5 additions & 5 deletions docs/content/getting-started/metric-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Unlike with counters and gauges, each histogram data point has a complex data st
Prometheus supports two flavors of histograms:

* Classic histograms: Bucket boundaries are explicitly defined when the histogram is created.
* Native histograms (exponential histograms): Infinitly many virtual buckets.
* Native histograms (exponential histograms): Infinitely many virtual buckets.

By default, histograms maintain both flavors. Which one is used depends on the scrape request from the Prometheus server.
* By default, the Prometheus server will scrape metrics in OpenMetrics format and get the classic histogram flavor.
Expand Down Expand Up @@ -91,7 +91,7 @@ The histogram builder provides a lot of configuration for fine-tuning the histog
* `classicBuckets(...)`: Set the classic bucket boundaries. Default buckets are `.005`, `.01`, `.025`, `.05`, `.1`, `.25`, `.5`, `1`, `2.5`, `5`, `and 10`. The default bucket boundaries are designed for measuring request durations in seconds.
* `nativeMaxNumberOfBuckets()`: Upper limit for the number of native histogram buckets. Default is 160. When the maximum is reached, the native histogram automatically reduces resolution to stay below the limit.

See Javadoc for [Histogram.Builder](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html) for a complete list of options. Some options can be configured at runtime, see [config](/config/config).
See Javadoc for [Histogram.Builder](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html) for a complete list of options. Some options can be configured at runtime, see [config](../../config/config).

Histograms and summaries are both used for observing distributions. Therefore, the both implement the `DistributionDataPoint` interface. Using the `DistributionDataPoint` interface directly gives you the option to switch between histograms and summaries later with minimal code changes.

Expand Down Expand Up @@ -148,19 +148,19 @@ Summary requestLatency = Summary.builder()
requestLatency.labelValues("ok").observe(2.7);
```

The example above creates a summary with the 50th percentile (median), the 95th percentila, and the 99th percentile. Quantiles are optional, you can create a summary without quantiles if all you need is the count and the sum.
The example above creates a summary with the 50th percentile (median), the 95th percentile, and the 99th percentile. Quantiles are optional, you can create a summary without quantiles if all you need is the count and the sum.

{{< hint type=note >}}
The terms "percentile" and "quantile" mean the same thing. We use percentile when we express it as a number in [0, 100], and we use quantile when we express it as a number in [0.0, 1.0].
{{< /hint >}}

The second parameter to `quantile()` is the maximum acceptable error. The call `.quantile(0.5, 0.01)` means that the actual quantile is somewhere in [0.49, 0.51]. Higher presicion means higher memory usage.
The second parameter to `quantile()` is the maximum acceptable error. The call `.quantile(0.5, 0.01)` means that the actual quantile is somewhere in [0.49, 0.51]. Higher precision means higher memory usage.

The 0.0 quantile (min value) and the 1.0 quantile (max value) are special cases because you can get the precise values (error 0.0) with almost no memory overhead.

Quantile values are calculated based on a 5 minutes moving time window. The default time window can be changed with `maxAgeSeconds()` and `numberOfAgeBuckets()`.

Some options can be configured at runtime, see [config](/config/config).
Some options can be configured at runtime, see [config](../../config/config).

In general you should prefer histograms over summaries. The Prometheus query language has a function [histogram_quantile()](https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) for calculating quantiles from histograms. The advantage of query-time quantile calculation is that you can aggregate histograms before calculating the quantile. With summaries you must use the quantile with all its labels as it is.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/getting-started/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You could increment the counter above like this:
requestCount.labelValue("/", "200").inc();
```

However, the line above does not only increment the counter, it also lookus up the label values to find the right data point.
However, the line above does not only increment the counter, it also looks up the label values to find the right data point.

In high performance applications you can optimize this by looking up the data point only once:

Expand All @@ -49,7 +49,7 @@ While this default provides the flexibility to scrape different representations

In performance critical applications we recommend to use either the classic representation or the native representation, but not both.

You can either configure this in code for each histogram by calling [classicOnly()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#classicOnly()) or [nativeOnly()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()), or you use the corresponding [config options](http://localhost:1313/config/config/).
You can either configure this in code for each histogram by calling [classicOnly()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#classicOnly()) or [nativeOnly()](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()), or you use the corresponding [config options](../../config/config/).

One way to do this is with system properties in the command line when you start your application

Expand Down
2 changes: 1 addition & 1 deletion docs/content/getting-started/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Counter eventsTotal = Counter.builder()
Registering a Metric with Multiple Registries
---------------------------------------------

As an alternative to calling `register()` direclty, you can `build()` metrics without registering them,
As an alternative to calling `register()` directly, you can `build()` metrics without registering them,
and register them later:

```java
Expand Down
2 changes: 1 addition & 1 deletion docs/content/internals/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The model is an internal library, implementing read-only immutable snapshots. Th

There is no need for users to use `prometheus-metrics-model` directly. Users should use the API provided by `prometheus-metrics-core`, which includes the core metrics as well as callback metrics.

However, maintianers of 3rd party metrics libraries might want to use `prometheus-metrics-model` if they want to add Prometheus exposition formats to their metrics library.
However, maintainers of 3rd party metrics libraries might want to use `prometheus-metrics-model` if they want to add Prometheus exposition formats to their metrics library.

exporters and exposition formats
--------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/content/migration/simpleclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +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.
Reasons why we changed the API: Changing the package names was a necessity because the previous package names were incompatible with the Java module system. However, renaming packages requires changing 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 b229888

Please sign in to comment.