Skip to content

Commit 5a2241b

Browse files
committed
Adding perses
1 parent d54c37e commit 5a2241b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1726
-11
lines changed

BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")
44
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
55
load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
6+
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
67
load("@otel_sdk//bazel:otel_cc.bzl", "otel_cc_binary", "otel_cc_import", "otel_cc_library", "otel_cc_shared_library", "otel_cc_test")
78
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files", pkg_strip_prefix = "strip_prefix")
89
load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
@@ -466,6 +467,16 @@ write_source_file(
466467
"windows",
467468
]]
468469

470+
native_binary(
471+
name = "perses",
472+
src = "@multitool//tools/perses",
473+
)
474+
475+
native_binary(
476+
name = "percli",
477+
src = "@multitool//tools/percli",
478+
)
479+
469480
platform(
470481
name = "x64_windows-clang-cl",
471482
constraint_values = [

multitool.lock.json

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,111 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/theoremlp/rules_multitool/main/lockfile.schema.json",
3+
"percli": {
4+
"binaries": [
5+
{
6+
"kind": "archive",
7+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_linux_amd64.tar.gz",
8+
"file": "percli",
9+
"sha256": "5b8e332c3796ac1bec73aa8ebf368c065f706e6b1b250d72c457bd37a89c65f6",
10+
"os": "linux",
11+
"cpu": "x86_64"
12+
},
13+
{
14+
"kind": "archive",
15+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_darwin_arm64.tar.gz",
16+
"file": "percli",
17+
"sha256": "59dda6d76e2583aacb13f2612b2315e2b303f1d6c8abdd2ed074b7a87c77e180",
18+
"os": "macos",
19+
"cpu": "arm64"
20+
},
21+
{
22+
"kind": "archive",
23+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_darwin_amd64.tar.gz",
24+
"file": "percli",
25+
"sha256": "2fc4b16b545ae88534e446fd7b14f78a9f3f4d0e3ff84661f71e9fe006daf43b",
26+
"os": "macos",
27+
"cpu": "x86_64"
28+
},
29+
{
30+
"kind": "archive",
31+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_windows_amd64.tar.gz",
32+
"file": "percli.exe",
33+
"sha256": "de01b266d035275443cbdbbc7dc1852f62997ddc0b9f1296c3756920f89a6c82",
34+
"os": "windows",
35+
"cpu": "x86_64"
36+
}
37+
]
38+
},
39+
"perses": {
40+
"binaries": [
41+
{
42+
"kind": "archive",
43+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_linux_amd64.tar.gz",
44+
"file": "perses",
45+
"sha256": "5b8e332c3796ac1bec73aa8ebf368c065f706e6b1b250d72c457bd37a89c65f6",
46+
"os": "linux",
47+
"cpu": "x86_64"
48+
},
49+
{
50+
"kind": "archive",
51+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_darwin_arm64.tar.gz",
52+
"file": "perses",
53+
"sha256": "59dda6d76e2583aacb13f2612b2315e2b303f1d6c8abdd2ed074b7a87c77e180",
54+
"os": "macos",
55+
"cpu": "arm64"
56+
},
57+
{
58+
"kind": "archive",
59+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_darwin_amd64.tar.gz",
60+
"file": "perses",
61+
"sha256": "2fc4b16b545ae88534e446fd7b14f78a9f3f4d0e3ff84661f71e9fe006daf43b",
62+
"os": "macos",
63+
"cpu": "x86_64"
64+
},
65+
{
66+
"kind": "archive",
67+
"url": "https://github.com/perses/perses/releases/download/v0.49.0/perses_0.49.0_windows_amd64.tar.gz",
68+
"file": "perses.exe",
69+
"sha256": "de01b266d035275443cbdbbc7dc1852f62997ddc0b9f1296c3756920f89a6c82",
70+
"os": "windows",
71+
"cpu": "x86_64"
72+
}
73+
]
74+
},
375
"sentry-cli": {
476
"binaries": [
577
{
678
"kind": "file",
7-
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.1/sentry-cli-Linux-aarch64",
8-
"sha256": "ce056adc10cc15d16578d9d65cda98b1d1e97fca7fcc826772a13012495360e1",
79+
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.2/sentry-cli-Linux-aarch64",
80+
"sha256": "88c11b69a8ed971b6853faaa47cc27e3b6e559da28dee161dcbb9104752572e1",
981
"os": "linux",
1082
"cpu": "arm64"
1183
},
1284
{
1385
"kind": "file",
14-
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.1/sentry-cli-Linux-x86_64",
15-
"sha256": "6d5a4a2d93040fba4d9cf01b7abf5e43ffc0a013555ec2aab6a9d62fd5393ddb",
86+
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.2/sentry-cli-Linux-x86_64",
87+
"sha256": "7e9f8493e2a2f3536f00b71820eff9799f7642e8a0589b1b0be5673cbf43832c",
1688
"os": "linux",
1789
"cpu": "x86_64"
1890
},
1991
{
2092
"kind": "file",
21-
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.1/sentry-cli-Darwin-arm64",
22-
"sha256": "c1a2effc2605adf4fae6e2d586a89e28c8038016642ee72aca1214a422086787",
93+
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.2/sentry-cli-Darwin-arm64",
94+
"sha256": "27c42104d8d1b2ce522bbd8270fa83e94a226905e482e3797015a571a2ffe414",
2395
"os": "macos",
2496
"cpu": "arm64"
2597
},
2698
{
2799
"kind": "file",
28-
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.1/sentry-cli-Darwin-x86_64",
29-
"sha256": "a2222c24a2c252cbd3dbaaca3520ad3e0d83b743782078df9931c8828279735e",
100+
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.2/sentry-cli-Darwin-x86_64",
101+
"sha256": "fe3a21c73f972737e97f24ae4775566fa9043864f6258393d3b799e94079e353",
30102
"os": "macos",
31103
"cpu": "x86_64"
32104
},
33105
{
34106
"kind": "file",
35-
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.1/sentry-cli-Windows-x86_64.exe",
36-
"sha256": "5f6e48b5111ba342f97babb2f97dc329c5e202e6f188cbbc8b8ab9bb368ee915",
107+
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.38.2/sentry-cli-Windows-x86_64.exe",
108+
"sha256": "8e04bdd6d6a45b9834b4f51ccef8b95552178e73338363e860cc9e5e93a536d1",
37109
"os": "windows",
38110
"cpu": "x86_64"
39111
}

x/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.3.2
1+
7.4.1rc2

x/BUILD.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
package(default_visibility = ["//visibility:public"])
2+
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
3+
load("@aspect_bazel_lib//lib:copy_directory.bzl", "copy_directory")
4+
15
cc_binary(
26
name = "x",
37
srcs = ["x.cpp"],
48
deps = ["@otel_sdk//:dll"]
59
)
10+
11+
copy_directory(
12+
name = "dashboards_dir",
13+
src = "dashboards",
14+
out = "dashboards",
15+
hardlink = "on",
16+
)
17+
18+
native_binary(
19+
name = "perses",
20+
src = "@otel_sdk//:perses",
21+
data = ["dashboards_dir"],
22+
args = ["-config dashboards/config.yaml"],
23+
)

x/MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ local_path_override(
99
path = "..",
1010
)
1111

12+
bazel_dep(name = "aspect_bazel_lib", version = "2.9.3")
13+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1214
# Below is needed as we have "build --@curl//:use_mbedtls=true" from ..\.bazelrc
1315
bazel_dep(name = "curl", version = "8.8.0.bcr.1")
1416

x/config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
database:
2+
file:
3+
folder: "./data"
4+
extension: "json"
5+
6+
schemas:
7+
panels_path: "./cue/schemas/panels"
8+
queries_path: "./cue/schemas/queries"
9+
datasources_path: "./cue/schemas/datasources"
10+
variables_path: "./cue/schemas/variables"
11+
interval: "6h"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2023 The Perses Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package common
15+
16+
#calculation: "first" | *"last" | "first-number" | "last-number" | "mean" | "sum" | "min" | "max"

x/cue/schemas/common/format.cue

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2023 The Perses Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package common
15+
16+
#format: #timeFormat | #percentFormat | #decimalFormat | #bytesFormat | #throughputFormat
17+
18+
#timeFormat: {
19+
unit: "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years"
20+
decimalPlaces?: number
21+
}
22+
23+
#percentFormat: {
24+
unit: "percent" | "percent-decimal"
25+
decimalPlaces?: number
26+
}
27+
28+
#decimalFormat: {
29+
unit: "decimal"
30+
decimalPlaces?: number
31+
shortValues?: bool
32+
}
33+
34+
#bytesFormat: {
35+
unit: "bytes"
36+
decimalPlaces?: number
37+
shortValues?: bool
38+
}
39+
40+
#throughputFormat: {
41+
unit: "bits/sec" | "bytes/sec" | "counts/sec" | "events/sec" | "messages/sec" | "ops/sec" | "packets/sec" | "reads/sec" | "records/sec" | "requests/sec" | "rows/sec" | "writes/sec"
42+
decimalPlaces?: number
43+
shortValues?: bool
44+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2023 The Perses Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package proxy
15+
16+
import (
17+
"github.com/perses/perses/cue/schemas/common"
18+
)
19+
20+
#HTTPAllowedEndpoint: {
21+
endpointPattern: string
22+
method: "POST" | "PUT" | "PATCH" | "GET" | "DELETE"
23+
}
24+
25+
#HTTPProxy: {
26+
kind: "HTTPProxy"
27+
spec: {
28+
// url is the url of the datasource. It is not the url of the proxy.
29+
// The Perses server is the proxy, so it needs to know where to redirect the request.
30+
url: common.#url
31+
// allowedEndpoints is a list of tuples of http methods and http endpoints that will be accessible.
32+
// Leave it empty if you don't want to restrict the access to the datasource.
33+
allowedEndpoints?: [...#HTTPAllowedEndpoint]
34+
// headers can be used to provide additional headers that need to be forwarded when requesting the datasource
35+
headers?: {[string]: string}
36+
// secret is the name of the secret that should be used for the proxy or discovery configuration
37+
// It will contain any sensitive information such as password, token, certificate.
38+
secret?: string
39+
}
40+
}

x/cue/schemas/common/threshold.cue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2023 The Perses Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package common
15+
16+
#stepOption: {
17+
value: number
18+
color?: string
19+
name?: string
20+
}
21+
22+
#thresholds: {
23+
mode?: "percent" | "absolute"
24+
defaultColor?: string
25+
steps?: [...#stepOption]
26+
}

0 commit comments

Comments
 (0)