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

Fix ObservabilityDevServicesConfigBuildItem usage - can be multiple, fix dup logging output #43945

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

alesj
Copy link
Contributor

@alesj alesj commented Oct 17, 2024

There can (and probably will be) multiple ObservabilityDevServicesConfigBuildItem instances,
since there can be multiple DevResources instances.
Currently only the last one would probably be used with this Optional<ObservabilityDevServicesConfigBuildItem> parameter?
This fixes ObservabilityDevServicesConfigBuildItem usage, so all are checked for potential DevUI contribution.

@alesj
Copy link
Contributor Author

alesj commented Oct 17, 2024

@melloware wdyt?

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.

i like it

This comment has been minimized.

Copy link

github-actions bot commented Oct 17, 2024

🎊 PR Preview a4b05f7 has been successfully built and deployed to https://quarkus-pr-main-43945-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

This comment has been minimized.

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

LGTM

Map<String, String> runtimeConfig = configProps.get().getConfig();
String grafanaUrl = runtimeConfig.getOrDefault("grafana.endpoint", "");
if (configProps != null) {
configProps.forEach(cp -> {
Copy link
Member

Choose a reason for hiding this comment

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

No need to change it here but we should really avoid using lambdas when they have no value. In this case a for loop would have been better.

Also configProps should never be null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@alesj alesj changed the title Fix ObservabilityDevServicesConfigBuildItem usage - can be multiple Fix ObservabilityDevServicesConfigBuildItem usage - can be multiple, fix dup logging output Oct 18, 2024
@alesj
Copy link
Contributor Author

alesj commented Oct 18, 2024

@gsmet @melloware @brunobat any idea why am I not seeing any of this log from ObservabilityContainer when starting LGTM ...

    protected void addFileToContainer(byte[] content, String pathInContainer) {
        log.infof("Content [%s]: \n{}", pathInContainer, new String(content, StandardCharsets.UTF_8));
        withCopyToContainer(Transferable.of(content, 0777), pathInContainer);
    }

    @Override
    public void start() {
        log.infof("Starting %s ...", prefix());
        super.start();
    }

    @Override
    public void stop() {
        log.infof("Stopping %s...", prefix());
        super.stop();
    }

all I get is this -- which is still fine -- but would also like to see the stuff above

@alesj
Copy link
Contributor Author

alesj commented Oct 18, 2024

@gsmet @melloware @brunobat any idea why am I not seeing any of this log from ObservabilityContainer when starting LGTM ...

    protected void addFileToContainer(byte[] content, String pathInContainer) {
        log.infof("Content [%s]: \n{}", pathInContainer, new String(content, StandardCharsets.UTF_8));
        withCopyToContainer(Transferable.of(content, 0777), pathInContainer);
    }

    @Override
    public void start() {
        log.infof("Starting %s ...", prefix());
        super.start();
    }

    @Override
    public void stop() {
        log.infof("Stopping %s...", prefix());
        super.stop();
    }

all I get is this -- which is still fine -- but would also like to see the stuff above

OK, this is the "culprit" - in ObservabilityDevServiceProcessor ...

            StartupLogCompressor compressor = new StartupLogCompressor(
                    (launchMode.isTest() ? "(test) " : "") + devId + " Dev Services Starting:",
                    consoleInstalledBuildItem,
                    loggingSetupBuildItem,
                    s -> false,
                    s -> s.contains(getClass().getSimpleName())); // log if it comes from this class

This comment has been minimized.

@alesj
Copy link
Contributor Author

alesj commented Oct 18, 2024

OK, fixed that "missing" log stuff as well.

Copy link

quarkus-bot bot commented Oct 18, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 5b12d57.

✅ 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.

Warning

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
Contributor

@brunobat brunobat left a comment

Choose a reason for hiding this comment

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

It looks good to me now.

Copy link

quarkus-bot bot commented Oct 18, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 5b12d57.

✅ 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.

@brunobat brunobat merged commit 3c57929 into quarkusio:main Oct 18, 2024
22 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.17 - main milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants