-
Notifications
You must be signed in to change notification settings - Fork 444
chore(tracer): add abstract base class for AgentWriterInterface #13876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Preparing the code for a future where we have multiple implementations of the AgentWriter
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 290 ± 10 ms. The average import time from base is: 278 ± 3 ms. The import time difference between this PR and base is: 14.9 ± 0.5 ms. Import time breakdownThe following import paths have grown:
|
BenchmarksBenchmark execution time: 2025-07-03 20:14:29 Comparing candidate commit b7c2c69 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 478 metrics, 3 unstable metrics. scenario:telemetryaddmetric-1-distribution-metric-1-times
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if isinstance(self._span_aggregator.writer, HTTPWriter): | ||
# For AgentWriterInterface, we can return the intake_url directly | ||
return self._span_aggregator.writer.intake_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also support AgentWriterInterface instances which are not HTTPWritter ?
if isinstance(self._span_aggregator.writer, HTTPWriter): | |
# For AgentWriterInterface, we can return the intake_url directly | |
return self._span_aggregator.writer.intake_url | |
if isinstance(self._span_aggregator.writer, HTTPWriter) or isinstance(self._span_aggregator.writer, AgentWriterInterface): | |
# For AgentWriterInterface, we can return the intake_url directly | |
return self._span_aggregator.writer.intake_url |
Preparing the code for a future where we have multiple implementations of the AgentWriter.
I grabbed some minor adjacent type hinting stuff as well.
Split from #13071
We expect no major changes from this change. The only interesting change is the
agent_url
->intake_url
change which this is an internal/private class.Checklist
Reviewer Checklist