Internal
Internal service discovery is a self discovery mechanism which allows you to integrate your Spring applications with Ostara via a simple dependency.
This type of service discovery is only supported for Spring Boot 3 and above, and requires Java 17 and above.
Setup
Add the following dependency to your project:
implementation("dev.ostara:spring-client:VERSION")
implementation 'dev.ostara:spring-client:VERSION'
<dependency>
<groupId>dev.ostara</groupId>
<artifactId>spring-client</artifactId>
<version>VERSION</version>
</dependency>
After adding the dependency, you must set the following configuration:
ostara:
client:
agent-url: # The URL of the Agent installed in your environment
api-key: # The API key defined in the Agent, required if using SSL
application-name: # The name of the Application to be displayed in Ostara, if not set, defaults to spring.application.name
ostara.client.agent-url= // The URL of the Agent installed in your environment
ostara.client.api-key= // The API key defined in the Agent, required if using SSL
ostara.client.application-name= // The name of the Application to be displayed in Ostara, if not set, defaults to spring.application.name
Finally, add the @EnableOstaraClient
annotation to any configuration bean:
@EnableOstaraClient
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Last updated
Was this helpful?