glowroot / glowroot

Easy to use, very low overhead, Java APM
https://glowroot.org
Apache License 2.0
1.24k stars 309 forks source link

Spring Boot WebFlux #945

Open robinroos opened 2 years ago

robinroos commented 2 years ago

Now that I have Glowroot running in OpenShift I can start looking at the information it provides.

Hitting the following URL:

http://mydataservices.mydomain.com/th/position/dataset/setid/a6fba952-6a49-49cd-a9a8-7ecf7cdea4a8?limit=3

results in a Web "transaction" in Glowroot of:

/th/position/dataset/setid/a6fba952-6a49-49cd-a9a8-7ecf7cdea4a8

The limit parameter is ignored, and the setId parameter value is deemed to be part of the URL (which it is, but that;s not useful). This means that every HTTP GET request hitting the /th/position/setId/ endpoint for different setId values will be listed separately, instead of being grouped together.

I also note that the cost of these transactions is split between Logging, MongodbQuery and Other. There are no Spring components to the cost of the transaction.

All of this makes me wonder if Glowroot is correctly recognizing the app as a Spring Boot app?

My Controller is marked-up as:

@RestController
@RequestMapping("/th/position")
@Slf4j

and the particular endpoint is:

    @Override
    @Operation(description = "Fetch the Position dataset (or a limit-based subset thereof) for a specific SetId")
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "Successful operation"),
            @ApiResponse(responseCode = "404", description = "Not found")
    })
    @GetMapping(value = "/dataset/setid/{setId}", produces = "application/x-ndjson")
    public Flux<Position> dataset(
            @Parameter(description="string - Set Id") @PathVariable("setId") String setId,
            @Parameter(description="int - Maximum number of dataset members to return") @RequestParam(required = false) Optional<Integer> limit) {
        log.info("dataset(setId={}, limit={})", setId, limit);
        return Flux.fromStream(service.dataset(setId, limit));
    }

To start with, do I need to set anything on the application side to inform Glowroot that this is a Spring Boot application?

robinroos commented 2 years ago

In the Glowroot UI, for one of these Pods, under Configuration -> Instrumentation I see:

There is no configured instrumentation

Perhaps my config.json is defficient?

robinroos commented 2 years ago

This might be a function of how the application is deployed. On the virtual CoreOS host which holds the Pod there is a single .jar file named for my application, within which is a BOOT-INF folder which contains all of its dependencies

robinroos commented 2 years ago

I ran the Spring Boot WebFlux app locally from IntelliJ and allowed it to create its own config.json (0.14.0-beta3, Embedded). I have the same result; no time is allocated against the Spring stack. Other is a huge proportion of total transaction time. Parameters to web calls are not shown. Path parameters to web calls are not seggregated from the URL itself.

So it seems there is no default plugin appropriate for WebFlux, and no default Instrumentation has been created.

chjourdain commented 2 years ago

It's maybe the same issue there https://github.com/glowroot/glowroot/issues/949