Skip to content

Comments

state store: getStream: log stream info#2758

Merged
hsaputra merged 2 commits intoapache:masterfrom
mauricebarnum:log-stream-name
Aug 18, 2021
Merged

state store: getStream: log stream info#2758
hsaputra merged 2 commits intoapache:masterfrom
mauricebarnum:log-stream-name

Conversation

@mauricebarnum
Copy link
Contributor

log the the tuple (namespace id, stream id, stream name) in RootStorageService getRange request.

Motivation

Server request metrics are labeled with the stream id, extracted from the routing header. The stream name
(aka "table name") is not available but more useful. Rather than making a (cacheable) RPC request to fetch
the id -> name mapping in the metrics, logging the information allows one to find the name without requiring
admin access to the state store service.


In order to uphold a high standard for quality for code contributions, Apache BookKeeper runs various precommit
checks for pull requests. A pull request can only be merged when it passes precommit checks.


Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

If this PR is a BookKeeper Proposal (BP):

  • Make sure the PR title is formatted like:
    <BP-#>: Description of bookkeeper proposal
    e.g. BP-1: 64 bits ledger is support
  • Attach the master issue link in the description of this PR.
  • Attach the google doc link if the BP is written in Google Doc.

Otherwise:

  • Make sure the PR title is formatted like:
    <Issue #>: Description of pull request
    e.g. Issue 123: Description ...
  • Make sure tests pass via mvn clean apache-rat:check install spotbugs:check.
  • Replace <Issue #> in the title with the actual Issue number.

final StreamProperties p = StreamProperties.parseFrom(streamPropBytes);
logger.info("namespace_id={} stream_id={} storage_container_id={} stream_name={} ",
nsId, p.getStreamId(), p.getStorageContainerId(), p.getStreamName());
return FutureUtils.value(p);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should do this only when we create/delete/modify streams. Also some context in the log will be useful. eg "Created Stream" etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved logging to create and delete. add result of operation. since i'm only logging the (ns, id, name) tuple, i didn't add a log to modify for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we have the log in create/delete, we should remove the log from here. This will create a unnecessary noise in logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops. that was supposed to get removed. rebased.

@mauricebarnum mauricebarnum force-pushed the log-stream-name branch 2 times, most recently from 08a6ee2 to 85dc033 Compare August 4, 2021 22:01
logging (namespace id, stream id, stream name) tuple makes it easier to
interpret the logs and stats expressed in terms of stream id.  including
the stream name in the stats would require a (cacheable) lookup in the
root range store at runtime.
Copy link
Contributor

@hsaputra hsaputra left a comment

Choose a reason for hiding this comment

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

LGTM +1

@hsaputra
Copy link
Contributor

rerun failure checks

@hsaputra
Copy link
Contributor

Will merge this by tomorrow if no more question or concern. Thanks

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@hsaputra hsaputra added this to the 4.15.0 milestone Aug 18, 2021
@hsaputra hsaputra merged commit cde0502 into apache:master Aug 18, 2021
@mauricebarnum mauricebarnum deleted the log-stream-name branch December 7, 2021 20:55
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
log the the tuple (namespace id, stream id, stream name) in RootStorageService getRange request.

### Motivation

Server request metrics are labeled with the stream id, extracted from the routing header.  The stream name
(aka "table name") is not available but more useful.  Rather than making a (cacheable) RPC request to fetch
the id -> name mapping in the metrics, logging the information allows one to find the name without requiring
admin access to the state store service.



Reviewers: Ivan Kelly <ivank@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, Henry Saputra <hsaputra@apache.org>

This closes apache#2758 from mauricebarnum/log-stream-name and squashes the following commits:

4ef7ac0 [Maurice Barnum] cleanup: remove extraneous "final" declarations
284b643 [Maurice Barnum] state store: create and delete stream: log stream info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants