> For the complete documentation index, see [llms.txt](https://docs.ostara.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ostara.dev/documentation/agents/configuration/service-discovery/internal.md).

# Internal

Internal service discovery is a self discovery mechanism which allows you to integrate your Spring applications with Ostara via a simple dependency.

{% hint style="danger" %}
This type of service discovery is only supported for **Spring Boot 3** and above, and requires Java 17 and above.
{% endhint %}

## Setup

Add the following dependency to your project:

{% hint style="info" %}
The client dependency goes by the same version as Ostara
{% endhint %}

{% code title="Gradle (Kotlin)" %}

```kotlin
implementation("dev.ostara:spring-client:VERSION")
```

{% endcode %}

{% code title="Gradle (Groovy)" %}

```groovy
implementation 'dev.ostara:spring-client:VERSION'
```

{% endcode %}

{% code title="Maven" %}

```xml
<dependency>
    <groupId>dev.ostara</groupId>
    <artifactId>spring-client</artifactId>
    <version>VERSION</version>
</dependency>
```

{% endcode %}

After adding the dependency, you must set the following configuration:

{% code title="Yaml" %}

```yaml
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
```

{% endcode %}

{% code title="Properties" %}

```properties
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
```

{% endcode %}

Finally, add the `@EnableOstaraClient` annotation to any configuration bean:

```java
@EnableOstaraClient
@SpringBootApplication
public class Application {
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ostara.dev/documentation/agents/configuration/service-discovery/internal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
