-
Notifications
You must be signed in to change notification settings - Fork 173
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
chore (sync service): remove redundant spans #2037
Conversation
I wouldn't call those spans redundant because they cover code executed in different processes. My original idea with these was to have a way to tell if there's any significant delay between receiving a transaction in the replication client process and storing it in shape log collectors. Given our architecture of running a separate log collector for each shape, a single transaction may be stored N times and the time profile of that could like like N parallel child spans or a waterfall of N spans. What I mean is that looking at a trace could lend us insights into potential inefficiencies in the transaction processing architecture. I haven't spent much time testing this, though. If removing those spans still maintains a hierarchical relation between the root |
Nevermind my above comment. I've double-checked that the |
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.
👍
@balegas |
I don't think #2054 does what I'm asking, but you can clear it out to me. In #2054 you're defining a sampling strategy for root spans, which will apply for descendant spans. Which means that if we sample I think |
Sure, we can do that in a separate PR |
Part of #2032.
I removed 2 spans that seem redundant:
shape_write.log_collector.handle_txn
: this span wraps thehandle_transaction
function. However, there is already a spanpg_txn.replication_client.transaction_received
that in fact calls intohandle_transaction
.shape_write.log_collector.handle_relation
: this span wraps the handling of relation messages. Similarly to transactions, there is apg_txn.replication_client.relation_received
span that ends up calling into thehandle_relation
function.Here are the relevant code snippets:
Electric.Postgres.ReplicationClient
:The call to
apply
is a chain of calls that eventually ends up callinghandle_transaction
(and does nothing more):Electric.StackSupervisor
:Electric.Replication.ShapeLogCollector.ex
:Question
I removed the spans from
Electric.Replication.ShapeLogCollector
, another option would be to remove the spans fromElectric.Postgres.ReplicationClient
, any preference here?