> Markdown version of [Configuration](https://vaadin.com/docs/v23/tools/observability/configuration). Section index: [llms.txt](https://vaadin.com/docs/v23/tools/llms.txt)

# Configuring Observability Kit

Instrumentation can be configured in the `agent.properties` file that’s used with the Java agent.

## <a id="service-configuration"></a>Service Configuration

The `service` attributes are used to differentiate traces from different services or applications which might have many instances running simultaneously, for example, horizontally scaled services.

The service attributes are as follows:

- `service.name` is an attribute that’s used to distinguish a service by name.

  The default value is `vaadin`. This is the only attribute with a default value. It’s also the only one required.

- `service.namespace` helps to distinguish a group of services.

- `service.instance.id` helps to distinguish instances of the same service that exist at the same time.

  This must be unique for each instance of the same `service.namespace`, `service.name` pair.

- `service.version` Semantic Versioning string of the service version.

The `service.name` attribute is configured using the `otel.service.name` property, either in the `agent.properties` configuration file, as a system property, or as environment variable.

Add the following line to the `agent.properties` file:

**Configuration file**

```properties
otel.service.name=myapp
```

Pass the `otel.service.name` system property when starting the Java process:

**System property**

```terminal
java -Dotel.service.name="myapp" ...
```

Define the `OTEL_SERVICE_NAME` environment variable before starting the Java process:

**Environment variable**

```terminal
# Linux / macOS
export OTEL_SERVICE_NAME="myapp"
# Windows
set OTEL_SERVICE_NAME="myapp"
```

Other service attributes are configured using the `otel.resource.attributes` property, either in the `agent.properties` configuration file, as a system property, or as environment variable. Multiple attributes are separated by commas.

Add the following line to the `agent.properties` file:

**Configuration file**

```properties
otel.resource.attributes=service.namespace=myservices,service.instance.id=myapp-eu
```

Pass the `otel.resource.attributes` system property when starting the Java process:

**System property**

```terminal
java -Dotel.resource.attributes="service.namespace=myservices,service.instance.id=myapp-eu" ...
```

Define the `OTEL_RESOURCE_ATTRIBUTES` environment variable before starting the Java process:

**Environment variable**

```terminal
# Linux / macOS
export OTEL_RESOURCE_ATTRIBUTES="service.namespace=myservices,service.instance.id=myapp-eu"
# Windows
set OTEL_RESOURCE_ATTRIBUTES="service.namespace=myservices,service.instance.id=myapp-eu"
```

For more information about service configuration, see the [OpenTelemetry documentation](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service).

## <a id="default-opentelemetry-instrumentation"></a>Default OpenTelemetry Instrumentation

The custom distribution disables default OpenTelemetry instrumentation for Vaadin and servlets.

The default instrumentation is disabled because a single-page Vaadin application logging all requests wasn’t helpful and generated plenty of data. They were disabled to have control over which requests generate a trace.

The instrumentation modules that are disabled by default are:

- jetty

- servlet

- tomcat

To enable any of these, add the following line to the `agent.properties` file:

```properties
otel.instrumentation.${instrumentationName}.enabled=true
```
