Skip to content

Add in openapi file helidon objects health and metrics

I was write file openapi.yml wth openapi 3.0 description for services in my helidon project. But I use standart helidon handlers too (health and metrics):

return Routing.builder()
   .register("/api/files", health)     
   .register("/api/files", metrics)    
   .register("/api/files/storage", fileService)
   .register("/api/files", OpenAPISupport.create(config))

How make section for health and metrics in my openapi.yml? I use:




There are two ways you can do this:

  1. Simply add the /health and /metrics endpoint information to the openapi.yml file you already created.
  2. Add your own implementation of the MicroProfile OpenAPI OASModelReader interface to your application that adds the health and metrics information programmatically. You also set a configuration value to tell the system about your implementation. Please see for the details.

Unfortunately, there is not currently any automatic way to add OpenAPI information about health and metrics to your application’s OpenAPI document.

Further information (I seem to have misinterpreted the original question):

The /metrics and /health endpoints are implemented by Helidon, but the MicroProfile Metrics and Health specifications dictate the paths for and the behavior of those endpoints.

Some relevant documents to get you started:



User contributions licensed under: CC BY-SA
10 People found this is helpful