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

Auto configure prometheus scraping for lgtm dev service #41944

Closed
jtama opened this issue Jul 17, 2024 · 4 comments · Fixed by #41264
Closed

Auto configure prometheus scraping for lgtm dev service #41944

jtama opened this issue Jul 17, 2024 · 4 comments · Fixed by #41264
Labels
Milestone

Comments

@jtama
Copy link
Contributor

jtama commented Jul 17, 2024

Description

If quarkus-micrometer extensions is used it can be configured to push metrics to prometheus. I think the same could be achieved if quarkus-micrometer-registry-prometheus extension is used.

@melloware already produced a snipet here
#40933 (comment), (I think there may be an issue with the target.

I guess it could be done only if quarkus-micrometer-registry-prometheus is used.

Implementation ideas

No response

Copy link

quarkus-bot bot commented Jul 17, 2024

/cc @geoand (devservices), @radcortez (config), @stuartwdouglas (devservices)

@melloware
Copy link
Contributor

@jtama in my PR I fixed the pathing issue to look up the proper scrape.

private String getPrometheusConfig() {
        Config runtimeConfig = ConfigProvider.getConfig();
        String rootPath = runtimeConfig.getOptionalValue("quarkus.management.root-path", String.class).orElse("/q");
        String metricsPath = runtimeConfig.getOptionalValue("quarkus.management.metrics.path", String.class).orElse("/metrics");
        int httpPort = runtimeConfig.getOptionalValue("quarkus.http.port", Integer.class).orElse(0);
        PrometheusYamlFile prometheusYamlFile = new PrometheusYamlFile(config.serviceName(), rootPath, metricsPath,
                "host.docker.internal", httpPort);
        return prometheusYamlFile.createPrometheusYamlFile();
    }

@jtama
Copy link
Contributor Author

jtama commented Jul 17, 2024

this pr would definitely close this issue : https://github.com/quarkusio/quarkus/pull/41264/files

@melloware
Copy link
Contributor

I linked my PR to this ticket.

@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants