Skip to content

Commit

Permalink
[WFLY-17678] Add Micrometer quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
emmartins authored and jasondlee committed Jan 18, 2024
1 parent 3025c0d commit a5d9418
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions micrometer/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ To complete this guide, you will need:
* less than 15 minutes
* JDK 11+ installed with `JAVA_HOME` configured appropriately
* Apache Maven 3.5.3+
* Docker Compose, or alternatively Podman Compose

include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1]

== Steps

// Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1]

[[configure_the_server]]
=== Configure the Server

Expand Down Expand Up @@ -73,21 +77,25 @@ $ __{jbossHomeName}__/bin/jboss-cli.sh --connect --commands=reload
[[start_opentelemetry_collector]]
=== Starting the OpenTelemetry Collector

By default, {productName} will publish metrics every 10 seconds, so you will soon start seeing errors about a refused connection. This is because we told {productName} to publish to a server that is not there, so we need to fix that. To make that as simple as possible, you can use Docker Compose to start an instance of the OpenTelemetry Collector:
By default, {productName} will publish metrics every 10 seconds, so you will soon start seeing errors about a refused connection.

This is because we told {productName} to publish to a server that is not there, so we need to fix that. To make that as simple as possible, you can use Docker Compose to start an instance of the OpenTelemetry Collector.

The Docker Compose configuration file is `docker-compose.yaml`:

[source,yaml]
----
include::docker-compose.yaml[]
----

We also need to provide a configuration file for the collector:
The Collector server configuration file is `otel-collector-config.yaml`:

[source,yaml]
----
include::otel-collector-config.yaml[]
----

We can now bring up the collector instance:
We can now bring up the collector server instance:

[source,bash]
----
Expand All @@ -96,6 +104,15 @@ $ docker-compose up

The service should be available almost immediately, which you can verify by looking at the Prometheus endpoint we've configured by pointing your browser at http://localhost:1234/metrics[]. You should see quite a few metrics listed, none of which are what our application has registered. What you're seeing are the system and JVM metrics automatically registered and published by {productName} to give systems/applications administrators a comprehensive view of system health and performance.

[NOTE]
====
You may use Podman as alternative to Docker if you prefer, in such case the command should be `podman-compose up`.
====

[NOTE]
====
If your environment does not support Docker or Podman, please refer to https://opentelemetry.io/docs/collector/installation[Otel Collector documentation] for alternatives on how to install and run the OpenTelemetry Collector.
====

=== Registering metrics

Expand Down
2 changes: 1 addition & 1 deletion micrometer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: otel/opentelemetry-collector
command: [--config=/etc/otel-collector-config.yaml]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:Z
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the collector
Expand Down

0 comments on commit a5d9418

Please sign in to comment.