Skip to content

feat(CapMan): More tenant_ids for TSDB Queries - #45274

Merged
rahul-kumar-saini merged 4 commits into
masterfrom
rahul/feat/more_tsdb_tenant_ids
Mar 2, 2023
Merged

feat(CapMan): More tenant_ids for TSDB Queries#45274
rahul-kumar-saini merged 4 commits into
masterfrom
rahul/feat/more_tsdb_tenant_ids

Conversation

@rahul-kumar-saini

Copy link
Copy Markdown
Contributor

Overview

  • Added organization_id to more Snuba Requests, specifically targeting tsdb-modelid:4 queries as they are the biggest chunk of queries Snuba is handling in production
  • Most calls to tsdb.get_range handled as well, some I wasn't able to figure out
  • More context: feat(CapMan): Pass tenant_ids to Snuba #44788

@github-actionsgithub-actionsBot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 1, 2023
except Environment.DoesNotExist:
stats = {g.id: tsdb.make_series(0, **query_params) for g in groups}
else:
org_id = groups[0].project.organization_id if groups else None

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Assumes all groups in the list belong to a single org, let me know if this assumption is incorrect.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that assumption seems correct. is groups guaranteed to have at least one element though?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah right, if groups will evaluate to False if it is empty.

@rahul-kumar-saini
rahul-kumar-saini marked this pull request as ready for review March 1, 2023 23:03
@rahul-kumar-saini
rahul-kumar-saini requested review from a teamMarch 1, 2023 23:03
@rahul-kumar-saini
rahul-kumar-saini requested a review from a team as a code ownerMarch 1, 2023 23:03

@JoshFergeJoshFerge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

all look good to me except for group_stream.

except Environment.DoesNotExist:
stats = {g.id: tsdb.make_series(0, **query_params) for g in groups}
else:
org_id = groups[0].project.organization_id if groups else None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that assumption seems correct. is groups guaranteed to have at least one element though?

@rahul-kumar-saini
rahul-kumar-saini merged commit 95bafd2 into masterMar 2, 2023
@rahul-kumar-saini
rahul-kumar-saini deleted the rahul/feat/more_tsdb_tenant_ids branch March 2, 2023 18:31
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Mar 18, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: BackendAutomatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rahul-kumar-saini@JoshFerge