Skip to content

server: rationalize tenant TestServers metrics registration#97884

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
andreimatei:metrics.demo-no-parent-recorder
Mar 2, 2023
Merged

server: rationalize tenant TestServers metrics registration#97884
craig[bot] merged 2 commits intocockroachdb:masterfrom
andreimatei:metrics.demo-no-parent-recorder

Conversation

@andreimatei
Copy link
Copy Markdown
Contributor

@andreimatei andreimatei commented Mar 1, 2023

This patch makes tenant test servers started with StartTenant (as
opposed to StartSharedProcessTenant) not register their metrics in the
parent TestServer's MetricRecorder. I believe the fact that they were
previously registering themselves to have been a mistake. To better
simulate out-of-process tenants, we should not have references like this
from a TestServer to the "out-of-process" tenants.
StartSharedProcessTenants tenants continue to be registered with the
parent Server.

Background: when a tenant registers with a parent recorder, the tenant's
metrics are reported on _status/vars. Note that these tenant metrics are
not currently written to TSDB, although work on that is happening
elsewhere.

I believe the only practical thing that this patch affects is
cockroach demo --multitenant=true --disable-server-controller=true
(which is not the default). Before, regardless of
--disable-server-controller, the tenant's metrics were reported on the
system's status/vars. Now, they're no longer reported there with
--disable-server-controller=true - which I believe is a good
thing because it more accurately represents reality with out-of-process
tenants (I don't know if --disable-server-controller=true deserves to
exist at all, btw).

Release note: None
Epic: None

This patch makes tenant test servers started with StartTenant (as
opposed to StartSharedProcessTenant) not register their metrics in the
parent TestServer's MetricRecorder. I believe the fact that they were
previously registering themselves to have been a mistake. To better
simulate out-of-process tenants, we should not have references like this
from a TestServer to the "out-of-process" tenants.
StartSharedProcessTenants tenants continue to be registered with the
parent Server.

Background: when a tenant registers with a parent recorder, the tenant's
metrics are reported on _status/vars. Note that these tenant metrics are
not currently written to TSDB, although work on that is happening
elsewhere.

I believe the only practical thing that this patch affects is
`cockroach demo --multitenant=true --disable-server-controller=true`
(which is not the default). Before, regardless of
`--disable-server-controller`, the tenant's metrics were reported on the
system's status/vars. Now, they're no longer reported there with
`--disable-server-controller=true` - which I believe is a good
thing because it more accurately represents reality with out-of-process
tenants (I don't know if --disable-server-controller=true deserves to
exist at all, btw).

Release note: None
Release note: None
@andreimatei andreimatei requested review from a team as code owners March 1, 2023 22:45
@andreimatei andreimatei requested a review from a team March 1, 2023 22:45
@andreimatei andreimatei requested review from a team as code owners March 1, 2023 22:45
@andreimatei andreimatei requested review from herkolategan and smg260 and removed request for a team March 1, 2023 22:45
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@andreimatei andreimatei requested review from a team and renatolabs and removed request for a team, herkolategan, renatolabs and smg260 March 1, 2023 22:45
Copy link
Copy Markdown
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

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

:lgtm: agree this was a mistake. thx for fixing.

Reviewed 3 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aadityasondhi and @abarganier)

@andreimatei
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 2, 2023

Build succeeded:

@craig craig bot merged commit 810808c into cockroachdb:master Mar 2, 2023
@andreimatei andreimatei deleted the metrics.demo-no-parent-recorder branch March 13, 2023 21:19
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