open-telemetry / open-telemetry/opentelemetry-java-instrumentation
OpenJDK CRaC support
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 1.2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 228
Description
Is your feature request related to a problem? Please describe.
I'm using Spring Boot app and I was hoping I could utilize the CRaC project. My app uses this javaagent to send observability data to server.
In order for CRaC to work, so called checkpoint must be captured, and restored. Before checkpoint is captured, all open connections, sockets and files must be closed. Also, when restoring the checkpoint, every such connection,socket and file must be reopened so the app can perform the same way before the checkpoint was taken.
So the problem here is that opentelemetry java agent has an open connection to server where it sends data to, and from the java code, we have no way to close/reopen such connection, meaning capturing the checkpoint is impossible.
Describe the solution you'd like
The solution would be to make opentelemetry javaagent CRaC compatible, meaning that the agent can automatically respond to checkpoint capturing/restoring by closing /reopening connections,sockets and files it manages.
That way capturing the checkpoint would be possible.
Describe alternatives you've considered
Here is the list of all things I tried. All of them failed or we gave up on them for different reasons:
- Considered using opentelemetry SDK
- Tried to use dynamic attach mechanism to attach javaagent at runtime, when the checkpoint is restored
- Force killing all connections from the app to try and capture the checkpoint
- Starting the agent without a way for it to connect to server it uploads data to
Additional context
Other javaagents have the same issue with CRaC and are actively working on it:
https://github.com/elastic/apm-agent-java/issues/2982
https://github.com/newrelic/newrelic-java-agent/issues/1697
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the CRaC introduction linked in the issue and the OpenTelemetry Java instrumentation repository; identify the agent-managed connections, sockets, and files that must participate in checkpoint and restore callbacks. Done means the javaagent closes them before a checkpoint and reopens them on restore, with behavior verified for telemetry delivery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100