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

Add two new commands to dump and summarize a block index #611

Merged
merged 2 commits into from Mar 25, 2021

Conversation

mdisibio
Copy link
Contributor

@mdisibio mdisibio commented Mar 24, 2021

What this PR does:
This PR adds two new commands that may be helpful for analysis:

list index Displays count/smallest/largest index entries for the block
Example:

$ ./tempo-cli -c ~/tempo.gcs.yaml list index 1 eb9097da-ce9b-4c79-a95e-2544e47eb600
Index entries: 85565
Min record: ID:000000000000000000f98dff14b6d9d8 Start:376637542 Length:88266
Max record: ID:00000000000000003ac4feb1e33cb8be Start:8797836709 Length:16873958

view index Dumps index entries to stdout with pauses for enter key
Example:

$ ./tempo-cli -c ~/tempo.gcs.yaml view index 1 8007402d-e2bf-4867-885b-56667d1a21bb
.
.
.
Index entry:      27694     ID: 0000000000000000091531809b380fca     Start: 3681618906     Length:     131629
Index entry:      27695     ID: 000000000000000009154701495d4bcc     Start: 3681750535     Length:     143781
Index entry:      27696     ID: 0000000000000000091557765faccdba     Start: 3681894316     Length:     135249
Index entry:      27697     ID: 000000000000000009156dc402f1a74a     Start: 3682029565     Length:     130927
Index entry:      27698     ID: 00000000000000000915821eebbb210c     Start: 3682160492     Length:     138300
Index entry:      27699     ID: 0000000000000000091594c70025a539     Start: 3682298792     Length:     132232
Press enter to continue

Which issue(s) this PR fixes:
n/a

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@annanay25
Copy link
Contributor

I like the command naming and functionality. Also as for exposing a function from the encoding package, I think we should be OK as long as we're using that just for the CLI and not in other packages.

@mdisibio mdisibio changed the title WIP: Add two new commands to dump and summarize a block index Add two new commands to dump and summarize a block index Mar 25, 2021
@mdisibio mdisibio merged commit eb85bb3 into grafana:master Mar 25, 2021
@mdisibio mdisibio deleted the tempo-cli-index-cmds branch May 27, 2021 13:27
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.

None yet

2 participants