PHOENIX-5215 Migrate from HTrace to OpenTelemetry tracing - #2586
Open
lfrancke wants to merge 14 commits into
Open
PHOENIX-5215 Migrate from HTrace to OpenTelemetry tracing#2586lfrancke wants to merge 14 commits into
lfrancke wants to merge 14 commits into
Conversation
…jars Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
…HBase Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
…encies Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
Generated-by: Claude Opus 5 (Claude Code) Co-authored-by: Claude Opus 5 <[email protected]>
lfrancke
force-pushed
the
PHOENIX-5215-otel
branch
from
July 27, 2026 06:52
48dac8e to
584fc84
Compare
lfrancke
marked this pull request as ready for review
July 27, 2026 15:24
Member
Author
|
Yetus failed twice. The first one was real and I fixed the issues but the second one is no. I believe those test failures are unrelated and seem to happen on master as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Important
This builds upon #2394 which has stalled for four months now. The four commits from @xavifeds8 are taken as is and later commits build on top of those four.
Removes Apache HTrace from Phoenix and replaces it with a thin OpenTelemetry facade,
PhoenixTracing, adapted from HBase'sTraceUtil(HBASE-22120).Per the previous discussions on the mailing list and issue this doesn't depend on an opentelemetry SDK itself and instead relies on the one provided by HBase (2.5+).
HTrace is banned going forward by maven-enforcer.
References
Yes, this has been a long time coming :)
Changes on top of #2394
Rebase onto master:
PhoenixMapReduceUtil.addPhoenixDependencyJars, added to master after PHOENIX-5215 Migrate from HTrace to OpenTelemetry tracing #2394 was written, still shippedhtrace-coreto YARN containers.htrace-core4exclusions on the Hadoop dependencies. Hadoop 3.4.2 has no htrace, so they excluded nothing.Correctness:
opentelemetry.versionto 1.15.0. PHOENIX-5215 Migrate from HTrace to OpenTelemetry tracing #2394 used 1.49.0, but HBase 2.5.3, 2.5.10 and 2.6.1 ship 1.15.0 (2.5.14 and 2.6.3+ ship 1.49.0). Since the dependency isprovided, compiling against a newer API than the runtime supplies risksNoSuchMethodError. Depending on the older version should be safer.ScopeonPhoenixConnectionandTracingIterator. AScoperestores a thread-local and must be closed on the thread that opened it, but aConnectionis closed by an arbitrary thread (including the HA framework) and an iterator by whichever thread finishes with it.TraceUtilproperly in thePhoenixTracingjavadoc, and fixed javadoc placement on the deprecated tracing properties, which sat after@Deprecatedand so was not javadoc at all.Why are the changes needed?
Phoenix's tracing has been non-functional for years, so this removes a dead dependency (with vulnerabilities) and paves the way for a more modern OpenTelemetry pipeline integrated into the stuff HBase provides
Does this PR introduce any user-facing change?
Yes, though only to a feature that was already non-functional anyway (see above).
Removed: writing traces to an HBase table.
PhoenixMetricsSinkandTraceWriterare gone, soSYSTEM.TRACING_STATSis no longer written. The sink configuration inbin/hadoop-metrics2-phoenix.propertiesandbin/hadoop-metrics2-hbase.propertiesis retained but commented out, with a note pointing at the OpenTelemetry agent.SYSTEM.TRACING_STATSitself, the tracing webapp andbin/traceserver.pyare untouched, that is the scope of #1721.Changed:
TRACE ONis now inert. The SQL grammar is untouched and the hook remains, soTRACE ONandTRACE OFFstill parse and execute without error, but no Phoenix-side trace is started. Previously Phoenix owned a sampler and started its own root traces; under OpenTelemetry, sampling belongs to the SDK and the root span comes from whatever instrumented the caller. I decided to keep this PR to the removal of HTrace and replacing it with OTel. MakingTRACE ONuseful again can come in a follow-up.Deprecated: Phoenix tracing properties.
phoenix.trace.frequency,phoenix.trace.probability.threshold,phoenix.trace.enabled,phoenix.trace.batchSize,phoenix.trace.threadPoolSize,phoenix.trace.traceBufferSizeandphoenix.trace.read.pagesizeare marked@Deprecatedand no longer read. I'd also be happy to just remove them. Opinions welcome. OpenTelemetry is configured through the agent, for exampleOTEL_EXPORTER_OTLP_ENDPOINT.Unchanged: everything else. With no agent attached there is no behaviour change and no overhead.
How was this patch tested?
New
PhoenixTracingITcovers the no-op path with no SDK present,TRACE ON/TRACE OFFround-tripping, and that no thread is left pinned to a staleContextafter the connection closes.Locally, against the HBase 2.6 profile:
PhoenixTracingIT(3 tests) greenphoenix-pherfincluding its integration tests green.mvn spotless:checkclean across all modules.Packaging, verified by inspecting the built artifacts.
Was this patch authored or co-authored using generative AI tooling?
Yes. Partially
Generated-by: Claude Opus 5 (Claude Code)
The four commits by @xavifeds8 are preserved unchanged from #2394, no idea about those. The commits above them carry
Generated-by:andCo-authored-by:trailers individually, but even those are partially human authored. I've attempted this whole exercise already two or so years ago....and took some of what I had back then.Per the ASF Generative Tooling Guidance:
PhoenixTracingis adapted from HBase'sTraceUtil, which is Apache-2.0 and therefore compatible, and this derivation is stated in the class javadoc.