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

Initial Observability extension #36470

Closed
wants to merge 1 commit into from
Closed

Initial Observability extension #36470

wants to merge 1 commit into from

Conversation

alesj
Copy link
Contributor

@alesj alesj commented Oct 13, 2023

Fixes #26445

This adds dynamic lookup of possible observability dev resources / services.
It also adds REST clients for PromQL (Prometheus query language) and VictoriaMetrics REST api support; push, etc

The dev resources / services can be run in 3 different ways

  1. re-usable dev services (default)
  2. simple start/stop dev services
  3. single / plain per QuarkusTestResource dev resource

(1) can be configured
(2) depends what's available on the classpath
(3) needs to be explicitly used in QuarkusTestResource

Currently supported dev services

  • Grafana
  • Jaeger
  • OTel
  • VictoriaMetrics DB
  • VictoriaMetrics Agent / scraper

It should be easy to add new / other observability dev services in the future,
e.g. currently missing Prometheus, etc
by adding a new DevResourceLifecycleManager implementation.

Current TODO list

  • test with 2 app running at the same time, propagating tracing to same dev service(s)
  • Grafana-all-in-one Docker image support
  • Prometheus dev service
  • reload and other (combo) tests

@quarkus-bot quarkus-bot bot added area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation labels Oct 13, 2023
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@alesj alesj force-pushed the obs1 branch 3 times, most recently from e8333e9 to f69f141 Compare October 16, 2023 19:22
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.


@ConfigGroup
@DevTarget("io.quarkus.observability.devresource.victoriametrics.VictoriaMetricsResource")
public interface VictoriaMetricsConfig extends ContainerConfig {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that the project started with VictoriaMetrics, but I would remove this for a later PR. It adds to much complexity now.
We wouldn't really need PromQL and all it's needed to support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afais, Prometheus is up high there in the wish list, and VM == Prometheus.
I'm planning on adding real Prometheus asap.

And as such, I would leave PromQL -- it might come useful to some users.
Might probably need some more tests, but REST API was "copy/pasted" (and implemented) from the docs.

Copy link
Contributor

@brunobat brunobat Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not contesting being here at some point, I'm just concerned about the size of the PR. We need to break this up because the important parts are totally obfuscated.
I strongly believe we should have only Jaeger-all and Grafana-all on this first PR.
Also believe that expanding the number of destinations is secondary and we should focus on making sure the user experience is spot on.

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>quarkus-observability-testlibs</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename from testlibs to observability-devresource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be other test libs (artifacts) in the future, not just devresources ...

Copy link
Contributor

@brunobat brunobat Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just because the name is very misleading... It's not just for tests, I imagine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. OK, will try to think of a better name.

quarkus.micrometer.export.otlp.enabled=true
quarkus.micrometer.export.otlp.publish=true
quarkus.micrometer.export.otlp.default-registry=true
quarkus.micrometer.export.otlp.url=http://${quarkus.otel-collector.http}/v1/metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it probably be the other way around? Instead of quarkus.otel-collector.http, should we pick up the value from quarkus.micrometer.export.otlp.url

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, afais, no -- you need the location / root url of OTel Collector.

Comment on lines +25 to +37
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-victoriametrics</artifactId>
</dependency>
<!-- Add these deps as non-test / plain dependency, so we can run dev mode to check -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devresource-victoriametrics</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devresource-grafana</artifactId>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should simplify the setup for the users. Having just quarkus-observability already including a default devservice would be optimal.
We could create a different artifact for other options... But just a single dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's on my todo list - as we discussed - I'll add an "uber" pom, with all "normal" dependecies.
e.g. all probably don't make sense, as some exclude each other

@brunobat
Copy link
Contributor

I'd suggest to reduce the PR size so we can better iron out how users are going to use this.

  • To maintain the user choice of runtime extensions, we could rename quarkus-observability to quarkus-observability-devservices leaving the quarkus-observability to be used in the future to aggregate runtime metrics, traces, and logs.
  • we should have implementations per output. Ex: quarkus-observability-jaeger, quarkus-observability-grafana, quarkus-observability-victoriametrics-otlp (service->otel collector->victoria), quarkus-observability-victoriametrics-agent and quarkus-observability-victoriametrics-service.
  • It theory we can do this in 3 PRs+.
  • For victoria metrics we can have setup variations.

@quarkus-bot

This comment has been minimized.

@alesj alesj force-pushed the obs1 branch 2 times, most recently from 6a16a97 to 305c4ee Compare November 7, 2023 16:24

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link

quarkus-bot bot commented Jan 10, 2024

Failing Jobs - Building 0f5c776

Status Name Step Failures Logs Raw logs Build scan
JVM Tests - JDK 17 Build Failures Logs Raw logs 🔍
JVM Tests - JDK 21 Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Tests - JDK 17 #

- Failing: integration-tests/observability-multiapp 

📦 integration-tests/observability-multiapp

io.quarkus.observability.test.SharedTracingTest.testTracing line 14 - More details - Source on GitHub

java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)

⚙️ JVM Tests - JDK 21 #

- Failing: integration-tests/observability-multiapp 

📦 integration-tests/observability-multiapp

io.quarkus.observability.test.SharedTracingTest.testTracing line 14 - More details - Source on GitHub

java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:589)
	at java.base/sun.nio.ch.Net.connect(Net.java:578)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:751)
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)

@alesj
Copy link
Contributor Author

alesj commented Jan 22, 2024

Closing in favor of a new, similar PR, but (hopefully) lighter version.

@alesj alesj closed this Jan 22, 2024
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation release/noteworthy-feature triage/invalid This doesn't seem right
Projects
Development

Successfully merging this pull request may close these issues.

OpenTelemetry Collector for DevServices
3 participants