Skip to content

Commit

Permalink
Initial Observability extension - devservices, devresources, LGTM
Browse files Browse the repository at this point in the history
Grafana OTel LGTM additional Documentation
Fix enforcer configuration and make names consistent
Update descriptors with latest dependency state
Abstract Testcontainers usage, own Container SPI.
  • Loading branch information
alesj committed Apr 9, 2024
1 parent e6e49ec commit cbe329a
Show file tree
Hide file tree
Showing 61 changed files with 2,622 additions and 1 deletion.
50 changes: 50 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@
<mutiny-zero.version>1.1.0</mutiny-zero.version>
<pulsar-client.version>3.0.0</pulsar-client.version>
<async-http-client.version>2.12.3</async-http-client.version>
<!-- keep in-sync, if possible, with Micrometer registry Prometheus -->
<prometheus.version>0.16.0</prometheus.version>
<!-- Dev UI -->
<importmap.version>1.0.10</importmap.version>
</properties>
Expand Down Expand Up @@ -491,6 +493,18 @@
<scope>import</scope>
</dependency>

<!-- Prometheus -->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_common</artifactId>
<version>${prometheus.version}</version>
</dependency>

<!-- Quarkus core -->

<dependency>
Expand Down Expand Up @@ -2992,6 +3006,42 @@
<artifactId>quarkus-virtual-threads-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devservices-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devservices</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devservices-lgtm</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-testcontainers</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devresource-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devresource-testcontainers</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devresource-lgtm</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Quarkus test dependencies -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public enum Feature {
NARAYANA_LRA,
NARAYANA_STM,
NEO4J,
OBSERVABILITY,
OIDC,
OIDC_CLIENT,
RESTEASY_CLIENT_OIDC_FILTER,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package io.quarkus.runtime.util;

import java.util.Enumeration;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.stream.Stream;

/**
* Transform to "old school" Enumeration from Iterator/Spliterator/Stream
*/
public class EnumerationUtil {
public static <T> Enumeration<T> from(Iterator<T> iterator) {
Objects.requireNonNull(iterator);

return new Enumeration<T>() {
@Override
public boolean hasMoreElements() {
return iterator.hasNext();
}

@Override
public T nextElement() {
return iterator.next();
}
};
}

public static <T> Enumeration<T> from(Spliterator<T> spliterator) {
Objects.requireNonNull(spliterator);

class Adapter implements Enumeration<T>, Consumer<T> {
boolean valueReady;
T nextElement;

public void accept(T t) {
this.valueReady = true;
this.nextElement = t;
}

public boolean hasMoreElements() {
if (!this.valueReady) {
spliterator.tryAdvance(this);
}

return this.valueReady;
}

public T nextElement() {
if (!this.valueReady && !this.hasMoreElements()) {
throw new NoSuchElementException();
} else {
this.valueReady = false;
T t = this.nextElement;
this.nextElement = null;
return t;
}
}
}

return new Adapter();
}

public static <T> Enumeration<T> from(Stream<T> stream) {
return from(stream.spliterator());
}
}
13 changes: 13 additions & 0 deletions devtools/bom-descriptor-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devservices</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devservices-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-deployment</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions docs/src/main/asciidoc/dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ More information can be found in the xref:elasticsearch-dev-services.adoc[Elasti

include::{generated-dir}/config/quarkus-elasticsearch-devservices-elasticsearch-dev-services-build-time-config.adoc[opts=optional, leveloffset=+1]

=== Observability

The Observability Dev Services will be enabled when the `quarkus-observability-devservices` extension is present in your application, and
there is at least one dev resource on the classpath. More information can be found in the
xref:observability-devservices.adoc[Observability Dev Services Guide].

include::{generated-dir}/config/quarkus-observability-config-observability-configuration.adoc[opts=optional, leveloffset=+1]

== Dev Services beyond the Quarkus Platform

Check warning on line 176 in docs/src/main/asciidoc/dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Dev Services beyond the Quarkus Platform'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Dev Services beyond the Quarkus Platform'.", "location": {"path": "docs/src/main/asciidoc/dev-services.adoc", "range": {"start": {"line": 176, "column": 4}}}, "severity": "INFO"}

Many Quarkiverse extensions which are not in the Quarkus Platform also offer Dev Services.

Check warning on line 178 in docs/src/main/asciidoc/dev-services.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using ', which (non restrictive clause preceded by a comma)' or 'that (restrictive clause without a comma)' rather than 'which'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using ', which (non restrictive clause preceded by a comma)' or 'that (restrictive clause without a comma)' rather than 'which'.", "location": {"path": "docs/src/main/asciidoc/dev-services.adoc", "range": {"start": {"line": 178, "column": 28}}}, "severity": "INFO"}
Expand Down
Loading

0 comments on commit cbe329a

Please sign in to comment.