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

Merge staging to prod - Change server to runtime or instancee #185

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ The MicroProfile Metrics API is included in the MicroProfile dependency specifie

[role="code_command hotspot file=1", subs="quotes"]
----
#Replace the server configuration file.#
#Replace the Liberty `server.xml` configuration file.#
`src/main/liberty/config/server.xml`
----

Expand All @@ -227,7 +227,7 @@ include::finish/src/main/liberty/config/server.xml[]

The [hotspot=mpMetrics file=1]`mpMetrics` feature enables MicroProfile Metrics support in Open Liberty. Note that this feature requires SSL and the configuration has been provided for you.

The [hotspot=quickStartSecurity file=1]`quickStartSecurity` configuration element provides basic security to secure the server. When you visit the `/metrics` endpoint, use the credentials defined in the server configuration to log in and view the data.
The [hotspot=quickStartSecurity file=1]`quickStartSecurity` configuration element provides basic security to secure the Liberty. When you visit the `/metrics` endpoint, use the credentials defined in the Liberty's configuration to log in and view the data.

// =================================================================================================
// Adding the annotations
Expand Down Expand Up @@ -290,19 +290,19 @@ include::finish/src/main/liberty/config/server.xml[]

MicroProfile Metrics API implementers can provide vendor metrics in the same forms as the base and application metrics do. Open Liberty as a vendor supplies server component metrics when the [hotspot=mpMetrics]`mpMetrics` feature is enabled in the [hotspot]`server.xml` configuration file.

You can see the vendor-only metrics in the `metrics?scope=vendor` endpoint. You see metrics from the runtime components, such as Web Application, ThreadPool and Session Management. Note that these metrics are specific to the Liberty application server. Different vendors may provide other metrics. Visit the https://openliberty.io/docs/ref/general/#metrics-list.html[Metrics reference list^] for more information.
You can see the vendor-only metrics in the `metrics?scope=vendor` endpoint. You see metrics from the runtime components, such as Web Application, ThreadPool and Session Management. Note that these metrics are specific to the Liberty instance. Different vendors may provide other metrics. Visit the https://openliberty.io/docs/ref/general/#metrics-list.html[Metrics reference list^] for more information.

// =================================================================================================
// Building and running the application
// =================================================================================================

== Building and running the application

The Open Liberty server was started in dev mode at the beginning of the guide and all the changes were automatically picked up.
The Open Liberty instance was started in dev mode at the beginning of the guide and all the changes were automatically picked up.

// static guide instructions:
ifndef::cloud-hosted[]
Point your browser to the https://localhost:9443/metrics[https://localhost:9443/metrics^] URL to review all the metrics that are enabled through MicroProfile Metrics. Log in with `admin` as your username and `adminpwd` as your password. You see only the system and vendor metrics because the server just started, and the `inventory` service has not been accessed.
Point your browser to the https://localhost:9443/metrics[https://localhost:9443/metrics^] URL to review all the metrics that are enabled through MicroProfile Metrics. Log in with `admin` as your username and `adminpwd` as your password. You see only the system and vendor metrics because the Liberty instance just started, and the `inventory` service has not been accessed.

Next, point your browser to the http://localhost:9080/inventory/systems[http://localhost:9080/inventory/systems^] URL. Reload the https://localhost:9443/metrics[https://localhost:9443/metrics^] URL, or access only the application metrics at the https://localhost:9443/metrics?scope=application[https://localhost:9443/metrics?scope=application^] URL.

Expand All @@ -311,7 +311,7 @@ endif::[]

// cloud-hosted guide instructions:
ifdef::cloud-hosted[]
Run the following curl command to review all the metrics that are enabled through MicroProfile Metrics. You see only the system and vendor metrics because the server just started, and the ***inventory*** service has not been accessed.
Run the following curl command to review all the metrics that are enabled through MicroProfile Metrics. You see only the system and vendor metrics because the Liberty instance just started, and the ***inventory*** service has not been accessed.
```bash
curl -k --user admin:adminpwd https://localhost:9443/metrics
```
Expand Down Expand Up @@ -377,7 +377,7 @@ include::finish/src/main/java/io/openliberty/guides/inventory/InventoryManager.j

* The [hotspot=testPropertiesAddTimeMetric file=0]`testPropertiesAddTimeMetric()` test case validates the [hotspot=timedForAdd file=1]`@Timed` metric. The test case sends a request to the `\http://localhost:9080/inventory/systems/localhost` URL to access the `inventory` service, which adds the `localhost` host to the inventory. Next, the test case makes a connection to the `\https://localhost:9443/metrics?scope=application` URL to retrieve application metrics as plain text. Then, it looks for the [hotspot=timedForAdd file=1]`@Timed` metric and asserts true if the metric exists.

The [hotspot=oneTimeSetup file=0]`oneTimeSetup()` method retrieves the port number for the server and builds a base URL string to set up the tests. Apply the [hotspot=BeforeAll file=0]`@BeforeAll` annotation to this method to run it before any of the test cases.
The [hotspot=oneTimeSetup file=0]`oneTimeSetup()` method retrieves the port number for the Liberty and builds a base URL string to set up the tests. Apply the [hotspot=BeforeAll file=0]`@BeforeAll` annotation to this method to run it before any of the test cases.

The [hotspot=setup file=0]`setup()` method creates a JAX-RS client that makes HTTP requests to the `inventory` service. The [hotspot=teardown file=0]`teardown()` method destroys this client instance. Apply the [hotspot=BeforeEach file=0]`@BeforeEach` annotation so that a method runs before a test case and apply the [hotspot=AfterEach file=0]`@AfterEach` annotation so that a method runs after a test case. Apply these annotations to methods that are generally used to perform any setup and teardown tasks before and after a test.

Expand Down
2 changes: 1 addition & 1 deletion finish/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.7.1</version>
<version>3.8.2</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion start/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.7.1</version>
<version>3.8.2</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
Expand Down
Loading