-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(replays): add replay_id uuid processors to config #5791
Changes from 2 commits
617b033
8d4ea69
f78aa52
01c197b
aec9df3
d8dca7c
01cad76
6d2764a
2da431b
899898a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,6 +157,7 @@ schema: | |
}, | ||
{ name: app_start_type, type: String }, | ||
{ name: profile_id, type: UUID, args: { schema_modifiers: [nullable] } }, | ||
{ name: replay_id, type: UUID, args: { schema_modifiers: [nullable] } }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this needed for transactions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you also need to add a replay_id column like this to discover.yaml? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because we want to query on this column which exists in the transactions dataset |
||
] | ||
local_table_name: transactions_local | ||
dist_table_name: transactions_dist | ||
|
@@ -202,7 +203,7 @@ query_processors: | |
trace.span_id: span_id | ||
- processor: UUIDColumnProcessor | ||
args: | ||
columns: [event_id, trace_id, profile_id] | ||
columns: [event_id, trace_id, profile_id, replay_id] | ||
- processor: HexIntColumnProcessor | ||
args: | ||
columns: [span_id] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from typing import Sequence | ||
|
||
from snuba.clickhouse.columns import UUID, Column | ||
from snuba.clusters.storage_sets import StorageSetKey | ||
from snuba.migrations import migration, operations | ||
from snuba.migrations.columns import MigrationModifiers as Modifiers | ||
from snuba.migrations.operations import OperationTarget | ||
|
||
|
||
class Migration(migration.ClickhouseNodeMigration): | ||
""" | ||
Add replay_id to merge table | ||
""" | ||
|
||
blocking = False | ||
|
||
def forwards_ops(self) -> Sequence[operations.SqlOperation]: | ||
return [ | ||
operations.AddColumn( | ||
storage_set=StorageSetKey.DISCOVER, | ||
table_name=table_name, | ||
column=Column("replay_id", UUID(Modifiers(nullable=True))), | ||
after="span_id", | ||
target=target, | ||
) | ||
for table_name, target in [ | ||
("discover_local", OperationTarget.LOCAL), | ||
("discover_dist", OperationTarget.DISTRIBUTED), | ||
] | ||
] | ||
|
||
def backwards_ops(self) -> Sequence[operations.SqlOperation]: | ||
return [ | ||
operations.DropColumn( | ||
storage_set=StorageSetKey.DISCOVER, | ||
table_name=table_name, | ||
column_name="replay_id", | ||
target=target, | ||
) | ||
for table_name, target in [ | ||
("discover_dist", OperationTarget.DISTRIBUTED), | ||
("discover_local", OperationTarget.LOCAL), | ||
] | ||
] | ||
|
||
def forwards_local(self) -> Sequence[operations.SqlOperation]: | ||
return self.forwards_ops() | ||
|
||
def backwards_local(self) -> Sequence[operations.SqlOperation]: | ||
return self.backwards_ops() | ||
|
||
def forwards_dist(self) -> Sequence[operations.SqlOperation]: | ||
return self.forwards_ops() | ||
|
||
def backwards_dist(self) -> Sequence[operations.SqlOperation]: | ||
return self.backwards_ops() |
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.
why are we adding trace_id? Isn't this pr a followup to the migration where you added replay_id?
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.
Do you also have to add a column to the entities/discover.yaml file?
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.
thanks for the catch, should have been replay_id