-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Observability Dev UI Card and Log Console
- Loading branch information
Showing
10 changed files
with
330 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...va/io/quarkus/observability/deployment/devui/ObservabilityDevServicesConfigBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.quarkus.observability.deployment.devui; | ||
|
||
import java.util.Map; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
/** | ||
* Build item used to carry running DevService values to Dev UI. | ||
*/ | ||
public final class ObservabilityDevServicesConfigBuildItem extends SimpleBuildItem { | ||
|
||
private final Map<String, String> config; | ||
|
||
public ObservabilityDevServicesConfigBuildItem(Map<String, String> config) { | ||
this.config = config; | ||
} | ||
|
||
public Map<String, String> getConfig() { | ||
return config; | ||
} | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
.../src/main/java/io/quarkus/observability/deployment/devui/ObservabilityDevUIProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package io.quarkus.observability.deployment.devui; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.IsNormal; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.annotations.BuildSteps; | ||
import io.quarkus.deployment.dev.devservices.GlobalDevServicesConfig; | ||
import io.quarkus.devui.spi.page.CardPageBuildItem; | ||
import io.quarkus.devui.spi.page.ExternalPageBuilder; | ||
import io.quarkus.devui.spi.page.FooterPageBuildItem; | ||
import io.quarkus.devui.spi.page.Page; | ||
import io.quarkus.devui.spi.page.WebComponentPageBuilder; | ||
|
||
/** | ||
* Dev UI card for displaying important details such LGTM embedded UI. | ||
*/ | ||
@BuildSteps(onlyIfNot = IsNormal.class, onlyIf = { GlobalDevServicesConfig.Enabled.class }) | ||
public class ObservabilityDevUIProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
void createVersion(BuildProducer<CardPageBuildItem> cardPageBuildItemBuildProducer, | ||
BuildProducer<FooterPageBuildItem> footerProducer, | ||
Optional<ObservabilityDevServicesConfigBuildItem> configProps) { | ||
|
||
// LGTM | ||
if (configProps.isPresent()) { | ||
Map<String, String> runtimeConfig = configProps.get().getConfig(); | ||
String grafanaUrl = runtimeConfig.getOrDefault("grafana.endpoint", ""); | ||
|
||
if (StringUtils.isNotEmpty(grafanaUrl)) { | ||
final CardPageBuildItem card = new CardPageBuildItem(); | ||
|
||
// Grafana | ||
grafanaUrl = StringUtils.prependIfMissing(grafanaUrl, "http://"); | ||
card.addPage(Page.externalPageBuilder("Grafana UI") | ||
.url(grafanaUrl, grafanaUrl) | ||
.doNotEmbed() | ||
.isHtmlContent() | ||
.icon("font-awesome-solid:chart-line")); | ||
|
||
// Open Telemetry | ||
final ExternalPageBuilder otelPage = Page.externalPageBuilder("OpenTelemetry Port") | ||
.icon("font-awesome-solid:binoculars") | ||
.doNotEmbed() | ||
.url("https://opentelemetry.io/") | ||
.staticLabel(StringUtils | ||
.substringAfterLast(runtimeConfig.getOrDefault("otel-collector.url", "0"), ":")); | ||
card.addPage(otelPage); | ||
|
||
card.setCustomCard("qwc-lgtm-card.js"); | ||
cardPageBuildItemBuildProducer.produce(card); | ||
|
||
// LGTM Container Log Console | ||
WebComponentPageBuilder mailLogPageBuilder = Page.webComponentPageBuilder() | ||
.icon("font-awesome-solid:chart-line") | ||
.title("LGTM") | ||
.componentLink("qwc-lgtm-log.js"); | ||
|
||
footerProducer.produce(new FooterPageBuildItem(mailLogPageBuilder)); | ||
} | ||
} | ||
|
||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
extensions/observability-devservices/deployment/src/main/resources/dev-ui/qwc-lgtm-card.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
extensions/observability-devservices/deployment/src/main/resources/dev-ui/qwc-lgtm-log.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { QwcServerLog } from "qwc-server-log"; | ||
|
||
/** | ||
* This component filter the log to only show LGTM related entries. | ||
*/ | ||
export class QwcLgtmLog extends QwcServerLog { | ||
doLogEntry(entry) { | ||
if (entry.loggerName && entry.loggerName.includes("LgtmContainer")) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
|
||
customElements.define("qwc-lgtm-log", QwcLgtmLog); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ions/observability-devservices/runtime/src/main/resources/META-INF/quarkus-extension.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "Observability" | ||
artifact: ${project.groupId}:${project.artifactId}:${project.version} | ||
metadata: | ||
keywords: | ||
- "lgtm" | ||
- "grafana" | ||
- "prometheus" | ||
- "tempo" | ||
- "opentelemetry" | ||
- "tracing" | ||
- "distributed-tracing" | ||
- "monitoring" | ||
categories: | ||
- "observability" | ||
config: | ||
- "quarkus.observability." | ||
status: "experimental" | ||
guide: "https://quarkus.io/guides/observability-devservices" | ||
icon-url: "https://upload.wikimedia.org/wikipedia/commons/3/3b/Grafana_icon.svg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.