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

Set extension properties directly #41244

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

brunobat
Copy link
Contributor

@brunobat brunobat commented Jun 17, 2024

fixes #41101

  • Detect which extensions (Otel, Micrometer OTLP registry) are being used and set properties accordingly.
  • Remove Quarkus prefix to service properties because they will not be used by the users.
  • Update documentation
  • Boy Scout stuff like removing lambda expressions from extension and use inner classes for test profiles.

There are breaking changes.
The following properties are removed because they are not needed anymore:

  • quarkus.otel-collector.url
  • quarkus.grafana.url

The extension will now detect if Micrometer OTLP registry or the OpenTelemetry extension are present and set the relevant properties for the user.


@Test
public void testTracing() {
log.info("Testing Grafana ...");
String response = RestAssured.get("/api/poke?f=100").body().asString();
log.info("Response: " + response);
GrafanaClient client = new GrafanaClient("http://" + url, "admin", "admin");
GrafanaClient client = new GrafanaClient(endpoint, "admin", "admin");
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work w/o http:// ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, I'm just trying to make things compatible with the previous version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you check / fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the endpoint already includes the http:// part

Copy link

github-actions bot commented Jun 17, 2024

🙈 The PR is closed and the preview is expired.

@brunobat brunobat force-pushed the lgtm-properties branch 2 times, most recently from 302306d to 5249b4d Compare June 18, 2024 14:41
@brunobat brunobat marked this pull request as ready for review June 18, 2024 14:47
@brunobat
Copy link
Contributor Author

brunobat commented Jun 18, 2024

@alesj @melloware The PR is ready for review

Copy link
Contributor

@melloware melloware left a comment

Choose a reason for hiding this comment

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

LGTM

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat requested a review from alesj June 19, 2024 08:42

This comment has been minimized.

* @param catalog observability catalog. If OpenTelemetry or Micrometer are enabled.
* @return module's config
*/
T config(ModulesConfiguration configuration, ExtensionsCatalog catalog);
Copy link
Contributor

Choose a reason for hiding this comment

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

Have this one call deprecated by default -- so we don't break existing impls (if there are any ...).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why to deprecate this one?... It's the new method.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not this one -- deprecate the old one.
And have the new one call the old one by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about it, but they are needed for different things and I didn't want to mess things too much.

Copy link
Contributor

@alesj alesj Jul 12, 2024

Choose a reason for hiding this comment

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

True ... but this way we can don't break any existing ones (if there are some :-) ...

@alesj
Copy link
Contributor

alesj commented Jun 24, 2024

And perhaps add prop names changes to CLI `update command?

@alesj
Copy link
Contributor

alesj commented Jun 24, 2024

And perhaps add prop names changes to CLI `update command?

... and we definitely need to mention the name changes in the release notes ...

@brunobat
Copy link
Contributor Author

brunobat commented Jul 3, 2024

e definitely need to mention the name changes in the release notes ...

I will. I'm not sure about the update command, can you please do it later?

This comment has been minimized.

This comment has been minimized.

@brunobat brunobat requested review from melloware and alesj July 3, 2024 15:57
Copy link
Contributor

@melloware melloware left a comment

Choose a reason for hiding this comment

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

this looks great

@gsmet
Copy link
Member

gsmet commented Jul 3, 2024

Hmmm, why are we having properties outside of the quarkus. namespace? We worked hard to normalize it, I'm not exactly excited by the idea of not following this convention.

@melloware
Copy link
Contributor

@gsmet i think the properties in question can't be changed by user they are dynamically allocated by the system right?

@brunobat
Copy link
Contributor Author

brunobat commented Jul 3, 2024

correct @melloware.
The property values are generated by the extension and should be read only.
In normal cases the user don't even need them and this PR is to make sure they are automatically configured into the extensions that need them.

@geoand
Copy link
Contributor

geoand commented Jul 4, 2024

Even in light of that explanation, I still don't understand why the properties are not under the Quarkus namespace.
Also, what does "read only" mean? IIUC from the docs, they are settable by the user aren't they?

@brunobat
Copy link
Contributor Author

brunobat commented Jul 4, 2024

The long explanation...
Those properties are set by the extension with the outside ports of the docker container. They should not be changed by the user, therefore they are "read only".
If we place them under the quarkus namespace I have to create configurations for them, to remove the warning, and to make sure the user doesn't configure them, there are ways but it's not strait-forward and all this sounds overkill for properties that shouldn't even be public.
There's a case for not have them documented at all, however I decided to keep them because people can use those properties to interact with the container in creative ways.

@geoand
Copy link
Contributor

geoand commented Jul 4, 2024

If we place them under the quarkus namespace I have to create configurations for them, to remove the warning, and to make sure the user doesn't configure them, there are ways but it's not strait-forward and all this sounds overkill for properties that shouldn't even be public.

Sure, but this is the same argument that people have always used and we always push back against 😉

@brunobat
Copy link
Contributor Author

brunobat commented Jul 4, 2024

Ok, then I will just say the properties were removed and are not available anymore.

@geoand
Copy link
Contributor

geoand commented Jul 4, 2024

👍🏼

@brunobat
Copy link
Contributor Author

brunobat commented Jul 4, 2024

@gsmet removed references to those properties.

Copy link

quarkus-bot bot commented Jul 4, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 10c335d.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

⚠️ There are other workflow runs running, you probably need to wait for their status before merging.

You can consult the Develocity build scans.

Copy link

quarkus-bot bot commented Jul 4, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 10c335d.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@maxandersen
Copy link
Member

Remove Quarkus prefix to service properties because they will not be used by the users.

makes me squint seeing we remove quarkus prefix...aren't that prefix used for various config setup? ...is this because these properties are truly devmode internal only / used to decouple different services? should we maybe have another prefix for them or?

@brunobat
Copy link
Contributor Author

brunobat commented Jul 8, 2024

Remove Quarkus prefix to service properties because they will not be used by the users.

makes me squint seeing we remove quarkus prefix...aren't that prefix used for various config setup? ...is this because these properties are truly devmode internal only / used to decouple different services? should we maybe have another prefix for them or?

Yes @maxandersen , they are internal properties that should not be changed by users and should not be documented. Therefore, the missing quarkus prefix because as soon as we add it, we need to create a property to not have a console warning and creating a property requires documentation.
As far as I know, this is the first time we have "read-only" properties like these ones. It would be nice to have a different prefix and behaviour for them. What do you think, @radcortez ?

@radcortez
Copy link
Member

As far as I know, this is the first time we have "read-only" properties like these ones. It would be nice to have a different prefix and behaviour for them. What do you think, @radcortez ?

You can add such properties as Map<String, String> to a BUILD_AND_RUN_TIME_FIXED. Just pick a path for the Map. and then the validation will mark as valid any property name as part of the Map. It still requires documentation, but you can add something generic Internal Quarkus container properties... etc..

Yes, users could still set the configuration from build time, but since you can always override it, disregarding the one set by the user. When you get to dev mode, because the phase is BUILD_AND_RUN_TIME_FIXED, it cannot be changed.

@brunobat
Copy link
Contributor Author

brunobat commented Jul 8, 2024

As far as I know, this is the first time we have "read-only" properties like these ones. It would be nice to have a different prefix and behaviour for them. What do you think, @radcortez ?

You can add such properties as Map<String, String> to a BUILD_AND_RUN_TIME_FIXED. Just pick a path for the Map. and then the validation will mark as valid any property name as part of the Map. It still requires documentation, but you can add something generic Internal Quarkus container properties... etc..

Yes, users could still set the configuration from build time, but since you can always override it, disregarding the one set by the user. When you get to dev mode, because the phase is BUILD_AND_RUN_TIME_FIXED, it cannot be changed.

That's why I prefer not even document the properties... Too much work for nothing. :)

@alesj
Copy link
Contributor

alesj commented Jul 12, 2024

@brunobat apart from those comments I just made, lgtm.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Ok, let's make progress on this, we can still tweak things later if needed.

@gsmet gsmet merged commit 13ba085 into quarkusio:main Jul 12, 2024
23 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Quarkus logs warning for properties set by Observability Dev Services with Grafana OTEL LGTM
7 participants