Configuring Observability Kit
Instrumentation can be configured in the agent.properties file that’s used with the Java agent.
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.nameis 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.namespacehelps to distinguish a group of services. -
service.instance.idhelps 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.namepair. -
service.versionSemantic 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:
Source code
properties
otel.service.name=myappproperties
terminal
terminal
terminal
terminal
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:
Source code
properties
otel.resource.attributes=service.namespace=myservices,service.instance.id=myapp-euproperties
terminal
terminal
terminal
terminal
For more information about service configuration, see the OpenTelemetry documentation.
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:
Source code
properties
otel.instrumentation.${instrumentationName}.enabled=true