This buildpack framework automatically instruments your Java application with the Splunk distribution of OpenTelemetry Java Instrumentation 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.
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": "<redacted>", "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. |
splunk.realm |
Yes | Splunk realm where data will be sent. This is commonly us0 , eu0 , and so on. See 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. |
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.