Configurable Settings - Java Distributed Application on Windows

No OpenTelemetry Collector
Using an OpenTelemetry Collector
Agent
Collector
N/A

Overview

vFunction Distributed Applications use the Java Auto-instrumentation OpenTelemetry Agent to generate traces sent to the vFunction Server for Analysis. The OpenTelemetry Agent accepts JVM Parameters to set configurable settings for the Agent.

If sending OpenTelemetry Traces only to the vFunction Server, these JVM Parameters can be used to define the vFunction Server as the Endpoint for Traces and to eliminate all other types of unneeded OpenTelemetry traffic. In this scenario, all OpenTelemetry configurable settings are defined alongside the running application.

Alternatively, vFunction can be one of multiple OpenTelemetry vendors that receive information from the OpenTelemetry Agent. In this scenario, an OpenTelemetry Collector can be used to define some OpenTelemetry configurable settings and there are very few configurable settings to set alongside the running application.


No OpenTelemetry Collector


Required Agent Settings with no Collector

How to apply changes to the Required Agent Settings

JVM Parameters can be used for the Configurable Settings of the OpenTelemetry Agent. The addition of or changes to these JVM Parameters will be picked up when the Java Application is restarted.


Required Fields

Quick links to specific required fields:

Explanations of each required field:

Variable Name
Sample Value
Explanation of the Variable and Key Values
  • javaagent
-javaagent:C:\\path\\to\\opentelemetry-javaagent.jar
  • The Javagent flag should be used to indicate where on the filesystem the opentelemetry-javaagent.jar exists
  • The opentelemetry-javaagent.jar should be owned by the user that runs the Java Application
  • otel.exporter.otlp.endpoint
-Dotel.exporter.otlp.endpoint=https://vfunction.mycompany.com/api/unauth/otlp
  • The vFunction Server maintains an endpoint that listens for OpenTelemetry OTLP traffic: api/unauth/otlp. Add your vFunction Server followed by this endpoint
  • otel.exporter.otlp.traces.headers
-Dotel.exporter.otlp.traces.headers=X-VF-App=111111-1111-1111-111111
  • The Header X-VF-App is used to define the vFunction App to receive the traces sent from the Java Application
  • The vFunction App UUID can be retrieved from the vFunction UI: on the Learning tab in the top-center, select "Installation Instructions" from the left-hand sidebar. Look for the UUID in the sample text box for the otel.exporter.otlp.headers

Sample JVM Parameters used during the Application’s Startup
java -javaagent:/opt/vfunction/opentelemetry-javaagent.jar \
  -Dotel.exporter.otlp.endpoint=https://vfunction.mycompany.com/api/unauth/otlp \
  -Dotel.exporter.otlp.traces.headers=111111-1111-1111-111111 \
  -jar oms-sb-mybatis-0.0.1-SNAPSHOT.jar

Optional Agent Settings with no Collector

A full list of configurable settings can be accessed on the OpenTelemetry website. The list below pertain to how vFunction uses the OpenTelemetry Agent.

Quick links to all optional fields:

Explanations of each optional field:

Variable Name
Sample Value
Explanation of the Variable and Key Values
  • otel.bsp.schedule.delay
-Dotel.bsp.schedule.delay=2000
  • Delay interval (in milliseconds) between two consecutive exports
  • Default value is 5000
  • otel.bsp.export.timeout
-Dotel.bsp.export.timeout=60000
  • Maximum allowed time (in milliseconds) to export data
  • Default value is 30000
  • otel.bsp.max.queue.size
-Dotel.bsp.max.queue.size=4096
  • Maximum queue size
  • Default value is 2048
  • otel.bsp.max.export.batch.size
-Dotel.bsp.max.export.batch.size=1024
  • Maximum batch size. Must be less than or equal to OTEL_BSP_MAX_QUEUE_SIZE
  • Default value is 512
  • OTEL_EXPORTER_OTLP_CERTIFICATE
/opt/app/ca-cert.pem
  • Path to the CA certificate file (PEM format) used to verify the server’s TLS certificate
  • OTEL_EXPORTER_OTLP_HEADERS
X-VF-TAG=qa
  • Comma-separated list of additional HTTP headers sent with each export
  • The X-VF-APP header is required for a vFunction Distributed App
  • In addition to the X-VF-APP header, the X-VF-TAG header can be used to define tags to be associated to Services, such as environment tags like QA, DEV or Service Groupings
  • OTEL_EXPORTER_OTLP_PROTOCOL
http/protobuf
  • OTLP exporter transport protocol. Supported values are grpc, http/protobuf
  • The OpenTelemetry .NET Automatic Instrumentation defaults to http/protobuf, which differs from the OpenTelemetry .NET SDK default value of grpc
  • On .NET Framework, the grpc OTLP exporter protocol is not supported
  • OTEL_EXPORTER_OTLP_TIMEOUT
