-
Notifications
You must be signed in to change notification settings - Fork 523
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
tempo-cli: add support for /api/v2/traces endpoint #4127
Conversation
@@ -94,7 +94,7 @@ func main() { | |||
ctx := kong.Parse(&cli, | |||
kong.UsageOnError(), | |||
kong.ConfigureHelp(kong.HelpOptions{ | |||
// Compact: true, | |||
Compact: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea why this was commented out, so enabled it again.
I personally find the Compact form easy to read and parse out at a glance.
here is the difference in the help output.
with Compact: true
Usage: tempo-cli-arm64 <command>
Flags:
-h, --help Show context-sensitive help.
-c, --config-file=STRING Path to tempo config file
Commands:
list block List information about a block
list blocks List information about all blocks in a bucket
list compaction-summary List summary of data by compaction level
list cache-summary List summary of bloom sizes per day per
compaction level
list index List information about a block index
list column List values in a given column
analyse block Analyse block in a bucket
analyse blocks Analyse blocks in a bucket
view index View contents of block index
view schema View parquet schema
gen index Generate index for a block
gen bloom Generate bloom for a block
query api trace-id query Tempo by trace ID
query api search-tags query Tempo search tags
query api search-tag-values query Tempo search tag values
query api search query Tempo search
query api metrics query Tempo metrics query range
query trace-id query for a traceid directly from backend
blocks
query trace-summary query summary for a traceid directly from
backend blocks
query search search for a traceid directly from backend
blocks
rewrite-blocks drop-trace rewrite blocks with a given trace id redacted
parquet convert-2-to-3 convert an existing vParquet2 file to vParquet3
block
parquet convert-3-to-4 convert an existing vParquet3 file to vParquet4
block
migrate tenant migrate tenant between two backends
migrate overrides-config migrate overrides config
Run "tempo-cli-arm64 <command> --help" for more information on a command.
without Compact: true
Usage: tempo-cli-arm64 <command>
Flags:
-h, --help Show context-sensitive help.
-c, --config-file=STRING Path to tempo config file
Commands:
list block <tenant-id> <block-id>
List information about a block
list blocks <tenant-id>
List information about all blocks in a bucket
list compaction-summary <tenant-id>
List summary of data by compaction level
list cache-summary <tenant-id>
List summary of bloom sizes per day per compaction level
list index <tenant-id> <block-id>
List information about a block index
list column <tenant-id> <block-id> <column>
List values in a given column
analyse block <tenant-id> <block-id>
Analyse block in a bucket
analyse blocks <tenant-id>
Analyse blocks in a bucket
view index <tenant-id> <block-id>
View contents of block index
view schema <tenant-id> <block-id>
View parquet schema
gen index <tenant-id> <block-id>
Generate index for a block
gen bloom <tenant-id> <block-id> <bloom-fp> <bloom-shard-size>
Generate bloom for a block
query api trace-id <api-endpoint> <trace-id>
query Tempo by trace ID
query api search-tags <host-port> [<start> [<end>]]
query Tempo search tags
query api search-tag-values <host-port> <tag> [<start> [<end>]]
query Tempo search tag values
query api search <host-port> [<trace-ql> [<start> [<end>]]]
query Tempo search
query api metrics <host-port> [<trace-ql> [<start> [<end>]]]
query Tempo metrics query range
query trace-id <trace-id> <tenant-id>
query for a traceid directly from backend blocks
query trace-summary <trace-id> <tenant-id>
query summary for a traceid directly from backend blocks
query search <name> <value> <start> <end> <tenant-id>
search for a traceid directly from backend blocks
rewrite-blocks drop-trace <trace-id> <tenant-id>
rewrite blocks with a given trace id redacted
parquet convert-2-to-3 <in> [<out> [<dedicated-columns> ...]]
convert an existing vParquet2 file to vParquet3 block
parquet convert-3-to-4 <in> [<out> [<dedicated-columns> ...]]
convert an existing vParquet3 file to vParquet4 block
migrate tenant --source-config-file=STRING <source-tenant-id> <dest-tenant-id>
migrate tenant between two backends
migrate overrides-config <config-file>
migrate overrides config
Run "tempo-cli-arm64 <command> --help" for more information on a command.
Should we just make v2 default? and require a flag to use v1? We could list it as a breaking change if we feel it needs to be. |
we can yes, I left will flip the flag to be |
b8a2194
to
e845feb
Compare
e845feb
to
f3e704d
Compare
updated, @joe-elliott v1 is behind flag, and v2 is now default. |
f7d6082
to
b70fa15
Compare
'encoding/json' package can't handle +Inf, -Inf, NaN values and will fail to Marshal the response from tracebyid endpoints if response has keys with values of +Inf, -Inf or NaN. gogo/protobuf/jsonpb package correctly handles these values so use that to Marshal and print the response to stdout
b70fa15
to
b23864b
Compare
What this PR does:
Use
/api/v2/traces
by default to query trace by id and get partial traces for bigger traces, also add--v1
flag intempo-cli query api trace-id
command to query/api/traces
endpoint.see #3941 for more details on
/api/v2/traces
.example usage:
tempo-cli query api trace-id http://tempo:3200 fd9b20c52c74f67de6a69279bfba3936 --v1 > trace.json
there is a change in default behaviour and you need to use
--v1
if you are on a older version of tempo that doesn't support/api/v2/traces
or want to use/api/traces
, because of that, this change is marked as BREAKING CHANGEThis PR also includes a small change in the way we Marshal the trace.
encoding/json
package can't handle +Inf, -Inf, NaN values and will fail to Marshal the response from tracebyid endpoints if response has keys with values of +Inf, -Inf or NaN.gogo/protobuf/jsonpb
package correctly handles these values so use that to Marshal and print the response to stdoutChecklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]