forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jobsprofiler: introduce collection of job bundles
Similar to statement bundles this change introduces the infrastructure to collect and read job profiler bundles. Right now, a job profiler bundle will only contain the latest DSP diagram for a job, but going forward this will give us a place to dump raw files such as: - cluster-wide job traces - cpu profiles - trace-driven aggregated stats - raw payload and progress protos Downloading this bundle will be exposed in a future patch in all of the places where statement bundles are today: - DBConsole - CLI shell - SQL shell This change introduces a builtin that constructs and writes the bundle for a job to the system.job_info table. It also introduces a new endpoint on the status server to read this constructed bundle. The next set of PRs will add the necessary components to allow downloading the bundle from the DBConsole. Informs: cockroachdb#105076 Release note: None
- Loading branch information
1 parent
b539561
commit ec46b6b
Showing
18 changed files
with
642 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") | ||
|
||
proto_library( | ||
name = "profilerpb_proto", | ||
srcs = ["profiler.proto"], | ||
strip_import_prefix = "/pkg", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@com_github_gogo_protobuf//gogoproto:gogo_proto", | ||
"@com_google_protobuf//:timestamp_proto", | ||
], | ||
) | ||
|
||
go_proto_library( | ||
name = "profilerpb_go_proto", | ||
compilers = ["//pkg/cmd/protoc-gen-gogoroach:protoc-gen-gogoroach_compiler"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobsprofiler/profilerpb", | ||
proto = ":profilerpb_proto", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/util/uuid", # keep | ||
"@com_github_gogo_protobuf//gogoproto", | ||
], | ||
) | ||
|
||
go_library( | ||
name = "profilerpb", | ||
embed = [":profilerpb_go_proto"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobsprofiler/profilerpb", | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
syntax = "proto3"; | ||
package cockroach.jobs.jobsprofiler.profilerpb; | ||
option go_package = "github.com/cockroachdb/cockroach/pkg/jobs/jobsprofiler/profilerpb"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
message ProfilerBundleMetadata { | ||
bytes bundle_id = 1 [ | ||
(gogoproto.customname) = "BundleID", | ||
(gogoproto.customtype) = "github.com/cockroachdb/cockroach/pkg/util/uuid.UUID", | ||
(gogoproto.nullable) = false | ||
]; | ||
int32 num_chunks = 2; | ||
google.protobuf.Timestamp collected_at = 3 | ||
[ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.