5000
  • The max waiting time (in milliseconds) for the backend to process each batch
  • Default value is 10000
  • OTEL_LOG_LEVEL
debug
  • SDK log level. (supported values: none, error, warn, info, debug)
  • Default value is "info"
  • OTEL_LOGS_EXPORTER
none
  • Comma-separated list of exporters. Supported options: otlp, console, none
  • The vFunction Distributed Application does not support Log Exports, so the value can be set to "none"
  • OTEL_METRICS_EXPORTER
none
  • Comma-separated list of exporters. Supported options: otlp, prometheus, console, none
  • The vFunction Distributed Application does not support Metrics Exports, so the value can be set to "none"
  • OTEL_SERVICE_NAME
  • OpenTelemetry tries to auto-detect the Service Name. For example, if the application is hosted on IIS in .NET Framework this will be SiteName\VirtualPath ex: MySite\MyApp
  • Explicitly adding the OTEL_SERVICE_NAME can be useful to ensure that Names match C4 Exports and vFunction Distributed Application Analysis
  • OTEL_TRACES_EXPORTER
otlp
  • Comma-separated list of exporters. Supported options: otlp, zipkin, console, none
  • Default value is "otlp"
  • The vFunction Distributed Application accepts the "otlp" traces exporter

Using an OpenTelemetry Collector


Required Agent Settings with an OpenTelemetry Collector

How to apply changes to the Required Agent Settings

JVM Parameters can be used for the Configurable Settings of the OpenTelemetry Agent. The addition of or changes to these JVM Parameters will be picked up when the Java Application is restarted.


Required Fields

Quick links to specific required fields:

Explanations of each required field:

Variable Name
Sample Value
Explanation of the Variable and Key Values
  • javaagent
-javaagent:C:\\path\\to\\opentelemetry-javaagent.jar
  • The Javagent flag should be used to indicate where on the filesystem the opentelemetry-javaagent.jar exists
  • The opentelemetry-javaagent.jar should be owned by the user that runs the Java Application
  • otel.exporter.otlp.endpoint
-Dotel.exporter.otlp.endpoint=http://otelcollector.mycompany.com:4318
  • Target endpoint for the OTLP exporter. In this scenario, the OpenTelemetry Collector address
  • If using "http/protobuf" as the OTEL_TRACES_OTLP_PROTOCOL, then the default value is "http://localhost:4318"

Sample Environment Variables used during the Application’s Startup
java -javaagent:/opt/vfunction/opentelemetry-javaagent.jar \
  -Dotel.exporter.otlp.endpoint=http://otelcollector.mycompany.com:4318 \
  -jar oms-sb-mybatis-0.0.1-SNAPSHOT.jar

Optional Agent Settings with an OpenTelemetry Collector

A full list of configurable settings can be accessed on the OpenTelemetry website. The list below pertain to how vFunction uses the OpenTelemetry Agent.

Quick links to all optional fields:

Explanations of each optional field:

Variable Name
Sample Value
Explanation of the Variable and Key Values
  • otel.bsp.schedule.delay
-Dotel.bsp.schedule.delay=2000
  • Delay interval (in milliseconds) between two consecutive exports
  • Default value is 5000
  • otel.bsp.export.timeout
-Dotel.bsp.export.timeout=60000
  • Maximum allowed time (in milliseconds) to export data
  • Default value is 30000
  • otel.bsp.max.queue.size
-Dotel.bsp.max.queue.size=4096
  • Maximum queue size
  • Default value is 2048
  • otel.bsp.max.export.batch.size
-Dotel.bsp.max.export.batch.size=1024
  • Maximum batch size. Must be less than or equal to OTEL_BSP_MAX_QUEUE_SIZE
  • Default value is 512
  • OTEL_EXPORTER_OTLP_CERTIFICATE
/opt/app/ca-cert.pem
  • Path to the CA certificate file (PEM format) used to verify the server’s TLS certificate
  • OTEL_EXPORTER_OTLP_HEADERS
X-VF-TAG=qa
  • Comma-separated list of additional HTTP headers sent with each export
  • The X-VF-APP header is required for a vFunction Distributed App
  • In addition to the X-VF-APP header, the X-VF-TAG header can be used to define tags to be associated to Services, such as environment tags like QA, DEV or Service Groupings
  • OTEL_EXPORTER_OTLP_PROTOCOL
