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(subscriptions): Adds metrics topics to topics validation #2326

Merged

Conversation

ahmedetefy
Copy link
Contributor

@ahmedetefy ahmedetefy commented Dec 22, 2021

Reverts #2313

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2021

Codecov Report

Merging #2326 (73fb598) into master (e41efa4) will decrease coverage by 0.06%.
The diff coverage is n/a.

❗ Current head 73fb598 differs from pull request most recent head d1d0a4b. Consider uploading reports for the commit d1d0a4b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2326      +/-   ##
==========================================
- Coverage   92.75%   92.68%   -0.07%     
==========================================
  Files         559      559              
  Lines       25736    25736              
==========================================
- Hits        23871    23854      -17     
- Misses       1865     1882      +17     
Impacted Files Coverage Δ
snuba/settings/validation.py 65.51% <ø> (ø)
snuba/settings/settings_distributed.py 0.00% <0.00%> (-100.00%) ⬇️
snuba/settings/settings_test_distributed.py 0.00% <0.00%> (-100.00%) ⬇️
snuba/optimize.py 83.72% <0.00%> (-6.98%) ⬇️
...ts/0010_groupedmessages_onpremise_compatibility.py 95.55% <0.00%> (-4.45%) ⬇️
...nsactions_onpremise_fix_orderby_and_partitionby.py 81.33% <0.00%> (-2.67%) ⬇️
snuba/migrations/table_engines.py 96.29% <0.00%> (-2.47%) ⬇️
tests/migrations/test_runner_individual.py 98.23% <0.00%> (-1.77%) ⬇️
snuba/clusters/cluster.py 93.16% <0.00%> (-1.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e41efa4...d1d0a4b. Read the comment docs.

@ahmedetefy ahmedetefy force-pushed the revert-2313-revert-2303-cra-metrics/validate_metrics_topics branch from ec5c538 to c3b5db7 Compare December 22, 2021 15:20
@ahmedetefy ahmedetefy changed the base branch from master to revert-2314-revert-2222-cra-metrics/add-subscription-consumer December 22, 2021 15:21
@ahmedetefy ahmedetefy force-pushed the revert-2314-revert-2222-cra-metrics/add-subscription-consumer branch from 7c3150b to d6cb024 Compare December 22, 2021 15:24
@ahmedetefy ahmedetefy force-pushed the revert-2313-revert-2303-cra-metrics/validate_metrics_topics branch from c3b5db7 to 1e1b276 Compare December 22, 2021 15:25
@ahmedetefy ahmedetefy marked this pull request as ready for review December 22, 2021 15:28
@ahmedetefy ahmedetefy requested a review from a team as a code owner December 22, 2021 15:28
@@ -36,6 +38,14 @@ def _validate_settings(locals: Mapping[str, Any]) -> None:
"transactions-subscription-results",
"sessions-subscription-results",
}
if settings.ENABLE_METRICS_SUBSCRIPTIONS:
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to check this setting here, you can just add it to the main topic_names dictionary. Putting it on this list doesn't really have any effect, just allows those topics to be configured via KAFKA_TOPIC_MAP and KAFKA_BROKER_CONFIG without erroring.

Copy link
Member

Choose a reason for hiding this comment

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

Fwiw I'm not sure why the original PR was reverted earlier - it should be harmless

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not entirely sure as well, but it seemed that the consumers kept restarting according to what @fpacifici told me until I reverted that PR so I assumed it must be that its checking for topic names that don't exist in prod somehow?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so. Can you link/paste the actual error message you were seeing to confirm?

AFAIK the issue the other day was actually to do with this PR https://github.com/getsentry/snuba/pull/2222/files

If you pass a commit log topic to the consumer like that does it will automatically start publishing offsets to that topic. Is it possible the metrics commit log didn't exist in prod yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lynnagara Do you reckon I should try to deploy this without the feature flag check since these are not production consumers?

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/getsentry/snuba/blob/master/snuba/settings/validation.py#L40-L46
These are the only lines where topic_names is used.. you can see there is no need for the actual topics to exist.

Copy link
Member

Choose a reason for hiding this comment

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

Let's confirm what happened last week. I don't think we should be putting feature flags around everything "just in case"

@lynnagara
Copy link
Member

Nit: This PR is not actually a revert of 2313 right now since you have changed stuff so I would not describe it as such.

@ahmedetefy ahmedetefy force-pushed the revert-2314-revert-2222-cra-metrics/add-subscription-consumer branch from d6cb024 to 6fec959 Compare December 22, 2021 21:40
@lynnagara
Copy link
Member

@ahmedetefy This PR has changed quite a lot since earlier reviewed. Is there a reason it now does a lot more than changing the validation.py file?

@lynnagara
Copy link
Member

Also how come it's not based on master?

@ahmedetefy
Copy link
Contributor Author

@lynnagara Yeah it just needed to be rebased

@ahmedetefy ahmedetefy changed the base branch from revert-2314-revert-2222-cra-metrics/add-subscription-consumer to master December 23, 2021 09:58
@ahmedetefy ahmedetefy force-pushed the revert-2313-revert-2303-cra-metrics/validate_metrics_topics branch from a4b4dd8 to b82e523 Compare December 23, 2021 09:59
Copy link
Contributor

@fpacifici fpacifici left a comment

Choose a reason for hiding this comment

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

Are these topics present in production now ?

@oioki
Copy link
Member

oioki commented Jan 10, 2022

Are these topics present in production now ?

They have been created:
https://getsentry.atlassian.net/browse/OPS-1258?focusedCommentId=38881

Copy link
Contributor

@fpacifici fpacifici left a comment

Choose a reason for hiding this comment

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

Please only deploy this change with the supervision of somebody in Searh and Storage.

@ahmedetefy ahmedetefy merged commit 5b7f1ce into master Jan 11, 2022
@ahmedetefy ahmedetefy deleted the revert-2313-revert-2303-cra-metrics/validate_metrics_topics branch January 11, 2022 15:53
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.

5 participants