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

Fix doc bug about configuring metrics or health alternate port #9438

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions docs/src/main/asciidoc/mp/server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -204,32 +204,42 @@ Helidon MP can expose multiple ports, with the following limitations:
- Other ports (in this example we configure one "admin" port) can be assigned endpoints that are exposed by Helidon components,
currently supported by MP Health and MP Metrics

For this example, we will use a `YAML` file:
You can set the configuration in either `application.yaml` or `META-INF/microprofile-config.properties`:

- The port `7011` is the default port and will serve your application
- The port `8011` is named "admin" (this is an arbitrary name)
- MP Metrics are configured to use the "admin" port through the `routing` configuration (reference is by name)
- MP Health is configured the same way to reference the "admin" port
- Observability endpoints, such as metrics and health, use the "admin" port through the `features.observe.sockets` setting.

[source,yaml]
.application.yaml - Server configuration
.Server configuration using `application.yaml`
----
server:
port: 7011
host: "some.host"
host: "localhost"
sockets:
admin:
port: 8011
bind-address: "some.host"
bind-address: "localhost"
features:
observe:
sockets: "admin"


----

metrics:
routing: "admin"
[source,properties]
.Server configuration using `META-INF/microprofile-config.properties`
----
server.port=7011
server.host=localhost
server.sockets.0.name=admin
server.sockets.0.port=8011
server.sockets.0.bind-address=localhost
server.features.observe.sockets=admin

health:
routing: "admin"
----

=== Configuring A WebServer Route [[
=== Configuring A WebServer Route

Helidon MP Server will pick up CDI beans that implement the `io.helidon.webserver.HttpService`
interface and configure them with the underlying WebServer.
Expand Down