http/protobuf
  • OTLP exporter transport protocol. Supported values are grpc, http/protobuf
  • The OpenTelemetry .NET Automatic Instrumentation defaults to http/protobuf, which differs from the OpenTelemetry .NET SDK default value of grpc
  • On .NET Framework, the grpc OTLP exporter protocol is not supported
  • OTEL_EXPORTER_OTLP_TIMEOUT
5000
  • The max waiting time (in milliseconds) for the backend to process each batch
  • Default value is 10000
  • OTEL_LOG_LEVEL
debug
  • SDK log level. (supported values: none, error, warn, info, debug)
  • Default value is "info"
  • OTEL_LOGS_EXPORTER
none
  • Comma-separated list of exporters. Supported options: otlp, console, none
  • The vFunction Distributed Application does not support Log Exports, so the value can be set to "none"
  • OTEL_METRICS_EXPORTER
none
  • Comma-separated list of exporters. Supported options: otlp, prometheus, console, none
  • The vFunction Distributed Application does not support Metrics Exports, so the value can be set to "none"
  • OTEL_SERVICE_NAME
  • OpenTelemetry tries to auto-detect the Service Name. For example, if the application is hosted on IIS in .NET Framework this will be SiteName\VirtualPath ex: MySite\MyApp
  • Explicitly adding the OTEL_SERVICE_NAME can be useful to ensure that Names match C4 Exports and vFunction Distributed Application Analysis
  • OTEL_TRACES_EXPORTER
otlp
  • Comma-separated list of exporters. Supported options: otlp, zipkin, console, none
  • Default value is "otlp"
  • The vFunction Distributed Application accepts the "otlp" traces exporter

Required Collector Settings with an OpenTelemetry Collector

Quick links to specific required fields:

Explanations of each required field:

Variable Name
Explanation of the Variable and Key Values
exporters:
   otlphttp/vf:
      endpoint: https://vfunction.mycompany.com/api/unauth/otlp
      headers:
         X-VF-APP: e1e1b85d-0000-0000-0000-aeced0597832
  • Responsible for sending processed OpenTelemetry data to vFunction
  • The api/unauth/otlp is the URL used on a vFunction Server to receive OpenTelemetry Traces
  • The URL will vary for each environment depending on the vFunction Server Address set during the installation process
  • The X-VF-APP Headers value can be retrieved by logging into the vFunction Server UI, creating a Distributed Application, selecting Learning from the top-center menu bar, and clicking Installation Instructions on the left-hand sidebar
  • This value will be unique for each vFunction Distributed Application and must include, as part of the Value, the X-VF-APP Keyname
service:
   pipelines:
      exporters: [otlphttp/vf]
  • Responsible for defining how OpenTelemetry exports OpenTelemetry data to vFunction

Optional Collector Settings with an OpenTelemetry Collector

A full list of configurable settings can be accessed on the OpenTelemetry website. The list below pertain to how vFunction uses the OpenTelemetry Agent.

Quick links to all optional fields:

Explanations of each optional field:

Variable Name
Explanation of the Variable and Key Values
exporters:
   otlphttp/vf:
      retry_on_failure:
         initial_interval: 10
         max_interval: 60
  • See OpenTelemetry documentation for full details
  • Retry_on_failure is enabled by default. Using this field allows you to disable the feature or modify the behavior of the default settings: enabled (true default), interval_interval (5s default), max_interval (30s default), max_elapsed_time (300s default), or multiplier (1.5 default)
exporters:
   otlphttp/vf:
      sending_queue:
         num_consumers: 20
         sizer: bytes
  • See OpenTelemetry documentation for full details
  • The sending_queue is enabled by default. Using this field allows you to disable this feature or modify the behavior of the default settings: enabled (true default), num_consumers (10 default), wait_for_result (false default), block_on_overflow (false default), sizer (requests)
exporters:
   otlphttp/vf:
      tls:
         insecure_skip_verify: true
  • See OpenTelemetry documentation for full details
  • By default, TLS is enabled with server certificate verification using the system root CAs. If using HTTP instead of HTTPS, set insecure: true. If using self-signed certificate for HTTPS, set insecure_skip_verify: true
  • If using internally signed certificates, use ca_file: C:\\path\\to\\ca.crt
processors:
   probabilistic_sampling:
      sampling_percentage: 50
      mode: "proportional"
service:
   pipelines:
      traces:
         processors: [probabilistic_sampler]
  • See OpenTelemetry documentation for full details
  • An application with heavy usage may create a significant amount of OpenTelemetry traffic that prevents the OpenTelemetry Endpoint from processing this data without using a significant amount of resources. Probabilistic Sampling allows the OpenTelemetry Collector to receive the Application’s OpenTelemetry Traces, but to only send some percentage of this traffic onto the vFunction OpenTelemetry Endpoint for processing.