Skip to content
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(inc-984): Cleanup EAP spans #6676

Merged
merged 8 commits into from
Dec 16, 2024
Merged

feat(inc-984): Cleanup EAP spans #6676

merged 8 commits into from
Dec 16, 2024

Conversation

xurui-c
Copy link
Member

@xurui-c xurui-c commented Dec 13, 2024

doing #6673

differences:

  • changed the UPDATE query
  • changed the StorageSetKey
  • Added test_span_is_scrubbed

Rachel Chen added 2 commits December 13, 2024 15:00
@xurui-c xurui-c marked this pull request as ready for review December 14, 2024 00:35
@xurui-c xurui-c requested review from a team as code owners December 14, 2024 00:35
@xurui-c xurui-c force-pushed the rachel/volobranch branch 3 times, most recently from ddd1acf to b44316a Compare December 14, 2024 02:40
on_cluster = f"ON CLUSTER '{cluster_name}'" if cluster_name else ""
return f"""ALTER TABLE eap_spans_2_local
{on_cluster}
UPDATE `attr_str_1` = mapApply((k, v) -> (k, if(k = 'user.ip', 'scrubbed', v)), `attr_str_1`)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added the col name attr_str_1 in the end because https://clickhouse.com/docs/en/sql-reference/functions/tuple-map-functions#mapapply

@xurui-c xurui-c changed the title c feat(inc-984): Cleanup EAP spans Dec 14, 2024

@pytest.mark.clickhouse_db
@pytest.mark.redis_db
def test_span_is_scrubbed() -> None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the extra test i added

@getsentry getsentry deleted a comment from codecov bot Dec 15, 2024
Copy link

codecov bot commented Dec 15, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1171 1 1170 3
View the top 1 failed tests by shortest run time
tests.manual_jobs.test_scrub_ips_from_eap_spans::test_generate_query
Stack Traces | 0.009s run time
Traceback (most recent call last):
  File ".../tests/manual_jobs/test_scrub_ips_from_eap_spans.py", line 110, in test_generate_query
    assert (
AssertionError: assert ('ALTER TABLE eap_spans_2_local\n'\n '\n'\n "UPDATE `attr_str_1` = mapApply((k, v) -> (k, if(k = 'user.ip', 'scrubbed', "\n 'v)), `attr_str_1`)\n'\n 'WHERE organization_id IN [1,3,5,6]\n'\n "AND _sort_timestamp >= toDateTime('2024-12-01T00:00:00')\n"\n "AND _sort_timestamp < toDateTime('2024-12-10T00:00:00')") == ('ALTER TABLE eap_spans_2_local\n'\n '\n'\n "UPDATE `attr_str_1` = mapApply((k, v) -> (k, if(k = 'user.ip', 'scrubbed', "\n 'v)), `attr_str_1`)\n'\n 'WHERE organization_id IN [1,3,5,6]\n'\n "AND _sort_timestamp > toDateTime('2024-12-01T00:00:00')\n"\n "AND _sort_timestamp <= toDateTime('2024-12-10T00:00:00')")
    ALTER TABLE eap_spans_2_local
    
    UPDATE `attr_str_1` = mapApply((k, v) -> (k, if(k = 'user.ip', 'scrubbed', v)), `attr_str_1`)
    WHERE organization_id IN [1,3,5,6]
  - AND _sort_timestamp > toDateTime('2024-12-01T00:00:00')
  + AND _sort_timestamp >= toDateTime('2024-12-01T00:00:00')
  ?                      +
  - AND _sort_timestamp <= toDateTime('2024-12-10T00:00:00')
  ?                      -
  + AND _sort_timestamp < toDateTime('2024-12-10T00:00:00')

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@xurui-c xurui-c requested a review from volokluev December 16, 2024 17:30
@xurui-c xurui-c force-pushed the rachel/volobranch branch 2 times, most recently from 933137b to 3f5df8e Compare December 16, 2024 18:18
@xurui-c xurui-c requested a review from volokluev December 16, 2024 21:41
Copy link
Member

@volokluev volokluev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the print statement and we're good

snuba/web/db_query.py Outdated Show resolved Hide resolved
@xurui-c xurui-c enabled auto-merge (squash) December 16, 2024 21:54
@xurui-c xurui-c merged commit 92f8db3 into master Dec 16, 2024
30 of 31 checks passed
@xurui-c xurui-c deleted the rachel/volobranch branch December 16, 2024 22:19
Copy link

sentry-io bot commented Dec 17, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ KeyError: 'organization_ids' execute_job View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants