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

tempo-cli: add vp4 support to analyse blocks sub command #3868

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* [ENHANCEMENT] Self document makefile [#3844](https://github.com/grafana/tempo/pull/3844) (@javiermolinar)
* [ENHANCEMENT] Added a Tempo CLI command to drop traces by id by rewriting blocks. [#3856](https://github.com/grafana/tempo/pull/3856) (@joe-elliott)
* [ENHANCEMENT] Mixin, make recording rule range interval configurable and increase range interval in alert to support scrape interval of 1 minute [#3851](https://github.com/grafana/tempo/pull/3851) (@jmichalek132)
* [ENHANCEMENT] Add vParquet4 support to the tempo-cli analyse blocks command [#3868](https://github.com/grafana/tempo/pull/3868) (@stoewer)
* [BUGFIX] Fix panic in certain metrics queries using `rate()` with `by` [#3847](https://github.com/grafana/tempo/pull/3847) (@stoewer)
* [BUGFIX] Fix metrics queries when grouping by attributes that may not exist [#3734](https://github.com/grafana/tempo/pull/3734) (@mdisibio)
* [BUGFIX] Fix frontend parsing error on cached responses [#3759](https://github.com/grafana/tempo/pull/3759) (@mdisibio)
Expand Down
27 changes: 20 additions & 7 deletions cmd/tempo-cli/cmd-analyse-block.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ import (
"text/tabwriter"
"time"

tempo_io "github.com/grafana/tempo/pkg/io"
"github.com/dustin/go-humanize"
"github.com/google/uuid"
"github.com/parquet-go/parquet-go"

pq "github.com/grafana/tempo/pkg/parquetquery"
"github.com/stoewer/parquet-cli/pkg/inspect"

tempo_io "github.com/grafana/tempo/pkg/io"
pq "github.com/grafana/tempo/pkg/parquetquery"
"github.com/grafana/tempo/tempodb/backend"
"github.com/grafana/tempo/tempodb/encoding/vparquet2"
"github.com/grafana/tempo/tempodb/encoding/vparquet3"

"github.com/dustin/go-humanize"
"github.com/google/uuid"
"github.com/grafana/tempo/tempodb/backend"
"github.com/grafana/tempo/tempodb/encoding/vparquet4"
)

var (
Expand All @@ -38,6 +37,12 @@ var (
vparquet3ResourceAttrs = []string{
vparquet3.FieldResourceAttrVal,
}
vparquet4SpanAttrs = []string{
vparquet4.FieldSpanAttrVal,
}
vparquet4ResourceAttrs = []string{
vparquet4.FieldResourceAttrVal,
}
)

func spanPathsForVersion(v string) (string, []string) {
Expand All @@ -46,6 +51,8 @@ func spanPathsForVersion(v string) (string, []string) {
return vparquet2.FieldSpanAttrKey, vparquet2SpanAttrs
case vparquet3.VersionString:
return vparquet3.FieldSpanAttrKey, vparquet3SpanAttrs
case vparquet4.VersionString:
return vparquet4.FieldSpanAttrKey, vparquet4SpanAttrs
}
return "", nil
}
Expand All @@ -56,6 +63,8 @@ func resourcePathsForVersion(v string) (string, []string) {
return vparquet2.FieldResourceAttrKey, vparquet2ResourceAttrs
case vparquet3.VersionString:
return vparquet3.FieldResourceAttrKey, vparquet3ResourceAttrs
case vparquet4.VersionString:
return vparquet4.FieldResourceAttrKey, vparquet4ResourceAttrs
}
return "", nil
}
Expand All @@ -64,6 +73,8 @@ func dedicatedColPathForVersion(i int, scope backend.DedicatedColumnScope, v str
switch v {
case vparquet3.VersionString:
return vparquet3.DedicatedResourceColumnPaths[scope][backend.DedicatedColumnTypeString][i]
case vparquet4.VersionString:
return vparquet4.DedicatedResourceColumnPaths[scope][backend.DedicatedColumnTypeString][i]
}
return ""
}
Expand Down Expand Up @@ -123,6 +134,8 @@ func processBlock(r backend.Reader, tenantID, blockID string, maxStartTime, minS
reader = vparquet2.NewBackendReaderAt(context.Background(), r, vparquet2.DataFileName, meta)
case vparquet3.VersionString:
reader = vparquet3.NewBackendReaderAt(context.Background(), r, vparquet3.DataFileName, meta)
case vparquet4.VersionString:
reader = vparquet4.NewBackendReaderAt(context.Background(), r, vparquet4.DataFileName, meta)
default:
fmt.Println("Unsupported block version:", meta.Version)
return nil, nil
Expand Down
Loading