Skip to content

feat(java): add OpenTelemetry metrics bridge - #8064

Open
yanghua wants to merge 6 commits into
lance-format:mainfrom
yanghua:yanghua/java-otel-metrics
Open

feat(java): add OpenTelemetry metrics bridge#8064
yanghua wants to merge 6 commits into
lance-format:mainfrom
yanghua:yanghua/java-otel-metrics

Conversation

@yanghua

@yanghua yanghua commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Java OpenTelemetry metrics support matching pylance’s metrics bridge.
  • Expose Lance Rust metrics through JNI with catalog and snapshot APIs.
  • Register Java observable instruments for counters, gauges, and histogram bucket/count/sum series.
  • Add focused coverage for object-store metrics export through OpenTelemetry.

Tests

  • cargo fmt --check
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo check --manifest-path ./lance-jni/Cargo.toml --locked
  • ./mvnw spotless:check
  • ./mvnw -Dskip.build.jni=true -DskipTests compile
  • ./mvnw -Dtest=org.lance.otel.LanceMetricsTest test

Expose Lance Rust metrics through Java OpenTelemetry observable instruments, matching pylance metric catalog and snapshot semantics.
@github-actions github-actions Bot added enhancement New feature or request A-java Java bindings + JNI A-deps Dependency updates labels Jul 29, 2026
@yanghua
yanghua marked this pull request as ready for review July 29, 2026 06:34
@wjones127
wjones127 self-requested a review July 29, 2026 14:48

@wjones127 wjones127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's one place I'd like to see a stronger test, but otherwise this looks great!

Comment thread java/lance-jni/src/otel.rs
Comment thread java/src/test/java/org/lance/otel/LanceMetricsTest.java
Comment thread java/src/test/java/org/lance/otel/LanceMetricsTest.java
Comment thread java/src/main/java/org/lance/otel/LanceMetrics.java Outdated
Comment thread java/lance-jni/src/otel.rs Outdated
Comment thread java/lance-jni/src/otel.rs Outdated
Comment thread java/lance-jni/src/otel.rs Outdated
Comment thread java/src/main/java/org/lance/otel/LanceMetrics.java
Comment thread java/src/test/java/org/lance/otel/LanceMetricsTest.java
Comment thread java/pom.xml Outdated

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bridge closes a real Java observability gap and preserves the process-global recorder and caller-owned MeterProvider contracts. The tested normal lifecycle and histogram semantics work as intended. I did not find a correctness or safety issue that should block this direction.

Comment thread java/lance-jni/src/otel.rs Outdated
@github-actions github-actions Bot added the A-docs Documentation label Jul 31, 2026
@yanghua

yanghua commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

@wjones127 Thanks, all comments have been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-deps Dependency updates A-docs Documentation A-java Java bindings + JNI enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants