Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: migrate debug to gRPC v1 api (#6338)

ecmadao1a8b843fa610
diff --git a/backend/api/auth/config.go b/backend/api/auth/config.go
index 675850a9af..f7bf330cbc 100644
--- a/backend/api/auth/config.go
+++ b/backend/api/auth/config.go
@@ -12,6 +12,6 @@ var authenticationAllowlistMethods = map[string]bool{
// IsAuthenticationAllowed returns whether the method is exempted from authentication.
func IsAuthenticationAllowed(fullMethodName string) bool {
- // TODO(d): skips actuator, GET /subscription request, OpenAPI SQL endpoint.
+ // TODO(d): skips OpenAPI SQL endpoint.
return authenticationAllowlistMethods[fullMethodName]
}
diff --git a/backend/api/v1/acl_config.go b/backend/api/v1/acl_config.go
index 605378bbc2..37be7f3be2 100644
--- a/backend/api/v1/acl_config.go
+++ b/backend/api/v1/acl_config.go
@@ -30,6 +30,8 @@ var ownerAndDBAMethods = map[string]bool{
"RoleService/CreateRole": true,
"RoleService/UpdateRole": true,
"RoleService/DeleteRole": true,
+ "ActuatorService/UpdateActuatorInfo": true,
+ "ActuatorService/ListDebugLog": true,
}
var projectOwnerMethods = map[string]bool{
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.go
index 52e8bbad1f..f567aa0288 100644
--- a/backend/api/v1/actuator_service.go
+++ b/backend/api/v1/actuator_service.go
@@ -4,11 +4,13 @@ import (
"context"
"time"
+ "go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/timestamppb"
+ "github.com/bytebase/bytebase/backend/common/log"
"github.com/bytebase/bytebase/backend/component/config"
api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/store"
@@ -18,15 +20,17 @@ import (
// ActuatorService implements the actuator service.
type ActuatorService struct {
v1pb.UnimplementedActuatorServiceServer
- store *store.Store
- profile *config.Profile
+ store *store.Store
+ profile *config.Profile
+ errorRecordRing *api.ErrorRecordRing
}
// NewActuatorService creates a new ActuatorService.
-func NewActuatorService(store *store.Store, profile *config.Profile) *ActuatorService {
+func NewActuatorService(store *store.Store, profile *config.Profile, errorRecordRing *api.ErrorRecordRing) *ActuatorService {
return &ActuatorService{
- store: store,
- profile: profile,
+ store: store,
+ profile: profile,
+ errorRecordRing: errorRecordRing,
}
}
@@ -35,6 +39,42 @@ func (s *ActuatorService) GetActuatorInfo(ctx context.Context, _ *v1pb.GetActuat
return s.getServerInfo(ctx)
}
+// UpdateActuatorInfo updates the actuator info.
+func (s *ActuatorService) UpdateActuatorInfo(ctx context.Context, request *v1pb.UpdateActuatorInfoRequest) (*v1pb.ActuatorInfo, error) {
+ for _, path := range request.UpdateMask.Paths {
+ if path == "debug" {
+ lvl := zap.InfoLevel
+ if request.Actuator.Debug {
+ lvl = zap.DebugLevel
+ }
+ log.SetLevel(lvl)
+ }
+ }
+
+ return s.getServerInfo(ctx)
+}
+
+// ListDebugLog lists the debug log.
+func (s *ActuatorService) ListDebugLog(_ context.Context, _ *v1pb.ListDebugLogRequest) (*v1pb.ListDebugLogResponse, error) {
+ resp := &v1pb.ListDebugLogResponse{}
+
+ s.errorRecordRing.RWMutex.RLock()
+ defer s.errorRecordRing.RWMutex.RUnlock()
+
+ s.errorRecordRing.Ring.Do(func(p any) {
+ if p == nil {
+ return
+ }
+ errRecord, ok := p.(*v1pb.DebugLog)
+ if !ok {
+ return
+ }
+ resp.Logs = append(resp.Logs, errRecord)
+ })
+
+ return resp, nil
+}
+
// DeleteCache deletes the cache.
func (s *SettingService) DeleteCache(_ context.Context, _ *v1pb.DeleteCacheRequest) (*emptypb.Empty, error) {
s.store.DeleteCache()
@@ -70,6 +110,7 @@ func (s *ActuatorService) getServerInfo(ctx context.Context) (*v1pb.ActuatorInfo
LastActiveTime: timestamppb.New(time.Unix(s.profile.LastActiveTs, 0)),
WorkspaceId: workspaceID,
GitopsWebhookUrl: setting.GitopsWebhookUrl,
+ Debug: log.EnabledLevel(zap.DebugLevel),
}
return &serverInfo, nil
diff --git a/backend/api/v1/debug.go b/backend/api/v1/debug.go
new file mode 100644
index 0000000000..481a304066
--- /dev/null
+++ b/backend/api/v1/debug.go
@@ -0,0 +1,57 @@
+package v1
+
+import (
+ "context"
+ "runtime/debug"
+ "time"
+
+ "go.uber.org/zap"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/types/known/timestamppb"
+
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ api "github.com/bytebase/bytebase/backend/legacyapi"
+ v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
+)
+
+// DebugInterceptor is the v1 debug interceptor for gRPC server.
+type DebugInterceptor struct {
+ errorRecordRing *api.ErrorRecordRing
+}
+
+// NewDebugInterceptor returns a new v1 API debug interceptor.
+func NewDebugInterceptor(errorRecordRing *api.ErrorRecordRing) *DebugInterceptor {
+ return &DebugInterceptor{
+ errorRecordRing: errorRecordRing,
+ }
+}
+
+// DebugInterceptor is the unary interceptor for gRPC API.
+func (in *DebugInterceptor) DebugInterceptor(ctx context.Context, request any, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
+ resp, err := handler(ctx, request)
+ if err != nil {
+ st := status.Convert(err)
+ if st.Code() == codes.Internal && log.EnabledLevel(zap.DebugLevel) {
+ var role api.Role
+ if r, ok := ctx.Value(common.RoleContextKey).(api.Role); ok {
+ role = r
+ }
+
+ in.errorRecordRing.RWMutex.Lock()
+ defer in.errorRecordRing.RWMutex.Unlock()
+ in.errorRecordRing.Ring.Value = &v1pb.DebugLog{
+ RecordTime: timestamppb.New(time.Now()),
+ RequestPath: serverInfo.FullMethod,
+ Role: string(role),
+ Error: err.Error(),
+ StackTrace: string(debug.Stack()),
+ }
+ in.errorRecordRing.Ring = in.errorRecordRing.Ring.Next()
+ }
+ }
+
+ return resp, err
+}
diff --git a/backend/legacyapi/debug.go b/backend/legacyapi/debug.go
index 621305b552..b14a4c7434 100644
--- a/backend/legacyapi/debug.go
+++ b/backend/legacyapi/debug.go
@@ -31,19 +31,3 @@ func NewErrorRecordRing() ErrorRecordRing {
RWMutex: sync.RWMutex{},
}
}
-
-// ErrorRecord is the struct to record an error's useful details.
-type ErrorRecord struct {
- RecordTs int64 `jsonapi:"attr,recordTs"`
- Method string `jsonapi:"attr,method"`
- RequestPath string `jsonapi:"attr,requestPath"`
- Role `jsonapi:"attr,role"`
- Error string `jsonapi:"attr,error"`
- StackTrace string `jsonapi:"attr,stackTrace"`
-}
-
-// DebugLog is the API message for debug log.
-type DebugLog struct {
- ID int `jsonapi:"primary,debugLog"`
- ErrorRecord `jsonapi:"attr,errorRecord"`
-}
diff --git a/backend/server/acl_casbin_policy_dba.csv b/backend/server/acl_casbin_policy_dba.csv
index 21648b0815..77ae443649 100644
--- a/backend/server/acl_casbin_policy_dba.csv
+++ b/backend/server/acl_casbin_policy_dba.csv
@@ -109,7 +109,4 @@ p, DBA, /sheet/starred, GET
p, DBA, /sheet/{sheetID}, GET
p, DBA, /sheet/{sheetID}, PATCH
p, DBA, /sheet/{sheetID}, DELETE
-p, DBA, /debug, GET
-p, DBA, /debug, PATCH
-p, DBA, /debug/log, GET
p, DBA, /anomaly, GET
diff --git a/backend/server/acl_casbin_policy_developer.csv b/backend/server/acl_casbin_policy_developer.csv
index e8dba8d473..ad84f5cfba 100644
--- a/backend/server/acl_casbin_policy_developer.csv
+++ b/backend/server/acl_casbin_policy_developer.csv
@@ -93,6 +93,4 @@ p, DEVELOPER, /sheet/starred, GET
p, DEVELOPER, /sheet/{sheetID}, GET
p, DEVELOPER, /sheet/{sheetID}, PATCH
p, DEVELOPER, /sheet/{sheetID}, DELETE
-p, DEVELOPER, /debug, GET
-p, DEVELOPER, /debug/log, GET
p, DEVELOPER, /anomaly, GET
diff --git a/backend/server/acl_casbin_policy_owner.csv b/backend/server/acl_casbin_policy_owner.csv
index 491615414b..0c9ccfa7ca 100644
--- a/backend/server/acl_casbin_policy_owner.csv
+++ b/backend/server/acl_casbin_policy_owner.csv
@@ -116,7 +116,4 @@ p, OWNER, /sheet/starred, GET
p, OWNER, /sheet/{sheetID}, GET
p, OWNER, /sheet/{sheetID}, PATCH
p, OWNER, /sheet/{sheetID}, DELETE
-p, OWNER, /debug, GET
-p, OWNER, /debug, PATCH
-p, OWNER, /debug/log, GET
p, OWNER, /anomaly, GET
diff --git a/backend/server/debug.go b/backend/server/debug.go
deleted file mode 100644
index d23e92689b..0000000000
--- a/backend/server/debug.go
+++ /dev/null
@@ -1,78 +0,0 @@
-package server
-
-import (
- "net/http"
-
- "github.com/google/jsonapi"
- "github.com/labstack/echo/v4"
- "go.uber.org/zap"
-
- "github.com/bytebase/bytebase/backend/common/log"
- api "github.com/bytebase/bytebase/backend/legacyapi"
-)
-
-func (s *Server) registerDebugRoutes(g *echo.Group) {
- g.GET("/debug", currentDebugState)
-
- g.PATCH("/debug", func(c echo.Context) error {
- var debugPatch api.DebugPatch
- if err := jsonapi.UnmarshalPayload(c.Request().Body, &debugPatch); err != nil {
- return echo.NewHTTPError(http.StatusBadRequest, "Failed to unmarshal debug patch request").SetInternal(err)
- }
-
- lvl := zap.InfoLevel
- if debugPatch.IsDebug {
- lvl = zap.DebugLevel
- }
- log.SetLevel(lvl)
-
- s.e.Debug = debugPatch.IsDebug
-
- return currentDebugState(c)
- })
-
- g.GET("/debug/log", func(c echo.Context) error {
- var errorRecordList []*api.DebugLog
- // incrementID is used as primary key in jsonapi.
- var incrementID int
-
- // Only Owner and DBA can see debug logs.
- role := c.Get(getRoleContextKey()).(api.Role)
- if role != api.Owner && role != api.DBA {
- return echo.NewHTTPError(http.StatusForbidden, "Not allowed to fetch debug logs")
- }
-
- s.errorRecordRing.RWMutex.RLock()
- defer s.errorRecordRing.RWMutex.RUnlock()
-
- s.errorRecordRing.Ring.Do(func(p any) {
- if p == nil {
- return
- }
- errRecord, ok := p.(*api.ErrorRecord)
- if !ok {
- return
- }
- errorRecordList = append(errorRecordList, &api.DebugLog{
- ID: incrementID,
- ErrorRecord: *errRecord,
- })
- incrementID++
- })
-
- c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
- if err := jsonapi.MarshalPayload(c.Response().Writer, errorRecordList); err != nil {
- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to marshal debug log response").SetInternal(err)
- }
-
- return nil
- })
-}
-
-func currentDebugState(c echo.Context) error {
- c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
- if err := jsonapi.MarshalPayload(c.Response().Writer, &api.Debug{IsDebug: log.EnabledLevel(zap.DebugLevel)}); err != nil {
- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to marshal debug info response").SetInternal(err)
- }
- return nil
-}
diff --git a/backend/server/error_recorder.go b/backend/server/error_recorder.go
deleted file mode 100644
index f723fe6ebf..0000000000
--- a/backend/server/error_recorder.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package server
-
-import (
- "net/http"
- "runtime/debug"
- "time"
-
- "github.com/labstack/echo/v4"
-
- api "github.com/bytebase/bytebase/backend/legacyapi"
-)
-
-func errorRecorderMiddleware(err error, s *Server, c echo.Context, e *echo.Echo) {
- e.DefaultHTTPErrorHandler(err, c)
-
- he, isHTTPError := err.(*echo.HTTPError)
-
- if c.Response().Status == http.StatusInternalServerError {
- var role api.Role
- if r, ok := c.Get(getRoleContextKey()).(api.Role); ok {
- role = r
- }
-
- var stackTrace string
- // There're basically two kinds of errors: internal HTTP errors and runtime panics.
- // If we encounter runtime panics, we can report the stack trace for debugging.
- if !isHTTPError || he.Internal == nil {
- // Get a snapshot of the stack trace here, which will include where the panic occurred.
- // We only do this for runtime errors. Because for internal HTTP errors,
- // the stack trace here won't indicate where the internal error is from.
- // To debug internal errors, we mainly check the error mesasges.
- stackTrace = string(debug.Stack())
- }
-
- s.errorRecordRing.RWMutex.Lock()
- defer s.errorRecordRing.RWMutex.Unlock()
-
- s.errorRecordRing.Ring.Value = &api.ErrorRecord{
- RecordTs: time.Now().Unix(),
- Method: c.Request().Method,
- RequestPath: c.Request().URL.Path,
- Role: role,
- Error: err.Error(),
- StackTrace: stackTrace,
- }
- s.errorRecordRing.Ring = s.errorRecordRing.Ring.Next()
- }
-}
diff --git a/backend/server/server.go b/backend/server/server.go
index acf58a9a71..bb280afd57 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -466,10 +466,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
// Middleware
//
- // Error recorder middleware.
- e.HTTPErrorHandler = func(err error, c echo.Context) {
- errorRecorderMiddleware(err, s, c, e)
- }
// API logger middleware.
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
Skipper: func(c echo.Context) bool {
@@ -507,7 +503,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
apiGroup.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return aclMiddleware(s, internalAPIPrefix, ce, next, profile.Readonly)
})
- s.registerDebugRoutes(apiGroup)
s.registerOAuthRoutes(apiGroup)
s.registerProjectRoutes(apiGroup)
s.registerEnvironmentRoutes(apiGroup)
@@ -533,6 +528,7 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
// Setup the gRPC and grpc-gateway.
authProvider := auth.New(s.store, s.secret, s.licenseService, profile.Mode)
aclProvider := v1.NewACLInterceptor(s.store, s.secret, s.licenseService, profile.Mode)
+ debugProvider := v1.NewDebugInterceptor(&s.errorRecordRing)
onPanic := func(p any) error {
stack := make([]byte, maxStacksize)
stack = stack[:runtime.Stack(stack, true)]
@@ -542,7 +538,7 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
}
recoveryUnaryInterceptor := recovery.UnaryServerInterceptor(recovery.WithRecoveryHandler(onPanic))
s.grpcServer = grpc.NewServer(
- grpc.ChainUnaryInterceptor(authProvider.AuthenticationInterceptor, aclProvider.ACLInterceptor, recoveryUnaryInterceptor),
+ grpc.ChainUnaryInterceptor(debugProvider.DebugInterceptor, authProvider.AuthenticationInterceptor, aclProvider.ACLInterceptor, recoveryUnaryInterceptor),
)
v1pb.RegisterAuthServiceServer(s.grpcServer, v1.NewAuthService(s.store, s.secret, s.licenseService, s.MetricReporter, &profile,
func(ctx context.Context, user *store.UserMessage, firstEndUser bool) error {
@@ -559,7 +555,7 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
}
return nil
}))
- v1pb.RegisterActuatorServiceServer(s.grpcServer, v1.NewActuatorService(s.store, &s.profile))
+ v1pb.RegisterActuatorServiceServer(s.grpcServer, v1.NewActuatorService(s.store, &s.profile, &s.errorRecordRing))
v1pb.RegisterSubscriptionServiceServer(s.grpcServer, v1.NewSubscriptionService(
s.store,
&s.profile,
diff --git a/frontend/src/components/BannersWrapper.vue b/frontend/src/components/BannersWrapper.vue
index 574130270e..8281d88abd 100644
--- a/frontend/src/components/BannersWrapper.vue
+++ b/frontend/src/components/BannersWrapper.vue
@@ -27,7 +27,6 @@ import { computed } from "vue";
import {
useActuatorV1Store,
useCurrentUserV1,
- useDebugStore,
useSubscriptionV1Store,
} from "@/store/modules";
import { hasWorkspacePermissionV1, isDev } from "@/utils";
@@ -39,12 +38,10 @@ import BannerUpgradeSubscription from "@/views/BannerUpgradeSubscription.vue";
const actuatorStore = useActuatorV1Store();
const currentUserV1 = useCurrentUserV1();
-const debugStore = useDebugStore();
const subscriptionStore = useSubscriptionV1Store();
-const { isDemo, isReadonly, needConfigureExternalUrl } =
+const { isDemo, isReadonly, isDebug, needConfigureExternalUrl } =
storeToRefs(actuatorStore);
-const { isDebug } = storeToRefs(debugStore);
const { isExpired, isTrialing } = storeToRefs(subscriptionStore);
const shouldShowDemoBanner = computed(() => {
diff --git a/frontend/src/components/DebugLog/DebugLogTable.vue b/frontend/src/components/DebugLog/DebugLogTable.vue
index e4c1603b9d..4ea09a4f6d 100644
--- a/frontend/src/components/DebugLog/DebugLogTable.vue
+++ b/frontend/src/components/DebugLog/DebugLogTable.vue
@@ -9,24 +9,21 @@
<template #body="{ rowData: debugLog }">
<BBTableCell :left-padding="4" class="table-cell w-56">
<div>
- {{ dayjs.unix(debugLog.RecordTs).format("YYYY-MM-DD HH:mm:ss Z") }}
+ {{ dayjs(debugLog.recordTime).format("YYYY-MM-DD HH:mm:ss Z") }}
</div>
</BBTableCell>
- <BBTableCell class="table-cell w-20">
- <HTTPMethodTag :method="debugLog.Method" />
- </BBTableCell>
<BBTableCell class="table-cell w-28">
- <div>{{ debugLog.RequestPath }}</div>
+ <div>{{ debugLog.requestPath }}</div>
</BBTableCell>
<BBTableCell class="table-cell w-20">
- <span v-if="!debugLog.Role" class="italic text-gray-500">{{
+ <span v-if="!debugLog.role" class="italic text-gray-500">{{
$t("debug-log.table.empty")
}}</span>
- <div v-else>{{ debugLog.Role }}</div>
+ <div v-else>{{ debugLog.role }}</div>
</BBTableCell>
<BBTableCell class="table-cell pt-3">
<EllipsisText class="max-w-full" :line-clamp="2">{{
- debugLog.Error
+ debugLog.error
}}</EllipsisText>
</BBTableCell>
<BBTableCell class="table-cell w-28">
@@ -54,9 +51,8 @@
<script lang="ts" setup>
import { computed, PropType } from "vue";
import { useI18n } from "vue-i18n";
-import { DebugLog } from "@/types/debug";
-import HTTPMethodTag from "./HTTPMethodTag.vue";
import EllipsisText from "../EllipsisText.vue";
+import { DebugLog } from "@/types/proto/v1/actuator_service";
defineProps({
debugLogList: {
@@ -75,9 +71,6 @@ const columnList = computed(() => [
{
title: t("debug-log.table.record-ts"),
},
- {
- title: t("debug-log.table.method"),
- },
{
title: t("debug-log.table.request-path"),
},
diff --git a/frontend/src/components/ProfileDropdown.vue b/frontend/src/components/ProfileDropdown.vue
index 4df06e61f0..ed65a86867 100644
--- a/frontend/src/components/ProfileDropdown.vue
+++ b/frontend/src/components/ProfileDropdown.vue
@@ -129,14 +129,12 @@ import {
useActuatorV1Store,
useAuthStore,
useCurrentUserV1,
- useDebugStore,
useUIStateStore,
} from "@/store";
import UserAvatar from "./User/UserAvatar.vue";
const actuatorStore = useActuatorV1Store();
const authStore = useAuthStore();
-const debugStore = useDebugStore();
const uiStateStore = useUIStateStore();
const router = useRouter();
const { setLocale, locale } = useLanguage();
@@ -187,11 +185,11 @@ const resetQuickstart = () => {
});
};
-const { isDebug } = storeToRefs(debugStore);
+const { isDebug } = storeToRefs(actuatorStore);
const switchDebug = () => {
- debugStore.patchDebug({
- isDebug: !isDebug.value,
+ actuatorStore.patchDebug({
+ debug: !isDebug.value,
});
};
diff --git a/frontend/src/components/ProvideDashboardContext.vue b/frontend/src/components/ProvideDashboardContext.vue
index b26413c69c..295b0f074d 100644
--- a/frontend/src/components/ProvideDashboardContext.vue
+++ b/frontend/src/components/ProvideDashboardContext.vue
@@ -9,7 +9,6 @@ import {
useRoleStore,
useUIStateStore,
useLegacyProjectStore,
- useDebugStore,
useUserStore,
useProjectV1Store,
} from "@/store";
@@ -31,7 +30,6 @@ export default defineComponent({
useLegacyProjectStore().fetchProjectById(DEFAULT_PROJECT_ID),
useLegacyProjectStore().fetchAllProjectList(), // TODO(Jim): For legacy API support only. Remove this after refactored
useUIStateStore().restoreState(),
- useDebugStore().fetchDebug(),
]);
},
});
diff --git a/frontend/src/components/ProvideSQLEditorContext.vue b/frontend/src/components/ProvideSQLEditorContext.vue
index e5e3160657..ca25d6bfde 100644
--- a/frontend/src/components/ProvideSQLEditorContext.vue
+++ b/frontend/src/components/ProvideSQLEditorContext.vue
@@ -9,7 +9,6 @@ import { useRoute, useRouter } from "vue-router";
import {
useSQLEditorStore,
useTabStore,
- useDebugStore,
pushNotification,
useConnectionTreeStore,
useProjectV1Store,
@@ -422,7 +421,6 @@ onMounted(async () => {
await setConnectionFromQuery();
await sqlEditorStore.fetchQueryHistoryList();
- await useDebugStore().fetchDebug();
await useSettingV1Store().fetchSettingList();
syncURLWithConnection();
diff --git a/frontend/src/store/modules/debug.ts b/frontend/src/store/modules/debug.ts
deleted file mode 100644
index ad3f9ff25f..0000000000
--- a/frontend/src/store/modules/debug.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { watchEffect } from "vue";
-import { defineStore, storeToRefs } from "pinia";
-import axios from "axios";
-import type { DebugState, DebugLogState, ResourceObject } from "@/types";
-import type { Debug, DebugPatch, DebugLog } from "@/types/debug";
-
-function convertDebugState(debug: ResourceObject): Debug {
- return { ...(debug.attributes as Omit<Debug, "">) };
-}
-
-function convertDebugLogList(debugLogList: ResourceObject[]): DebugLog[] {
- return debugLogList.map(
- (debugLog) => debugLog.attributes.errorRecord as DebugLog
- );
-}
-
-export const useDebugStore = defineStore("debug", {
- state: (): DebugState => ({
- isDebug: false,
- }),
- actions: {
- setDebug(debug: Debug) {
- this.isDebug = debug.isDebug;
- },
- async fetchDebug() {
- const res = (await axios.get("/api/debug")).data;
- const debug = convertDebugState(res.data);
- this.setDebug(debug);
- return debug;
- },
- async patchDebug(debugPatch: DebugPatch) {
- const debugState = convertDebugState(
- (
- await axios.patch("/api/debug", {
- data: {
- type: "debugPatch",
- attributes: { isDebug: debugPatch.isDebug },
- },
- })
- ).data.data
- );
- this.setDebug(debugState);
- },
- },
-});
-
-export const useDebugLogStore = defineStore("debugLog", {
- state: (): DebugLogState => ({
- debugLogList: [],
- }),
- actions: {
- setDebugLogList(debugLogList: DebugLog[]) {
- this.debugLogList = debugLogList;
- },
- async fetchDebugLogList() {
- const res = (await axios.get("/api/debug/log")).data.data;
- const list = convertDebugLogList(res);
- this.setDebugLogList(list);
- return list;
- },
- },
-});
-
-export const useDebugLogList = () => {
- const store = useDebugLogStore();
- watchEffect(() => store.fetchDebugLogList());
-
- return storeToRefs(store).debugLogList;
-};
diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.ts
index c32f64085e..ff0462e822 100644
--- a/frontend/src/store/modules/index.ts
+++ b/frontend/src/store/modules/index.ts
@@ -7,7 +7,6 @@ export * from "./bookmark";
export * from "./command";
export * from "./database";
export * from "./dataSource";
-export * from "./debug";
export * from "./environment";
export * from "./gitlab";
export * from "./help";
diff --git a/frontend/src/store/modules/v1/actuator.ts b/frontend/src/store/modules/v1/actuator.ts
index a5e95170dd..9476a463ce 100644
--- a/frontend/src/store/modules/v1/actuator.ts
+++ b/frontend/src/store/modules/v1/actuator.ts
@@ -1,12 +1,13 @@
+import { watchEffect } from "vue";
import axios from "axios";
import { RemovableRef } from "@vueuse/core";
-import { defineStore } from "pinia";
+import { defineStore, storeToRefs } from "pinia";
import { Release, ReleaseInfo } from "@/types";
import { useLocalStorage } from "@vueuse/core";
import { actuatorServiceClient } from "@/grpcweb";
import { semverCompare } from "@/utils";
import { useSilentRequest } from "@/plugins/silent-request";
-import { ActuatorInfo } from "@/types/proto/v1/actuator_service";
+import { ActuatorInfo, DebugLog } from "@/types/proto/v1/actuator_service";
const EXTERNAL_URL_PLACEHOLDER =
"https://www.bytebase.com/docs/get-started/install/external-url";
@@ -16,6 +17,7 @@ const GITHUB_API_LIST_BYTEBASE_RELEASE =
interface ActuatorState {
serverInfo?: ActuatorInfo;
releaseInfo: RemovableRef<ReleaseInfo>;
+ debugLogList: DebugLog[];
}
export const useActuatorV1Store = defineStore("actuator_v1", {
@@ -25,6 +27,7 @@ export const useActuatorV1Store = defineStore("actuator_v1", {
ignoreRemindModalTillNextRelease: false,
nextCheckTs: 0,
}),
+ debugLogList: [],
}),
getters: {
info: (state) => {
@@ -42,6 +45,9 @@ export const useActuatorV1Store = defineStore("actuator_v1", {
isReadonly: (state) => {
return state.serverInfo?.readonly || false;
},
+ isDebug: (state) => {
+ return state.serverInfo?.debug || false;
+ },
isSaaSMode: (state) => {
return state.serverInfo?.saas || false;
},
@@ -76,6 +82,20 @@ export const useActuatorV1Store = defineStore("actuator_v1", {
return serverInfo;
},
+ async patchDebug({ debug }: { debug: boolean }) {
+ const serverInfo = await actuatorServiceClient.updateActuatorInfo({
+ actuator: {
+ debug,
+ },
+ updateMask: ["debug"],
+ });
+ this.setServerInfo(serverInfo);
+ },
+ async fetchDebugLogList() {
+ const { logs } = await actuatorServiceClient.listDebugLog({});
+ this.debugLogList = logs;
+ return logs;
+ },
async tryToRemindRelease(): Promise<boolean> {
if (this.serverInfo?.saas ?? false) {
return false;
@@ -125,3 +145,10 @@ export const useActuatorV1Store = defineStore("actuator_v1", {
},
},
});
+
+export const useDebugLogList = () => {
+ const store = useActuatorV1Store();
+ watchEffect(() => store.fetchDebugLogList());
+
+ return storeToRefs(store).debugLogList;
+};
diff --git a/frontend/src/types/debug.ts b/frontend/src/types/debug.ts
deleted file mode 100644
index cbc013ac18..0000000000
--- a/frontend/src/types/debug.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export type Debug = {
- isDebug: boolean;
-};
-
-export type DebugPatch = {
- isDebug: boolean;
-};
-
-export type DebugLog = {
- RecordTs: number;
- Method: string;
- RequestPath: string;
- Role: string;
- Error: string;
- StackTrace: string;
-};
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index a8c2767b03..5c5c4b2604 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -9,7 +9,6 @@ export * from "./common";
export * from "./const";
export * from "./database";
export * from "./dataSource";
-export * from "./debug";
export * from "./environment";
export * from "./error";
export * from "./errorList";
diff --git a/frontend/src/types/proto/v1/actuator_service.ts b/frontend/src/types/proto/v1/actuator_service.ts
index a8a78388d0..75036bc3ef 100644
--- a/frontend/src/types/proto/v1/actuator_service.ts
+++ b/frontend/src/types/proto/v1/actuator_service.ts
@@ -2,6 +2,7 @@
import type { CallContext, CallOptions } from "nice-grpc-common";
import * as _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
+import { FieldMask } from "../google/protobuf/field_mask";
import { Timestamp } from "../google/protobuf/timestamp";
export const protobufPackage = "bytebase.v1";
@@ -9,6 +10,49 @@ export const protobufPackage = "bytebase.v1";
export interface GetActuatorInfoRequest {
}
+export interface UpdateActuatorInfoRequest {
+ /** The actuator to update. */
+ actuator?: ActuatorInfo;
+ /** The list of fields to update. */
+ updateMask?: string[];
+}
+
+export interface ListDebugLogRequest {
+ /**
+ * The maximum number of logs to return. The service may return fewer than
+ * this value.
+ * If unspecified, at most 50 logs will be returned.
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
+ */
+ pageSize: number;
+ /**
+ * A page token, received from a previous `ListDebugLog` call.
+ * Provide this to retrieve the subsequent page.
+ *
+ * When paginating, all other parameters provided to `ListDebugLog` must match
+ * the call that provided the page token.
+ */
+ pageToken: string;
+}
+
+export interface ListDebugLogResponse {
+ /** The logs from the specified request. */
+ logs: DebugLog[];
+ /**
+ * A token, which can be sent as `page_token` to retrieve the next page.
+ * If this field is omitted, there are no subsequent pages.
+ */
+ nextPageToken: string;
+}
+
+export interface DebugLog {
+ recordTime?: Date;
+ requestPath: string;
+ role: string;
+ error: string;
+ stackTrace: string;
+}
+
export interface DeleteCacheRequest {
}
@@ -45,6 +89,8 @@ export interface ActuatorInfo {
workspaceId: string;
/** gitops_webhook_url is the webhook URL for GitOps. */
gitopsWebhookUrl: string;
+ /** debug flag means if the debug mode is enabled. */
+ debug: boolean;
}
function createBaseGetActuatorInfoRequest(): GetActuatorInfoRequest {
@@ -91,6 +137,336 @@ export const GetActuatorInfoRequest = {
},
};
+function createBaseUpdateActuatorInfoRequest(): UpdateActuatorInfoRequest {
+ return { actuator: undefined, updateMask: undefined };
+}
+
+export const UpdateActuatorInfoRequest = {
+ encode(message: UpdateActuatorInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.actuator !== undefined) {
+ ActuatorInfo.encode(message.actuator, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.updateMask !== undefined) {
+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateActuatorInfoRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseUpdateActuatorInfoRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.actuator = ActuatorInfo.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): UpdateActuatorInfoRequest {
+ return {
+ actuator: isSet(object.actuator) ? ActuatorInfo.fromJSON(object.actuator) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
+ toJSON(message: UpdateActuatorInfoRequest): unknown {
+ const obj: any = {};
+ message.actuator !== undefined &&
+ (obj.actuator = message.actuator ? ActuatorInfo.toJSON(message.actuator) : undefined);
+ message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));
+ return obj;
+ },
+
+ create(base?: DeepPartial<UpdateActuatorInfoRequest>): UpdateActuatorInfoRequest {
+ return UpdateActuatorInfoRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<UpdateActuatorInfoRequest>): UpdateActuatorInfoRequest {
+ const message = createBaseUpdateActuatorInfoRequest();
+ message.actuator = (object.actuator !== undefined && object.actuator !== null)
+ ? ActuatorInfo.fromPartial(object.actuator)
+ : undefined;
+ message.updateMask = object.updateMask ?? undefined;
+ return message;
+ },
+};
+
+function createBaseListDebugLogRequest(): ListDebugLogRequest {
+ return { pageSize: 0, pageToken: "" };
+}
+
+export const ListDebugLogRequest = {
+ encode(message: ListDebugLogRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.pageSize !== 0) {
+ writer.uint32(8).int32(message.pageSize);
+ }
+ if (message.pageToken !== "") {
+ writer.uint32(18).string(message.pageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListDebugLogRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseListDebugLogRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.pageSize = reader.int32();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.pageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ListDebugLogRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? String(object.pageToken) : "",
+ };
+ },
+
+ toJSON(message: ListDebugLogRequest): unknown {
+ const obj: any = {};
+ message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize));
+ message.pageToken !== undefined && (obj.pageToken = message.pageToken);
+ return obj;
+ },
+
+ create(base?: DeepPartial<ListDebugLogRequest>): ListDebugLogRequest {
+ return ListDebugLogRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<ListDebugLogRequest>): ListDebugLogRequest {
+ const message = createBaseListDebugLogRequest();
+ message.pageSize = object.pageSize ?? 0;
+ message.pageToken = object.pageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseListDebugLogResponse(): ListDebugLogResponse {
+ return { logs: [], nextPageToken: "" };
+}
+
+export const ListDebugLogResponse = {
+ encode(message: ListDebugLogResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.logs) {
+ DebugLog.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.nextPageToken !== "") {
+ writer.uint32(18).string(message.nextPageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListDebugLogResponse {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseListDebugLogResponse();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.logs.push(DebugLog.decode(reader, reader.uint32()));
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.nextPageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ListDebugLogResponse {
+ return {
+ logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => DebugLog.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "",
+ };
+ },
+
+ toJSON(message: ListDebugLogResponse): unknown {
+ const obj: any = {};
+ if (message.logs) {
+ obj.logs = message.logs.map((e) => e ? DebugLog.toJSON(e) : undefined);
+ } else {
+ obj.logs = [];
+ }
+ message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);
+ return obj;
+ },
+
+ create(base?: DeepPartial<ListDebugLogResponse>): ListDebugLogResponse {
+ return ListDebugLogResponse.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<ListDebugLogResponse>): ListDebugLogResponse {
+ const message = createBaseListDebugLogResponse();
+ message.logs = object.logs?.map((e) => DebugLog.fromPartial(e)) || [];
+ message.nextPageToken = object.nextPageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseDebugLog(): DebugLog {
+ return { recordTime: undefined, requestPath: "", role: "", error: "", stackTrace: "" };
+}
+
+export const DebugLog = {
+ encode(message: DebugLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.recordTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.recordTime), writer.uint32(10).fork()).ldelim();
+ }
+ if (message.requestPath !== "") {
+ writer.uint32(18).string(message.requestPath);
+ }
+ if (message.role !== "") {
+ writer.uint32(26).string(message.role);
+ }
+ if (message.error !== "") {
+ writer.uint32(34).string(message.error);
+ }
+ if (message.stackTrace !== "") {
+ writer.uint32(42).string(message.stackTrace);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): DebugLog {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDebugLog();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.recordTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.requestPath = reader.string();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.role = reader.string();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.error = reader.string();
+ continue;
+ case 5:
+ if (tag !== 42) {
+ break;
+ }
+
+ message.stackTrace = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): DebugLog {
+ return {
+ recordTime: isSet(object.recordTime) ? fromJsonTimestamp(object.recordTime) : undefined,
+ requestPath: isSet(object.requestPath) ? String(object.requestPath) : "",
+ role: isSet(object.role) ? String(object.role) : "",
+ error: isSet(object.error) ? String(object.error) : "",
+ stackTrace: isSet(object.stackTrace) ? String(object.stackTrace) : "",
+ };
+ },
+
+ toJSON(message: DebugLog): unknown {
+ const obj: any = {};
+ message.recordTime !== undefined && (obj.recordTime = message.recordTime.toISOString());
+ message.requestPath !== undefined && (obj.requestPath = message.requestPath);
+ message.role !== undefined && (obj.role = message.role);
+ message.error !== undefined && (obj.error = message.error);
+ message.stackTrace !== undefined && (obj.stackTrace = message.stackTrace);
+ return obj;
+ },
+
+ create(base?: DeepPartial<DebugLog>): DebugLog {
+ return DebugLog.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<DebugLog>): DebugLog {
+ const message = createBaseDebugLog();
+ message.recordTime = object.recordTime ?? undefined;
+ message.requestPath = object.requestPath ?? "";
+ message.role = object.role ?? "";
+ message.error = object.error ?? "";
+ message.stackTrace = object.stackTrace ?? "";
+ return message;
+ },
+};
+
function createBaseDeleteCacheRequest(): DeleteCacheRequest {
return {};
}
@@ -151,6 +527,7 @@ function createBaseActuatorInfo(): ActuatorInfo {
require2fa: false,
workspaceId: "",
gitopsWebhookUrl: "",
+ debug: false,
};
}
@@ -198,6 +575,9 @@ export const ActuatorInfo = {
if (message.gitopsWebhookUrl !== "") {
writer.uint32(114).string(message.gitopsWebhookUrl);
}
+ if (message.debug === true) {
+ writer.uint32(120).bool(message.debug);
+ }
return writer;
},
@@ -306,6 +686,13 @@ export const ActuatorInfo = {
message.gitopsWebhookUrl = reader.string();
continue;
+ case 15:
+ if (tag !== 120) {
+ break;
+ }
+
+ message.debug = reader.bool();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -331,6 +718,7 @@ export const ActuatorInfo = {
require2fa: isSet(object.require2fa) ? Boolean(object.require2fa) : false,
workspaceId: isSet(object.workspaceId) ? String(object.workspaceId) : "",
gitopsWebhookUrl: isSet(object.gitopsWebhookUrl) ? String(object.gitopsWebhookUrl) : "",
+ debug: isSet(object.debug) ? Boolean(object.debug) : false,
};
},
@@ -350,6 +738,7 @@ export const ActuatorInfo = {
message.require2fa !== undefined && (obj.require2fa = message.require2fa);
message.workspaceId !== undefined && (obj.workspaceId = message.workspaceId);
message.gitopsWebhookUrl !== undefined && (obj.gitopsWebhookUrl = message.gitopsWebhookUrl);
+ message.debug !== undefined && (obj.debug = message.debug);
return obj;
},
@@ -373,6 +762,7 @@ export const ActuatorInfo = {
message.require2fa = object.require2fa ?? false;
message.workspaceId = object.workspaceId ?? "";
message.gitopsWebhookUrl = object.gitopsWebhookUrl ?? "";
+ message.debug = object.debug ?? false;
return message;
},
};
@@ -397,6 +787,76 @@ export const ActuatorServiceDefinition = {
},
},
},
+ updateActuatorInfo: {
+ name: "UpdateActuatorInfo",
+ requestType: UpdateActuatorInfoRequest,
+ requestStream: false,
+ responseType: ActuatorInfo,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [
+ new Uint8Array([
+ 20,
+ 97,
+ 99,
+ 116,
+ 117,
+ 97,
+ 116,
+ 111,
+ 114,
+ 44,
+ 117,
+ 112,
+ 100,
+ 97,
+ 116,
+ 101,
+ 95,
+ 109,
+ 97,
+ 115,
+ 107,
+ ]),
+ ],
+ 578365826: [
+ new Uint8Array([
+ 29,
+ 58,
+ 8,
+ 97,
+ 99,
+ 116,
+ 117,
+ 97,
+ 116,
+ 111,
+ 114,
+ 50,
+ 17,
+ 47,
+ 118,
+ 49,
+ 47,
+ 97,
+ 99,
+ 116,
+ 117,
+ 97,
+ 116,
+ 111,
+ 114,
+ 47,
+ 105,
+ 110,
+ 102,
+ 111,
+ ]),
+ ],
+ },
+ },
+ },
deleteCache: {
name: "DeleteCache",
requestType: DeleteCacheRequest,
@@ -433,6 +893,43 @@ export const ActuatorServiceDefinition = {
},
},
},
+ listDebugLog: {
+ name: "ListDebugLog",
+ requestType: ListDebugLogRequest,
+ requestStream: false,
+ responseType: ListDebugLogResponse,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([0])],
+ 578365826: [
+ new Uint8Array([
+ 20,
+ 18,
+ 18,
+ 47,
+ 118,
+ 49,
+ 47,
+ 97,
+ 99,
+ 116,
+ 117,
+ 97,
+ 116,
+ 111,
+ 114,
+ 47,
+ 100,
+ 101,
+ 98,
+ 117,
+ 103,
+ ]),
+ ],
+ },
+ },
+ },
},
} as const;
@@ -441,7 +938,15 @@ export interface ActuatorServiceImplementation<CallContextExt = {}> {
request: GetActuatorInfoRequest,
context: CallContext & CallContextExt,
): Promise<DeepPartial<ActuatorInfo>>;
+ updateActuatorInfo(
+ request: UpdateActuatorInfoRequest,
+ context: CallContext & CallContextExt,
+ ): Promise<DeepPartial<ActuatorInfo>>;
deleteCache(request: DeleteCacheRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Empty>>;
+ listDebugLog(
+ request: ListDebugLogRequest,
+ context: CallContext & CallContextExt,
+ ): Promise<DeepPartial<ListDebugLogResponse>>;
}
export interface ActuatorServiceClient<CallOptionsExt = {}> {
@@ -449,7 +954,15 @@ export interface ActuatorServiceClient<CallOptionsExt = {}> {
request: DeepPartial<GetActuatorInfoRequest>,
options?: CallOptions & CallOptionsExt,
): Promise<ActuatorInfo>;
+ updateActuatorInfo(
+ request: DeepPartial<UpdateActuatorInfoRequest>,
+ options?: CallOptions & CallOptionsExt,
+ ): Promise<ActuatorInfo>;
deleteCache(request: DeepPartial<DeleteCacheRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
+ listDebugLog(
+ request: DeepPartial<ListDebugLogRequest>,
+ options?: CallOptions & CallOptionsExt,
+ ): Promise<ListDebugLogResponse>;
}
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
diff --git a/frontend/src/types/store.ts b/frontend/src/types/store.ts
index 5e8a52d3c7..a611213812 100644
--- a/frontend/src/types/store.ts
+++ b/frontend/src/types/store.ts
@@ -26,7 +26,6 @@ import { Project } from "./project";
import { Repository } from "./repository";
import { VCS } from "./vcs";
import { Label } from "./label";
-import type { DebugLog } from "@/types/debug";
import type { AuditLog } from "@/types/auditLog";
import { DatabaseMetadata } from "./proto/store/database";
@@ -147,9 +146,6 @@ export interface SQLEditorState {
export interface DebugState {
isDebug: boolean;
}
-export interface DebugLogState {
- debugLogList: DebugLog[];
-}
export interface OnboardingGuideState {
guideName?: OnboardingGuideType;
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 74a0874ba3..7e4cb0fdb7 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -213,7 +213,7 @@ import { hasWorkspacePermissionV1, isDev } from "../utils";
import { useLanguage } from "../composables/useLanguage";
import {
useCurrentUser,
- useDebugStore,
+ useActuatorV1Store,
useSubscriptionV1Store,
useInboxStore,
useCurrentUserV1,
@@ -235,7 +235,7 @@ export default defineComponent({
},
setup() {
const { t, availableLocales } = useI18n();
- const debugStore = useDebugStore();
+ const actuatorV1Store = useActuatorV1Store();
const inboxStore = useInboxStore();
const subscriptionStore = useSubscriptionV1Store();
const router = useRouter();
@@ -361,11 +361,11 @@ export default defineComponent({
);
};
- const { isDebug } = storeToRefs(debugStore);
+ const { isDebug } = storeToRefs(actuatorV1Store);
const toggleDebug = () => {
- debugStore.patchDebug({
- isDebug: !isDebug.value,
+ actuatorV1Store.patchDebug({
+ debug: !isDebug.value,
});
};
diff --git a/frontend/src/views/SettingWorkspaceDebugLog.vue b/frontend/src/views/SettingWorkspaceDebugLog.vue
index bb737a4118..23c0f4688d 100644
--- a/frontend/src/views/SettingWorkspaceDebugLog.vue
+++ b/frontend/src/views/SettingWorkspaceDebugLog.vue
@@ -16,9 +16,14 @@
</button>
</div>
<DebugLogTable
- :debug-log-list="debugLogList.sort((a, b) => b.RecordTs - a.RecordTs)"
+ :debug-log-list="
+ debugLogList.sort(
+ (a, b) =>
+ (b.recordTime?.getTime() ?? 0) - (a.recordTime?.getTime() ?? 0)
+ )
+ "
@view-detail="
- (log: any) => {
+ (log: DebugLog) => {
state.modalContent = log
state.showModal = true;
dialog!.open();
@@ -51,10 +56,8 @@
<NGi span="17">
<span v-if="value !== ''">
{{
- key === "RecordTs"
- ? dayjs
- .unix(value as number)
- .format("YYYY-MM-DD HH:mm:ss Z")
+ key === "recordTime"
+ ? dayjs(value as Date).format("YYYY-MM-DD HH:mm:ss Z")
: value
}}
</span>
@@ -81,12 +84,19 @@ import dayjs from "dayjs";
import { useClipboard } from "@vueuse/core";
import { BBDialog } from "@/bbkit";
import { useDebugLogList, useNotificationStore } from "@/store";
+import { DebugLog } from "@/types/proto/v1/actuator_service";
const dialog = ref<InstanceType<typeof BBDialog> | null>(null);
-const state = reactive({
+
+interface LocalState {
+ showModal: boolean;
+ modalContent?: DebugLog;
+}
+
+const state = reactive<LocalState>({
showModal: false,
- modalContent: {},
});
+
const logString = computed(() => {
return JSON.stringify(state.modalContent);
});
@@ -99,12 +109,12 @@ const notificationStore = useNotificationStore();
const debugLogList = useDebugLogList();
const logKeyMap = {
- RecordTs: t("debug-log.table.record-ts"),
- Method: t("debug-log.table.method"),
- RequestPath: t("debug-log.table.request-path"),
- Role: t("debug-log.table.role"),
- Error: t("debug-log.table.error"),
- StackTrace: t("debug-log.table.stack-trace"),
+ recordTime: t("debug-log.table.record-ts"),
+ method: t("debug-log.table.method"),
+ requestPath: t("debug-log.table.request-path"),
+ role: t("debug-log.table.role"),
+ error: t("debug-log.table.error"),
+ stackTrace: t("debug-log.table.stack-trace"),
};
const handleExport = () => {
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 4212263bad..dbc36c865d 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -5,8 +5,12 @@
- [v1/actuator_service.proto](#v1_actuator_service-proto)
- [ActuatorInfo](#bytebase-v1-ActuatorInfo)
+ - [DebugLog](#bytebase-v1-DebugLog)
- [DeleteCacheRequest](#bytebase-v1-DeleteCacheRequest)
- [GetActuatorInfoRequest](#bytebase-v1-GetActuatorInfoRequest)
+ - [ListDebugLogRequest](#bytebase-v1-ListDebugLogRequest)
+ - [ListDebugLogResponse](#bytebase-v1-ListDebugLogResponse)
+ - [UpdateActuatorInfoRequest](#bytebase-v1-UpdateActuatorInfoRequest)
- [ActuatorService](#bytebase-v1-ActuatorService)
@@ -510,6 +514,26 @@ Actuator concept is similar to the Spring Boot Actuator.
| require_2fa | [bool](#bool) | | require_2fa is the flag to require 2FA for all users. |
| workspace_id | [string](#string) | | workspace_id is the identifier for the workspace. |
| gitops_webhook_url | [string](#string) | | gitops_webhook_url is the webhook URL for GitOps. |
+| debug | [bool](#bool) | | debug flag means if the debug mode is enabled. |
+
+
+
+
+
+
+<a name="bytebase-v1-DebugLog"></a>
+
+### DebugLog
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| record_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+| request_path | [string](#string) | | |
+| role | [string](#string) | | |
+| error | [string](#string) | | |
+| stack_trace | [string](#string) | | |
@@ -535,6 +559,56 @@ Actuator concept is similar to the Spring Boot Actuator.
+
+<a name="bytebase-v1-ListDebugLogRequest"></a>
+
+### ListDebugLogRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| page_size | [int32](#int32) | | The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 50 logs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
+| page_token | [string](#string) | | A page token, received from a previous `ListDebugLog` call. Provide this to retrieve the subsequent page.
+
+When paginating, all other parameters provided to `ListDebugLog` must match the call that provided the page token. |
+
+
+
+
+
+
+<a name="bytebase-v1-ListDebugLogResponse"></a>
+
+### ListDebugLogResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| logs | [DebugLog](#bytebase-v1-DebugLog) | repeated | The logs from the specified request. |
+| next_page_token | [string](#string) | | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
+
+
+
+
+
+
+<a name="bytebase-v1-UpdateActuatorInfoRequest"></a>
+
+### UpdateActuatorInfoRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| actuator | [ActuatorInfo](#bytebase-v1-ActuatorInfo) | | The actuator to update. |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |
+
+
+
+
+
@@ -550,7 +624,9 @@ Actuator concept is similar to the Spring Boot Actuator.
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetActuatorInfo | [GetActuatorInfoRequest](#bytebase-v1-GetActuatorInfoRequest) | [ActuatorInfo](#bytebase-v1-ActuatorInfo) | |
+| UpdateActuatorInfo | [UpdateActuatorInfoRequest](#bytebase-v1-UpdateActuatorInfoRequest) | [ActuatorInfo](#bytebase-v1-ActuatorInfo) | |
| DeleteCache | [DeleteCacheRequest](#bytebase-v1-DeleteCacheRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
+| ListDebugLog | [ListDebugLogRequest](#bytebase-v1-ListDebugLogRequest) | [ListDebugLogResponse](#bytebase-v1-ListDebugLogResponse) | |
diff --git a/proto/generated-go/v1/actuator_service.pb.go b/proto/generated-go/v1/actuator_service.pb.go
index 6e586cea8c..90f4b316a6 100644
--- a/proto/generated-go/v1/actuator_service.pb.go
+++ b/proto/generated-go/v1/actuator_service.pb.go
@@ -11,6 +11,7 @@ import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
@@ -61,6 +62,264 @@ func (*GetActuatorInfoRequest) Descriptor() ([]byte, []int) {
return file_v1_actuator_service_proto_rawDescGZIP(), []int{0}
}
+type UpdateActuatorInfoRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The actuator to update.
+ Actuator *ActuatorInfo `protobuf:"bytes,1,opt,name=actuator,proto3" json:"actuator,omitempty"`
+ // The list of fields to update.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateActuatorInfoRequest) Reset() {
+ *x = UpdateActuatorInfoRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_actuator_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateActuatorInfoRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateActuatorInfoRequest) ProtoMessage() {}
+
+func (x *UpdateActuatorInfoRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_actuator_service_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UpdateActuatorInfoRequest.ProtoReflect.Descriptor instead.
+func (*UpdateActuatorInfoRequest) Descriptor() ([]byte, []int) {
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *UpdateActuatorInfoRequest) GetActuator() *ActuatorInfo {
+ if x != nil {
+ return x.Actuator
+ }
+ return nil
+}
+
+func (x *UpdateActuatorInfoRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+type ListDebugLogRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The maximum number of logs to return. The service may return fewer than
+ // this value.
+ // If unspecified, at most 50 logs will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // A page token, received from a previous `ListDebugLog` call.
+ // Provide this to retrieve the subsequent page.
+ //
+ // When paginating, all other parameters provided to `ListDebugLog` must match
+ // the call that provided the page token.
+ PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListDebugLogRequest) Reset() {
+ *x = ListDebugLogRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_actuator_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListDebugLogRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListDebugLogRequest) ProtoMessage() {}
+
+func (x *ListDebugLogRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_actuator_service_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ListDebugLogRequest.ProtoReflect.Descriptor instead.
+func (*ListDebugLogRequest) Descriptor() ([]byte, []int) {
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ListDebugLogRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListDebugLogRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+type ListDebugLogResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The logs from the specified request.
+ Logs []*DebugLog `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no subsequent pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListDebugLogResponse) Reset() {
+ *x = ListDebugLogResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_actuator_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListDebugLogResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListDebugLogResponse) ProtoMessage() {}
+
+func (x *ListDebugLogResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_actuator_service_proto_msgTypes[3]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ListDebugLogResponse.ProtoReflect.Descriptor instead.
+func (*ListDebugLogResponse) Descriptor() ([]byte, []int) {
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *ListDebugLogResponse) GetLogs() []*DebugLog {
+ if x != nil {
+ return x.Logs
+ }
+ return nil
+}
+
+func (x *ListDebugLogResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+type DebugLog struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ RecordTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=record_time,json=recordTime,proto3" json:"record_time,omitempty"`
+ RequestPath string `protobuf:"bytes,2,opt,name=request_path,json=requestPath,proto3" json:"request_path,omitempty"`
+ Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"`
+ Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
+ StackTrace string `protobuf:"bytes,5,opt,name=stack_trace,json=stackTrace,proto3" json:"stack_trace,omitempty"`
+}
+
+func (x *DebugLog) Reset() {
+ *x = DebugLog{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_actuator_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DebugLog) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DebugLog) ProtoMessage() {}
+
+func (x *DebugLog) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_actuator_service_proto_msgTypes[4]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use DebugLog.ProtoReflect.Descriptor instead.
+func (*DebugLog) Descriptor() ([]byte, []int) {
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *DebugLog) GetRecordTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.RecordTime
+ }
+ return nil
+}
+
+func (x *DebugLog) GetRequestPath() string {
+ if x != nil {
+ return x.RequestPath
+ }
+ return ""
+}
+
+func (x *DebugLog) GetRole() string {
+ if x != nil {
+ return x.Role
+ }
+ return ""
+}
+
+func (x *DebugLog) GetError() string {
+ if x != nil {
+ return x.Error
+ }
+ return ""
+}
+
+func (x *DebugLog) GetStackTrace() string {
+ if x != nil {
+ return x.StackTrace
+ }
+ return ""
+}
+
type DeleteCacheRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -70,7 +329,7 @@ type DeleteCacheRequest struct {
func (x *DeleteCacheRequest) Reset() {
*x = DeleteCacheRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_actuator_service_proto_msgTypes[1]
+ mi := &file_v1_actuator_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -83,7 +342,7 @@ func (x *DeleteCacheRequest) String() string {
func (*DeleteCacheRequest) ProtoMessage() {}
func (x *DeleteCacheRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_actuator_service_proto_msgTypes[1]
+ mi := &file_v1_actuator_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -96,7 +355,7 @@ func (x *DeleteCacheRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteCacheRequest.ProtoReflect.Descriptor instead.
func (*DeleteCacheRequest) Descriptor() ([]byte, []int) {
- return file_v1_actuator_service_proto_rawDescGZIP(), []int{1}
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{5}
}
// ServerInfo is the API message for server info.
@@ -134,12 +393,14 @@ type ActuatorInfo struct {
WorkspaceId string `protobuf:"bytes,13,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
// gitops_webhook_url is the webhook URL for GitOps.
GitopsWebhookUrl string `protobuf:"bytes,14,opt,name=gitops_webhook_url,json=gitopsWebhookUrl,proto3" json:"gitops_webhook_url,omitempty"`
+ // debug flag means if the debug mode is enabled.
+ Debug bool `protobuf:"varint,15,opt,name=debug,proto3" json:"debug,omitempty"`
}
func (x *ActuatorInfo) Reset() {
*x = ActuatorInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_actuator_service_proto_msgTypes[2]
+ mi := &file_v1_actuator_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -152,7 +413,7 @@ func (x *ActuatorInfo) String() string {
func (*ActuatorInfo) ProtoMessage() {}
func (x *ActuatorInfo) ProtoReflect() protoreflect.Message {
- mi := &file_v1_actuator_service_proto_msgTypes[2]
+ mi := &file_v1_actuator_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -165,7 +426,7 @@ func (x *ActuatorInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActuatorInfo.ProtoReflect.Descriptor instead.
func (*ActuatorInfo) Descriptor() ([]byte, []int) {
- return file_v1_actuator_service_proto_rawDescGZIP(), []int{2}
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{6}
}
func (x *ActuatorInfo) GetVersion() string {
@@ -266,6 +527,13 @@ func (x *ActuatorInfo) GetGitopsWebhookUrl() string {
return ""
}
+func (x *ActuatorInfo) GetDebug() bool {
+ if x != nil {
+ return x.Debug
+ }
+ return false
+}
+
var File_v1_actuator_service_proto protoreflect.FileDescriptor
var file_v1_actuator_service_proto_rawDesc = []byte{
@@ -278,64 +546,117 @@ var file_v1_actuator_service_proto_rawDesc = []byte{
0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c,
0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18,
- 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66,
- 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb0,
- 0x04, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12,
- 0x1d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22,
- 0x0a, 0x0a, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
- 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f,
- 0x6e, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x61, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x73, 0x61, 0x61, 0x73, 0x12, 0x20, 0x0a, 0x09,
- 0x64, 0x65, 0x6d, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x64, 0x65, 0x6d, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17,
- 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
- 0x03, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18,
- 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74,
- 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c,
- 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x74,
- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x2d, 0x0a, 0x10, 0x6e, 0x65, 0x65, 0x64,
- 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01,
- 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x41, 0x64, 0x6d,
- 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c,
- 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08,
- 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53,
- 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x63,
- 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03,
- 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65,
- 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x5f, 0x32, 0x66, 0x61, 0x18,
- 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75,
- 0x69, 0x72, 0x65, 0x32, 0x66, 0x61, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
- 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
- 0x03, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x31,
- 0x0a, 0x12, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
- 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
- 0x10, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x55, 0x72,
- 0x6c, 0x32, 0xe6, 0x01, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65,
- 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75,
- 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74,
- 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x75,
- 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x1c, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f,
+ 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66,
+ 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+ 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+ 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x22, 0x18, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49,
+ 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x19, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66,
+ 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x75,
+ 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f,
+ 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x61, 0x63, 0x74, 0x75,
+ 0x61, 0x74, 0x6f, 0x72, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c,
+ 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65,
+ 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a,
+ 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
+ 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61,
+ 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
+ 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x69, 0x0a, 0x14, 0x4c, 0x69, 0x73,
+ 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x12, 0x29, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65,
+ 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x26, 0x0a, 0x0f,
+ 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb5, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4c, 0x6f,
+ 0x67, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21,
+ 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x74,
+ 0x68, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12,
+ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x22, 0xc6, 0x04, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49,
+ 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0a, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x67, 0x69, 0x74,
+ 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e,
+ 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x72,
+ 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x61, 0x61, 0x73, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x73, 0x61, 0x61, 0x73,
+ 0x12, 0x20, 0x0a, 0x09, 0x64, 0x65, 0x6d, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x64, 0x65, 0x6d, 0x6f, 0x4e, 0x61,
+ 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x70,
+ 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04,
+ 0x70, 0x6f, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
+ 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x2d, 0x0a, 0x10,
+ 0x6e, 0x65, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70,
+ 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6e, 0x65, 0x65,
+ 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x0f, 0x64,
+ 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x0a,
+ 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x6c, 0x61, 0x73,
+ 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65,
+ 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x5f,
+ 0x32, 0x66, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a,
+ 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x32, 0x66, 0x61, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x6f,
+ 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
+ 0x49, 0x64, 0x12, 0x31, 0x0a, 0x12, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x5f, 0x77, 0x65, 0x62,
+ 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x52, 0x10, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x57, 0x65, 0x62, 0x68, 0x6f,
+ 0x6f, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x0f,
+ 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x32, 0xf0, 0x03, 0x0a, 0x0f,
+ 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
+ 0x6f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e,
+ 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e,
+ 0x66, 0x6f, 0x22, 0x1c, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f,
+ 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f,
+ 0x12, 0x93, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x75, 0x61,
+ 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x75,
+ 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63,
+ 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x3a, 0xda, 0x41, 0x14, 0x61,
+ 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x08, 0x61, 0x63, 0x74, 0x75, 0x61,
+ 0x74, 0x6f, 0x72, 0x32, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f,
0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x62, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75,
- 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65,
- 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x4c, 0x69,
+ 0x73, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x62,
+ 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44,
+ 0x65, 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x1d, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f,
+ 0x61, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x42, 0x11,
+ 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76,
+ 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -350,25 +671,38 @@ func file_v1_actuator_service_proto_rawDescGZIP() []byte {
return file_v1_actuator_service_proto_rawDescData
}
-var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_v1_actuator_service_proto_goTypes = []interface{}{
- (*GetActuatorInfoRequest)(nil), // 0: bytebase.v1.GetActuatorInfoRequest
- (*DeleteCacheRequest)(nil), // 1: bytebase.v1.DeleteCacheRequest
- (*ActuatorInfo)(nil), // 2: bytebase.v1.ActuatorInfo
- (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
- (*emptypb.Empty)(nil), // 4: google.protobuf.Empty
+ (*GetActuatorInfoRequest)(nil), // 0: bytebase.v1.GetActuatorInfoRequest
+ (*UpdateActuatorInfoRequest)(nil), // 1: bytebase.v1.UpdateActuatorInfoRequest
+ (*ListDebugLogRequest)(nil), // 2: bytebase.v1.ListDebugLogRequest
+ (*ListDebugLogResponse)(nil), // 3: bytebase.v1.ListDebugLogResponse
+ (*DebugLog)(nil), // 4: bytebase.v1.DebugLog
+ (*DeleteCacheRequest)(nil), // 5: bytebase.v1.DeleteCacheRequest
+ (*ActuatorInfo)(nil), // 6: bytebase.v1.ActuatorInfo
+ (*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
+ (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
+ (*emptypb.Empty)(nil), // 9: google.protobuf.Empty
}
var file_v1_actuator_service_proto_depIdxs = []int32{
- 3, // 0: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
- 0, // 1: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
- 1, // 2: bytebase.v1.ActuatorService.DeleteCache:input_type -> bytebase.v1.DeleteCacheRequest
- 2, // 3: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
- 4, // 4: bytebase.v1.ActuatorService.DeleteCache:output_type -> google.protobuf.Empty
- 3, // [3:5] is the sub-list for method output_type
- 1, // [1:3] is the sub-list for method input_type
- 1, // [1:1] is the sub-list for extension type_name
- 1, // [1:1] is the sub-list for extension extendee
- 0, // [0:1] is the sub-list for field type_name
+ 6, // 0: bytebase.v1.UpdateActuatorInfoRequest.actuator:type_name -> bytebase.v1.ActuatorInfo
+ 7, // 1: bytebase.v1.UpdateActuatorInfoRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 4, // 2: bytebase.v1.ListDebugLogResponse.logs:type_name -> bytebase.v1.DebugLog
+ 8, // 3: bytebase.v1.DebugLog.record_time:type_name -> google.protobuf.Timestamp
+ 8, // 4: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
+ 0, // 5: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
+ 1, // 6: bytebase.v1.ActuatorService.UpdateActuatorInfo:input_type -> bytebase.v1.UpdateActuatorInfoRequest
+ 5, // 7: bytebase.v1.ActuatorService.DeleteCache:input_type -> bytebase.v1.DeleteCacheRequest
+ 2, // 8: bytebase.v1.ActuatorService.ListDebugLog:input_type -> bytebase.v1.ListDebugLogRequest
+ 6, // 9: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
+ 6, // 10: bytebase.v1.ActuatorService.UpdateActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
+ 9, // 11: bytebase.v1.ActuatorService.DeleteCache:output_type -> google.protobuf.Empty
+ 3, // 12: bytebase.v1.ActuatorService.ListDebugLog:output_type -> bytebase.v1.ListDebugLogResponse
+ 9, // [9:13] is the sub-list for method output_type
+ 5, // [5:9] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
}
func init() { file_v1_actuator_service_proto_init() }
@@ -390,7 +724,7 @@ func file_v1_actuator_service_proto_init() {
}
}
file_v1_actuator_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeleteCacheRequest); i {
+ switch v := v.(*UpdateActuatorInfoRequest); i {
case 0:
return &v.state
case 1:
@@ -402,6 +736,54 @@ func file_v1_actuator_service_proto_init() {
}
}
file_v1_actuator_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListDebugLogRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_actuator_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListDebugLogResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_actuator_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DebugLog); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_actuator_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteCacheRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_actuator_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActuatorInfo); i {
case 0:
return &v.state
@@ -420,7 +802,7 @@ func file_v1_actuator_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_actuator_service_proto_rawDesc,
NumEnums: 0,
- NumMessages: 3,
+ NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/generated-go/v1/actuator_service.pb.gw.go b/proto/generated-go/v1/actuator_service.pb.gw.go
index 5ada68e7ba..97fa04db18 100644
--- a/proto/generated-go/v1/actuator_service.pb.gw.go
+++ b/proto/generated-go/v1/actuator_service.pb.gw.go
@@ -49,6 +49,72 @@ func local_request_ActuatorService_GetActuatorInfo_0(ctx context.Context, marsha
}
+var (
+ filter_ActuatorService_UpdateActuatorInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{"actuator": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}}
+)
+
+func request_ActuatorService_UpdateActuatorInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ActuatorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateActuatorInfoRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Actuator); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Actuator); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ActuatorService_UpdateActuatorInfo_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.UpdateActuatorInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_ActuatorService_UpdateActuatorInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ActuatorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateActuatorInfoRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Actuator); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Actuator); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ActuatorService_UpdateActuatorInfo_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.UpdateActuatorInfo(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_ActuatorService_DeleteCache_0(ctx context.Context, marshaler runtime.Marshaler, client ActuatorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteCacheRequest
var metadata runtime.ServerMetadata
@@ -67,6 +133,42 @@ func local_request_ActuatorService_DeleteCache_0(ctx context.Context, marshaler
}
+var (
+ filter_ActuatorService_ListDebugLog_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_ActuatorService_ListDebugLog_0(ctx context.Context, marshaler runtime.Marshaler, client ActuatorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ListDebugLogRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ActuatorService_ListDebugLog_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.ListDebugLog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_ActuatorService_ListDebugLog_0(ctx context.Context, marshaler runtime.Marshaler, server ActuatorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ListDebugLogRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ActuatorService_ListDebugLog_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ListDebugLog(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
// RegisterActuatorServiceHandlerServer registers the http handlers for service ActuatorService to "mux".
// UnaryRPC :call ActuatorServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -98,6 +200,31 @@ func RegisterActuatorServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("PATCH", pattern_ActuatorService_UpdateActuatorInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ActuatorService/UpdateActuatorInfo", runtime.WithHTTPPathPattern("/v1/actuator/info"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_ActuatorService_UpdateActuatorInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ActuatorService_UpdateActuatorInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("DELETE", pattern_ActuatorService_DeleteCache_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -123,6 +250,31 @@ func RegisterActuatorServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("GET", pattern_ActuatorService_ListDebugLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ActuatorService/ListDebugLog", runtime.WithHTTPPathPattern("/v1/actuator/debug"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_ActuatorService_ListDebugLog_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ActuatorService_ListDebugLog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -186,6 +338,28 @@ func RegisterActuatorServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("PATCH", pattern_ActuatorService_UpdateActuatorInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ActuatorService/UpdateActuatorInfo", runtime.WithHTTPPathPattern("/v1/actuator/info"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_ActuatorService_UpdateActuatorInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ActuatorService_UpdateActuatorInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("DELETE", pattern_ActuatorService_DeleteCache_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -208,17 +382,47 @@ func RegisterActuatorServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("GET", pattern_ActuatorService_ListDebugLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ActuatorService/ListDebugLog", runtime.WithHTTPPathPattern("/v1/actuator/debug"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_ActuatorService_ListDebugLog_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ActuatorService_ListDebugLog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
var (
pattern_ActuatorService_GetActuatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "actuator", "info"}, ""))
+ pattern_ActuatorService_UpdateActuatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "actuator", "info"}, ""))
+
pattern_ActuatorService_DeleteCache_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "actuator", "cache"}, ""))
+
+ pattern_ActuatorService_ListDebugLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "actuator", "debug"}, ""))
)
var (
forward_ActuatorService_GetActuatorInfo_0 = runtime.ForwardResponseMessage
+ forward_ActuatorService_UpdateActuatorInfo_0 = runtime.ForwardResponseMessage
+
forward_ActuatorService_DeleteCache_0 = runtime.ForwardResponseMessage
+
+ forward_ActuatorService_ListDebugLog_0 = runtime.ForwardResponseMessage
)
diff --git a/proto/generated-go/v1/actuator_service_grpc.pb.go b/proto/generated-go/v1/actuator_service_grpc.pb.go
index abb5528ab7..96e580bbec 100644
--- a/proto/generated-go/v1/actuator_service_grpc.pb.go
+++ b/proto/generated-go/v1/actuator_service_grpc.pb.go
@@ -20,8 +20,10 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
- ActuatorService_GetActuatorInfo_FullMethodName = "/bytebase.v1.ActuatorService/GetActuatorInfo"
- ActuatorService_DeleteCache_FullMethodName = "/bytebase.v1.ActuatorService/DeleteCache"
+ ActuatorService_GetActuatorInfo_FullMethodName = "/bytebase.v1.ActuatorService/GetActuatorInfo"
+ ActuatorService_UpdateActuatorInfo_FullMethodName = "/bytebase.v1.ActuatorService/UpdateActuatorInfo"
+ ActuatorService_DeleteCache_FullMethodName = "/bytebase.v1.ActuatorService/DeleteCache"
+ ActuatorService_ListDebugLog_FullMethodName = "/bytebase.v1.ActuatorService/ListDebugLog"
)
// ActuatorServiceClient is the client API for ActuatorService service.
@@ -29,7 +31,9 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ActuatorServiceClient interface {
GetActuatorInfo(ctx context.Context, in *GetActuatorInfoRequest, opts ...grpc.CallOption) (*ActuatorInfo, error)
+ UpdateActuatorInfo(ctx context.Context, in *UpdateActuatorInfoRequest, opts ...grpc.CallOption) (*ActuatorInfo, error)
DeleteCache(ctx context.Context, in *DeleteCacheRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ ListDebugLog(ctx context.Context, in *ListDebugLogRequest, opts ...grpc.CallOption) (*ListDebugLogResponse, error)
}
type actuatorServiceClient struct {
@@ -49,6 +53,15 @@ func (c *actuatorServiceClient) GetActuatorInfo(ctx context.Context, in *GetActu
return out, nil
}
+func (c *actuatorServiceClient) UpdateActuatorInfo(ctx context.Context, in *UpdateActuatorInfoRequest, opts ...grpc.CallOption) (*ActuatorInfo, error) {
+ out := new(ActuatorInfo)
+ err := c.cc.Invoke(ctx, ActuatorService_UpdateActuatorInfo_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *actuatorServiceClient) DeleteCache(ctx context.Context, in *DeleteCacheRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, ActuatorService_DeleteCache_FullMethodName, in, out, opts...)
@@ -58,12 +71,23 @@ func (c *actuatorServiceClient) DeleteCache(ctx context.Context, in *DeleteCache
return out, nil
}
+func (c *actuatorServiceClient) ListDebugLog(ctx context.Context, in *ListDebugLogRequest, opts ...grpc.CallOption) (*ListDebugLogResponse, error) {
+ out := new(ListDebugLogResponse)
+ err := c.cc.Invoke(ctx, ActuatorService_ListDebugLog_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// ActuatorServiceServer is the server API for ActuatorService service.
// All implementations must embed UnimplementedActuatorServiceServer
// for forward compatibility
type ActuatorServiceServer interface {
GetActuatorInfo(context.Context, *GetActuatorInfoRequest) (*ActuatorInfo, error)
+ UpdateActuatorInfo(context.Context, *UpdateActuatorInfoRequest) (*ActuatorInfo, error)
DeleteCache(context.Context, *DeleteCacheRequest) (*emptypb.Empty, error)
+ ListDebugLog(context.Context, *ListDebugLogRequest) (*ListDebugLogResponse, error)
mustEmbedUnimplementedActuatorServiceServer()
}
@@ -74,9 +98,15 @@ type UnimplementedActuatorServiceServer struct {
func (UnimplementedActuatorServiceServer) GetActuatorInfo(context.Context, *GetActuatorInfoRequest) (*ActuatorInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetActuatorInfo not implemented")
}
+func (UnimplementedActuatorServiceServer) UpdateActuatorInfo(context.Context, *UpdateActuatorInfoRequest) (*ActuatorInfo, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateActuatorInfo not implemented")
+}
func (UnimplementedActuatorServiceServer) DeleteCache(context.Context, *DeleteCacheRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteCache not implemented")
}
+func (UnimplementedActuatorServiceServer) ListDebugLog(context.Context, *ListDebugLogRequest) (*ListDebugLogResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListDebugLog not implemented")
+}
func (UnimplementedActuatorServiceServer) mustEmbedUnimplementedActuatorServiceServer() {}
// UnsafeActuatorServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -108,6 +138,24 @@ func _ActuatorService_GetActuatorInfo_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
+func _ActuatorService_UpdateActuatorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateActuatorInfoRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ActuatorServiceServer).UpdateActuatorInfo(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: ActuatorService_UpdateActuatorInfo_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ActuatorServiceServer).UpdateActuatorInfo(ctx, req.(*UpdateActuatorInfoRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _ActuatorService_DeleteCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteCacheRequest)
if err := dec(in); err != nil {
@@ -126,6 +174,24 @@ func _ActuatorService_DeleteCache_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
+func _ActuatorService_ListDebugLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListDebugLogRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ActuatorServiceServer).ListDebugLog(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: ActuatorService_ListDebugLog_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ActuatorServiceServer).ListDebugLog(ctx, req.(*ListDebugLogRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
// ActuatorService_ServiceDesc is the grpc.ServiceDesc for ActuatorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -137,10 +203,18 @@ var ActuatorService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetActuatorInfo",
Handler: _ActuatorService_GetActuatorInfo_Handler,
},
+ {
+ MethodName: "UpdateActuatorInfo",
+ Handler: _ActuatorService_UpdateActuatorInfo_Handler,
+ },
{
MethodName: "DeleteCache",
Handler: _ActuatorService_DeleteCache_Handler,
},
+ {
+ MethodName: "ListDebugLog",
+ Handler: _ActuatorService_ListDebugLog_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "v1/actuator_service.proto",
diff --git a/proto/v1/actuator_service.proto b/proto/v1/actuator_service.proto
index bc35a7286d..ff73c27cbb 100644
--- a/proto/v1/actuator_service.proto
+++ b/proto/v1/actuator_service.proto
@@ -6,6 +6,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/empty.proto";
+import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "generated-go/v1";
@@ -16,13 +17,70 @@ service ActuatorService {
option (google.api.method_signature) = "";
}
+ rpc UpdateActuatorInfo(UpdateActuatorInfoRequest) returns (ActuatorInfo) {
+ option (google.api.http) = {
+ patch: "/v1/actuator/info"
+ body: "actuator"
+ };
+ option (google.api.method_signature) = "actuator,update_mask";
+ }
+
rpc DeleteCache(DeleteCacheRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/v1/actuator/cache"};
}
+
+ rpc ListDebugLog(ListDebugLogRequest) returns (ListDebugLogResponse) {
+ option (google.api.http) = {get: "/v1/actuator/debug"};
+ option (google.api.method_signature) = "";
+ }
}
message GetActuatorInfoRequest {}
+message UpdateActuatorInfoRequest {
+ // The actuator to update.
+ ActuatorInfo actuator = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The list of fields to update.
+ google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
+}
+
+message ListDebugLogRequest {
+ // The maximum number of logs to return. The service may return fewer than
+ // this value.
+ // If unspecified, at most 50 logs will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
+ int32 page_size = 1;
+
+ // A page token, received from a previous `ListDebugLog` call.
+ // Provide this to retrieve the subsequent page.
+ //
+ // When paginating, all other parameters provided to `ListDebugLog` must match
+ // the call that provided the page token.
+ string page_token = 2;
+}
+
+message ListDebugLogResponse {
+ // The logs from the specified request.
+ repeated DebugLog logs = 1;
+
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no subsequent pages.
+ string next_page_token = 2;
+}
+
+message DebugLog {
+ google.protobuf.Timestamp record_time = 1;
+
+ string request_path = 2;
+
+ string role = 3;
+
+ string error = 4;
+
+ string stack_trace = 5;
+}
+
message DeleteCacheRequest {}
// ServerInfo is the API message for server info.
@@ -69,4 +127,7 @@ message ActuatorInfo {
// gitops_webhook_url is the webhook URL for GitOps.
string gitops_webhook_url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // debug flag means if the debug mode is enabled.
+ bool debug = 15;
}