# Splunk Distribution of OpenTelemetry Java Instrumentation
This buildpack framework automatically instruments your Java application
with the [Splunk distribution of OpenTelemetry Java Instrumentation](https://github.com/signalfx/splunk-otel-java)
to send trace data to Splunk Observability Cloud.
| Detection Criterion |
Existence of a bound service containing the string splunk-o11y |
| Tags |
splunk-otel-java-agent=<version> |
The buildpack detect script prints tags to standard output.
## User-Provided Service
Provide your own "user provided service" (cups) instance and bind
it to your application.
The service name MUST contain the string `splunk-o11y`.
For example, to create a service named `splunk-o11y` that represents Observability Cloud
realm `us0` and represents a user environment named `cf-demo`, use the following
commands:
```
$ cf cups splunk-o11y -p \
'{"splunk.realm": "us0", "splunk.access.token": "", "otel.resource.attributes": "deployment.environment=cf-demo"}'
$ cf bind-service myApp splunk-o11y
$ cf restage myApp
```
Provide the following values using the `credential` field of the service:
| Name | Required? | Description
|------------------------|-----------| -----------
| `splunk.access.token` | Yes | Splunk [org access token](https://docs.splunk.com/observability/admin/authentication-tokens/org-tokens.html).
| `splunk.realm` | Yes | Splunk realm where data will be sent. This is commonly `us0`, `eu0`, and so on. See [Available regions or realms](https://docs.splunk.com/observability/en/get-started/service-description.html#available-regions-or-realms) for more information.
| `otel.*` or `splunk.*` | Optional | All additional credentials starting with these prefixes are appended to the application's JVM arguments as system properties.
### Choosing a version
To override the default and choose a specific version, use the `JBP_CONFIG_*` mechanism
and set the `JBP_CONFIG_SPLUNK_OTEL_JAVA_AGENT` environment variable for your application.
For example, to use version 1.16.0 of the Splunk OpenTelemetry Java Instrumentation, run:
```
$ cf set-env testapp JBP_CONFIG_SPLUNK_OTEL_JAVA_AGENT '{version: 1.16.0}'
```
In most cases you can use the latest or default version of the agent available.
# Additional Resources
* [Splunk Observability](https://www.splunk.com/en_us/products/observability.html)
* [Official documentation of the Splunk Java agent](https://docs.splunk.com/observability/en/gdi/get-data-in/application/java/get-started.html)
* [Splunk Distribution of OpenTelemetry Java](https://github.com/signalfx/splunk-otel-java) on GitHub