Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Add traces for kvs-get #5466

Merged
merged 6 commits into from
May 25, 2021
Merged

Add traces for kvs-get #5466

merged 6 commits into from
May 25, 2021

Conversation

anjor
Copy link
Contributor

@anjor anjor commented May 24, 2021

Goals (and why):
Improved visibility into kvs-get performance.

Implementation Description (bullets):
Added a few spans to CellLoader#loadWithTs.

Testing (What was existing testing like? What have you done to improve it?):

Concerns (what feedback would you like?):
A bit unsure about changes in TaskRunner

Where should we start reviewing?:

Priority (whenever / two weeks / yesterday):

@changelog-app
Copy link

changelog-app bot commented May 24, 2021

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Add traces for kvs-get

Goals (and why):
Improved visibility into kvs-get performance.

Implementation Description (bullets):
Added a few spans to CellLoader#loadWithTs.

Testing (What was existing testing like? What have you done to improve it?):

Concerns (what feedback would you like?):
A bit unsure about changes in TaskRunner

Where should we start reviewing?:

Priority (whenever / two weeks / yesterday):

Check the box to generate changelog(s)

  • Generate changelog entry

@anjor anjor changed the title Add traces for kvs-get [WIP] Add traces for kvs-get May 24, 2021
Anjor Kanekar added 2 commits May 24, 2021 16:04
Copy link
Contributor

@jeremyk-91 jeremyk-91 left a comment

Choose a reason for hiding this comment

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

Broadly looks good, we discussed the listening-executor changes.

I think you'll need changelogs and probably some formatting fixes (you can run ./gradlew spotlessApply to get the latter in place, usually).

This should give us a good start: I'd say the next step would be to start considering spans within the tasks, though fine with doing that separately/later depending on your capacity.

Map<InetSocketAddress, List<Cell>> hostsAndCells =
HostPartitioner.partitionByHost(clientPool, cells, Cell::getRowName);
Map<InetSocketAddress, List<Cell>> hostsAndCells;
try(CloseableTracer tracer = CloseableTracer.startSpan("partitionByHost")) {
Copy link
Contributor

@jeremyk-91 jeremyk-91 May 24, 2021

Choose a reason for hiding this comment

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

nit: checkstyle will probably want a space after

Also we should probably include a bit of metadata (the table ref, if it's safe, and cells.size(), maybe)?

@anjor anjor changed the title [WIP] Add traces for kvs-get Add traces for kvs-get May 24, 2021
Copy link
Contributor

@jeremyk-91 jeremyk-91 left a comment

Choose a reason for hiding this comment

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

Broadly looks good, I think there's one snag around the LoggingArgs

"cells",
String.valueOf(cells.size()),
"tableRef",
Objects.requireNonNull(LoggingArgs.tableRef(tableRef).getValue()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I was expecting something like safeInternalTableNameOrPlaceholder actually. If I'm not mistaken that would actually spit out the table's name regardless.

(Internally there's the assumption that table names in this KVS are safe, but still...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

for (Callable<V> task : tasks) {
futures.add(executor.submit(task));
DetachedSpan detachedSpan = DetachedSpan.start("task");
Copy link
Contributor

Choose a reason for hiding this comment

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

not actionable now: Yep, this is a reasonable first step. Later on we probably want a bit more information about what the tasks are doing (i.e. maybe change the method's signature or also allow users to provide a List where that has metadata about th task), but this would give us some useful signal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed

Copy link
Contributor

@jeremyk-91 jeremyk-91 left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@bulldozer-bot bulldozer-bot bot merged commit 3415dae into develop May 25, 2021
@bulldozer-bot bulldozer-bot bot deleted the anjor/add-tracing-for-kvs-get branch May 25, 2021 09:52
@svc-autorelease
Copy link
Collaborator

Released 0.340.2

@Sam-Kramer Sam-Kramer mentioned this pull request Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants