You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you specify the `auto` section, by default Helidon does not measure built-in endpoints such as metrics, health, and openapi. You can add items under `auto.paths` to control more exactly which endpoints to measure.
96
+
The `paths` section contains zero or more entries, each entry having the following settings:
97
97
98
-
If you include the `paths` section, a given request matches an entry if its path matches the path pattern and its HTTP method is in the `methods` list. If there is no `methods` list for an entry, all HTTP methods match the entry.
98
+
--
99
+
.`path` entry settings
100
+
[cols="4,2,4,20"]
101
+
|====
102
+
|Key | Required | Default Value | Usage
103
+
104
+
| `path`
105
+
| yes
106
+
| {nbsp}
107
+
a| Path-matching expression:
108
+
109
+
* an exact match (`/greet`)
110
+
* a prefix match (`/greet/*`)
111
+
* a pattern match (`/greet/{name}`)
112
+
113
+
| `methods` | {nbsp} | all HTTP method types | Which HTTP methods match this entry
99
114
100
-
If a request matches an entry, the request is measured if the entry's `enabled` setting is true (the default).
115
+
| `enabled` | {nbsp} | `true` | Whether this entry votes to match requests which match the entry
116
+
|====
117
+
--
101
118
102
-
If a request matches multiple entries, the last one matched wins.
119
+
Helidon decides whether to measure incoming requests as follows:
103
120
104
-
If a request matches no entries, it is measured.
121
+
* If you omit the `auto` configuration, Helidon measures all endpoints.
122
+
* If you specify the `auto` configuration, by default Helidon does not measure built-in endpoints such as metrics, health, and openapi. You can add items under `auto.paths` to control more exactly which endpoints to measure.
123
+
* If you include the `paths` section, Helidon checks a request against the path entries in order. A given request matches an entry if its path matches the path pattern and its HTTP method is in the `methods` list. If there is no `methods` list for an entry, all HTTP methods match the entry.
124
+
* If a request matches an entry, the entry "votes" whether the request should be measured based on the entry's `enabled` setting.
125
+
* If a request matches multiple entries, the last one voting wins.
126
+
* If a request matches no entries, it is measured.
105
127
106
-
You can also control which sockets are included in the measurements.
128
+
The `auto.sockets` setting controls which sockets are included in the measurements; if not set, Helidon measures requests on all sockets.
107
129
130
+
ifdef::se-flavor[]
108
131
[source,yaml]
132
+
endif::se-flavor[]
133
+
ifdef::mp-flavor[]
134
+
[source,properties]
135
+
endif::mp-flavor[]
109
136
.Including and Excluding Endpoints from Automatic Measurement
<1> Measure `/greet` for only `GET` and `HEAD` requests.
125
165
<2> Do not measure the personalized greeting requests.
126
166
<3> Measure only endpoints on the default socket and the socket named `private`. Endpoints on other sockets (such as if you had an `admin` socket) are not measured.
Copy file name to clipboardExpand all lines: webserver/observe/metrics/src/main/java/io/helidon/webserver/observe/metrics/AutoHttpMetricsConfigBlueprint.java
Copy file name to clipboardExpand all lines: webserver/observe/metrics/src/main/java/io/helidon/webserver/observe/metrics/AutoHttpMetricsPathConfigBlueprint.java
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,11 @@
28
28
/**
29
29
* Settings for path-based automatic metrics configuration.
30
30
* <p>
31
-
* The {@link #enabled} setting (true or false) applies to any request which matches the {@linkplain #path() path matcher} and the
32
-
* {@linkplain #methods() HTTP methods} specified.
31
+
* An HTTP request matches a path entry if the request path matches the entry's path pattern and the request's HTTP method
32
+
* matches one of the entry's methods. If there no {@code methods} list for the entry, then all HTTP methods match the entry.
33
+
* <p>
34
+
* If a request matches an entry, then the entry's {@code enabled} value (which defaults to {@code}) determines the entry's vote
35
+
* whether the request should be measured. If a request matches multiple entries, the vote of the last matched entry wins.
0 commit comments