Skip to content

Add OpenTelemetry API to the in-process container test classpath - MERGEOK#37251

Merged
onurkaracali merged 1 commit into
masterfrom
onur/otel-api-inprocess-test-classpath
Jun 18, 2026
Merged

Add OpenTelemetry API to the in-process container test classpath - MERGEOK#37251
onurkaracali merged 1 commit into
masterfrom
onur/otel-api-inprocess-test-classpath

Conversation

@onurkaracali

@onurkaracali onurkaracali commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Problem

OpenTelemetryProvider (implements Provider<OpenTelemetry>) is registered in every container's component graph. Building any in-process container graph (e.g. via com.yahoo.application.Application, used by sample-app and tenant tests) makes ComponentGraph reflect the provider's generic interface — ComponentNode.componentType()Class.getGenericInterfaces() — which must load io.opentelemetry.api.OpenTelemetry.

The API was added to container-dev (so vespa's own in-process tests pass) but not to the user-facing in-process test framework, the application module. So tenant / sample-app tests that boot a container fail:

TypeNotPresentException: Type io.opentelemetry.api.OpenTelemetry not present
Caused by: ClassNotFoundException: io.opentelemetry.api.OpenTelemetry

(In a real deployment the container-opentelemetry pre-installed bundle supplies the API via OSGi; the flat in-process test classpath has no such mechanism.)

Fix

  • application/pom.xml: add opentelemetry-api to the test-visible dependencies (it transitively brings -context and -common).
  • container-dependencies-enforcer/pom.xml: allow opentelemetry-api/-common/-context at test scope.

The enforcer allow-list is kept in sync with the cloud and hosted tenant-base dependency enforcers (the poms note this requirement). Those companion PRs are listed below and should merge together with this one.

🤖 Generated with Claude Code

Related PRs (merge together)

OpenTelemetryProvider (implements Provider<OpenTelemetry>) is registered in
every container's component graph. Building any in-process container graph
reflects the provider's generic interface (ComponentNode.componentType ->
Class.getGenericInterfaces), which requires io.opentelemetry.api.OpenTelemetry
on the classpath. The API was added to container-dev but not to the
user-facing in-process test framework (the application module), so sample-app /
tenant tests that boot a container via com.yahoo.application.Application fail
with:

  TypeNotPresentException: Type io.opentelemetry.api.OpenTelemetry not present
  Caused by: ClassNotFoundException: io.opentelemetry.api.OpenTelemetry

Add opentelemetry-api to the application module (it transitively brings
-context and -common) and allow the three artifacts at test scope in
container-dependencies-enforcer (kept in sync with the cloud and hosted
tenant-base dependency enforcers).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@onurkaracali onurkaracali changed the title Add OpenTelemetry API to the in-process container test classpath Add OpenTelemetry API to the in-process container test classpath - MERGEOK Jun 18, 2026
@onurkaracali onurkaracali requested a review from bjorncs June 18, 2026 16:07
@onurkaracali onurkaracali merged commit 019d16a into master Jun 18, 2026
2 of 3 checks passed
@onurkaracali onurkaracali deleted the onur/otel-api-inprocess-test-classpath branch June 18, 2026 16:10
esolitos added a commit that referenced this pull request Jun 22, 2026
* origin/master: (55 commits)
  Optimize sameElement over multivalue
  Allow configuring ONNX graph optimization for ONNX embedders
  metrics-proxy: add osVersion to the alive metric via a config-driven host-dimension mapping (#37254)
  Allow configuring optimization for ONNX models in services.xml
  Restrict tensorFromLabelsWithOffset to array attributes
  Use float cell type for tensorFromLabelsWithOffset
  Restrict tensorFromLabelsWithOffset to attribute source
  Add estimated flush duration to flush target interface.
  Add tensorFromLabelsWithOffset rank feature
  tweak abs cost of always_strict complex leafs
  Add method for getting only tenants with applications
  Use std::format
  Make ONNX graph optimization configurable per model (default off)
  Add OpenTelemetry API to the in-process container test classpath (#37251)
  Add dot product computation between two quantized vectors
  Expose disk index flush duration in proton state explorer.
  Expose reserved memory in proton state explorer.
  Install telemetry.def so the config server can resolve it (#37246)
  Expose reserved memory metric.
  Revert "Revert "Revert "Revert "Add OpenTelemetry tracing provider to the con…" (#37244)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants