diff --git a/WORKSPACE.yaml b/WORKSPACE.yaml index 1583d12775fb12..d23804137c4732 100644 --- a/WORKSPACE.yaml +++ b/WORKSPACE.yaml @@ -12,7 +12,7 @@ defaultArgs: jetbrainsBackendQualifier: stable intellijDownloadUrl: "https://download.jetbrains.com/idea/ideaIU-2022.1.1.tar.gz" golandDownloadUrl: "https://download.jetbrains.com/go/goland-2022.1.tar.gz" - pycharmDownloadUrl: "https://download.jetbrains.com/python/pycharm-professional-2022.1.tar.gz" + pycharmDownloadUrl: "https://download.jetbrains.com/python/pycharm-professional-2022.1.1.tar.gz" phpstormDownloadUrl: "https://download.jetbrains.com/webide/PhpStorm-2022.1.1.tar.gz" provenance: enabled: true diff --git a/components/BUILD.yaml b/components/BUILD.yaml index 13edf607ec8241..1408708f00b803 100644 --- a/components/BUILD.yaml +++ b/components/BUILD.yaml @@ -86,6 +86,7 @@ packages: - components/supervisor-api/typescript-grpc:publish - components/supervisor-api/typescript-grpcweb:publish - components/ide/jetbrains/gateway-plugin:publish + - components/public-api/typescript:publish - name: all-apps type: generic deps: diff --git a/components/common-go/baseserver/server.go b/components/common-go/baseserver/server.go index d56f0ba1eb7500..817f169878e80b 100644 --- a/components/common-go/baseserver/server.go +++ b/components/common-go/baseserver/server.go @@ -27,6 +27,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/reflection" ) func New(name string, opts ...Option) (*Server, error) { @@ -291,6 +292,8 @@ func (s *Server) initializeGRPC() error { s.grpc = grpc.NewServer(opts...) + reflection.Register(s.grpc) + // Register health service by default grpc_health_v1.RegisterHealthServer(s.grpc, s.options.grpcHealthCheck) diff --git a/components/dashboard/package.json b/components/dashboard/package.json index 964659327f970b..6eb8f459a25f77 100644 --- a/components/dashboard/package.json +++ b/components/dashboard/package.json @@ -5,6 +5,7 @@ "private": true, "dependencies": { "@gitpod/gitpod-protocol": "0.1.5", + "configcat-js": "^5.7.2", "countries-list": "^2.6.1", "js-cookie": "^3.0.1", "moment": "^2.29.1", diff --git a/components/dashboard/src/experiments/always-default.ts b/components/dashboard/src/experiments/always-default.ts new file mode 100644 index 00000000000000..cfd8b5bb59888d --- /dev/null +++ b/components/dashboard/src/experiments/always-default.ts @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ +import { Attributes, Client } from "./client"; + +// AlwaysReturningDefaultValueClient is an implemention of an experiments.Client which performs no lookup/network operation +// and always returns the default value for a given experimentName. +// This client is used for non-SaaS version of Gitpod, in particular for self-hosted installations where external +// network connections are not desirable or even possible. +class AlwaysReturningDefaultValueClient implements Client { + getValueAsync(experimentName: string, defaultValue: T, attributes: Attributes): Promise { + return Promise.resolve(defaultValue); + } + + dispose(): void { + // there is nothing to dispose, no-op. + } +} + +export function newAlwaysReturningDefaultValueClient(): Client { + return new AlwaysReturningDefaultValueClient(); +} diff --git a/components/dashboard/src/experiments/client.ts b/components/dashboard/src/experiments/client.ts new file mode 100644 index 00000000000000..daa1d0398b265e --- /dev/null +++ b/components/dashboard/src/experiments/client.ts @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +// Attributes define attributes which can be used to segment audiences. +// Set the attributes which you want to use to group audiences into. +import { newNonProductionConfigCatClient, newProductionConfigCatClient } from "./configcat"; +import { newAlwaysReturningDefaultValueClient } from "./always-default"; + +export interface Attributes { + userID?: string; + email?: string; + + // Gitpod Project ID + projectID?: string; + + // Gitpod Team ID + teamID?: string; + // Gitpod Team Name + teamName?: string; +} + +export interface Client { + getValueAsync(experimentName: string, defaultValue: T, attributes: Attributes): Promise; + + // dispose will dispose of the client, no longer retrieving flags + dispose(): void; +} + +let client: Client | undefined; + +export function getExperimentsClient(): Client { + // We have already instantiated a client, we can just re-use it. + if (client !== undefined) { + return client; + } + + const host = window.location.hostname; + if (host === "gitpod.io") { + client = newProductionConfigCatClient(); + } else if (host === "gitpod-staging.com" || host.endsWith("gitpod-dev.com") || host.endsWith("gitpod-io-dev.com")) { + client = newNonProductionConfigCatClient(); + } else { + // We're gonna use a client which always returns the default value. + client = newAlwaysReturningDefaultValueClient(); + } + + return client; +} + +export const PROJECT_ID_ATTRIBUTE = "project_id"; +export const TEAM_ID_ATTRIBUTE = "team_id"; +export const TEAM_NAME_ATTRIBUTE = "team_name"; diff --git a/components/dashboard/src/experiments/configcat.ts b/components/dashboard/src/experiments/configcat.ts new file mode 100644 index 00000000000000..397b71aff0c00d --- /dev/null +++ b/components/dashboard/src/experiments/configcat.ts @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +import * as configcat from "configcat-js"; +import { IConfigCatClient } from "configcat-common/lib/ConfigCatClient"; +import { User } from "configcat-common/lib/RolloutEvaluator"; +import { Attributes, Client, PROJECT_ID_ATTRIBUTE, TEAM_ID_ATTRIBUTE, TEAM_NAME_ATTRIBUTE } from "./client"; + +// newProductionConfigCatClient constructs a new ConfigCat client with production configuration. +// DO NOT USE DIRECTLY! Use getExperimentsClient() instead. +export function newProductionConfigCatClient(): Client { + // clientKey is an identifier of our ConfigCat application. It is not a secret. + const clientKey = "WBLaCPtkjkqKHlHedziE9g/TwAe6YyftEGPnGxVRXd0Ig"; + const client = configcat.createClient(clientKey, { + logger: configcat.createConsoleLogger(2), + }); + + return new ConfigCatClient(client); +} + +// newNonProductionConfigCatClient constructs a new ConfigCat client with non-production configuration. +// DO NOT USE DIRECTLY! Use getExperimentsClient() instead. +export function newNonProductionConfigCatClient(): Client { + // clientKey is an identifier of our ConfigCat application. It is not a secret. + const clientKey = "WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw"; + const client = configcat.createClient(clientKey, { + pollIntervalSeconds: 60 * 3, // 3 minutes + logger: configcat.createConsoleLogger(3), + }); + + return new ConfigCatClient(client); +} + +class ConfigCatClient implements Client { + private client: IConfigCatClient; + + constructor(cc: IConfigCatClient) { + this.client = cc; + } + + getValueAsync(experimentName: string, defaultValue: T, attributes: Attributes): Promise { + return this.client.getValueAsync(experimentName, defaultValue, attributesToUser(attributes)); + } + + dispose(): void { + return this.client.dispose(); + } +} + +function attributesToUser(attributes: Attributes): User { + const userID = attributes.userID || ""; + const email = attributes.email || ""; + + const custom: { [key: string]: string } = {}; + if (attributes.projectID) { + custom[PROJECT_ID_ATTRIBUTE] = attributes.projectID; + } + if (attributes.teamID) { + custom[TEAM_ID_ATTRIBUTE] = attributes.teamID; + } + if (attributes.teamName) { + custom[TEAM_NAME_ATTRIBUTE] = attributes.teamName; + } + + return new User(userID, email, "", custom); +} diff --git a/components/dashboard/src/workspaces/Workspaces.tsx b/components/dashboard/src/workspaces/Workspaces.tsx index 2ca855c2187b9c..e8cbb279d1cc37 100644 --- a/components/dashboard/src/workspaces/Workspaces.tsx +++ b/components/dashboard/src/workspaces/Workspaces.tsx @@ -18,6 +18,7 @@ import { User } from "@gitpod/gitpod-protocol"; import { useLocation } from "react-router"; import { StartWorkspaceModalContext, StartWorkspaceModalKeyBinding } from "./start-workspace-modal-context"; import SelectIDEModal from "../settings/SelectIDEModal"; +import { getExperimentsClient } from "../experiments/client"; export interface WorkspacesProps {} @@ -36,6 +37,7 @@ export default function () { const [inactiveWorkspaces, setInactiveWorkspaces] = useState([]); const [workspaceModel, setWorkspaceModel] = useState(); const { setIsStartWorkspaceModalVisible } = useContext(StartWorkspaceModalContext); + const [isExperimentEnabled, setExperiment] = useState(false); useEffect(() => { (async () => { @@ -45,13 +47,22 @@ export default function () { }, [teams, location]); const isOnboardingUser = user && User.isOnboardingUser(user); + useEffect(() => { + (async () => { + if (teams && teams.length > 0) { + const isEnabled = await getExperimentsClient().getValueAsync("isMyFirstFeatureEnabled", false, { + teamName: teams[0]?.name, + }); + setExperiment(isEnabled); + } + })(); + }, [teams]); + console.log("Is experiment enabled? ", isExperimentEnabled); return ( <>
- {isOnboardingUser && } - {workspaceModel?.initialized && (activeWorkspaces.length > 0 || inactiveWorkspaces.length > 0 || workspaceModel.searchTerm ? ( <> diff --git a/components/public-api/typescript/BUILD.yaml b/components/public-api/typescript/BUILD.yaml index c222f5cac9d735..79cf1afd147027 100644 --- a/components/public-api/typescript/BUILD.yaml +++ b/components/public-api/typescript/BUILD.yaml @@ -4,9 +4,9 @@ packages: deps: - components/gitpod-protocol:lib srcs: - - "src/*.ts" - - "src/*.js" + - src/** - package.json + - tsconfig.json config: packaging: library dontTest: true @@ -14,3 +14,16 @@ packages: build: ["yarn", "build"] yarnLock: ${coreYarnLockBase}/../yarn.lock tsconfig: tsconfig.json + + - name: publish + type: generic + env: + - DO_PUBLISH=${publishToNPM} + argdeps: + - npmPublishTrigger + deps: + - :lib + - components/gitpod-protocol:scripts + config: + commands: + - ["node", "components-gitpod-protocol--scripts/publish.js", "${version}", "components-public-api-typescript--lib/package"] diff --git a/components/public-api/typescript/package.json b/components/public-api/typescript/package.json index ba30c29c7372cf..1f590fab3841c3 100644 --- a/components/public-api/typescript/package.json +++ b/components/public-api/typescript/package.json @@ -1,10 +1,8 @@ { - "private": true, "name": "@gitpod/public-api", "version": "0.1.5", "license": "UNLICENSED", "files": [ - "client", "lib" ], "scripts": { @@ -14,11 +12,9 @@ "test:brk": "yarn test --inspect-brk" }, "dependencies": { - "@gitpod/content-service": "0.1.5", "@gitpod/gitpod-protocol": "0.1.5", "@grpc/grpc-js": "^1.3.7", "google-protobuf": "^3.19.1", - "inversify": "^5.0.1", "opentracing": "^0.14.4" }, "devDependencies": { diff --git a/components/public-api/typescript/src/gitpod/v1/pagination_grpc_pb.js b/components/public-api/typescript/src/gitpod/v1/pagination_grpc_pb.js index 97b3a2461dbeac..73b62953a5c701 100644 --- a/components/public-api/typescript/src/gitpod/v1/pagination_grpc_pb.js +++ b/components/public-api/typescript/src/gitpod/v1/pagination_grpc_pb.js @@ -1 +1,7 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +// GENERATED CODE -- NO SERVICES IN PROTO diff --git a/components/public-api/typescript/src/gitpod/v1/pagination_pb.d.ts b/components/public-api/typescript/src/gitpod/v1/pagination_pb.d.ts index 02189ceda7f94f..b8f59e54acb9fa 100644 --- a/components/public-api/typescript/src/gitpod/v1/pagination_pb.d.ts +++ b/components/public-api/typescript/src/gitpod/v1/pagination_pb.d.ts @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // package: gitpod.v1 // file: gitpod/v1/pagination.proto diff --git a/components/public-api/typescript/src/gitpod/v1/pagination_pb.js b/components/public-api/typescript/src/gitpod/v1/pagination_pb.js index 93350dc151cf67..7e9712ffa4e8c0 100644 --- a/components/public-api/typescript/src/gitpod/v1/pagination_pb.js +++ b/components/public-api/typescript/src/gitpod/v1/pagination_pb.js @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // source: gitpod/v1/pagination.proto /** * @fileoverview diff --git a/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.d.ts b/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.d.ts index 8c7b44127e2a2f..5a63c51fd2c655 100644 --- a/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.d.ts +++ b/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.d.ts @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // package: gitpod.v1 // file: gitpod/v1/prebuilds.proto diff --git a/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.js b/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.js index 109f85462bcd2f..011e797b3dc044 100644 --- a/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.js +++ b/components/public-api/typescript/src/gitpod/v1/prebuilds_grpc_pb.js @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // GENERATED CODE -- DO NOT EDIT! 'use strict'; diff --git a/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.d.ts b/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.d.ts index 39144bfeaf5fca..802a4e97cc4c5a 100644 --- a/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.d.ts +++ b/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.d.ts @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // package: gitpod.v1 // file: gitpod/v1/prebuilds.proto diff --git a/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.js b/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.js index 5df3f80ed23bca..fba52106e33dd3 100644 --- a/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.js +++ b/components/public-api/typescript/src/gitpod/v1/prebuilds_pb.js @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // source: gitpod/v1/prebuilds.proto /** * @fileoverview diff --git a/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.d.ts b/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.d.ts index c3b61dba73ce96..1bb3a36e4f33a4 100644 --- a/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.d.ts +++ b/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.d.ts @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // package: gitpod.v1 // file: gitpod/v1/workspaces.proto diff --git a/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.js b/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.js index 8c5343d1fa2402..3912cb60f821e4 100644 --- a/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.js +++ b/components/public-api/typescript/src/gitpod/v1/workspaces_grpc_pb.js @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // GENERATED CODE -- DO NOT EDIT! 'use strict'; diff --git a/components/public-api/typescript/src/gitpod/v1/workspaces_pb.d.ts b/components/public-api/typescript/src/gitpod/v1/workspaces_pb.d.ts index 0de486d69b867b..027dc255633c48 100644 --- a/components/public-api/typescript/src/gitpod/v1/workspaces_pb.d.ts +++ b/components/public-api/typescript/src/gitpod/v1/workspaces_pb.d.ts @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // package: gitpod.v1 // file: gitpod/v1/workspaces.proto diff --git a/components/public-api/typescript/src/gitpod/v1/workspaces_pb.js b/components/public-api/typescript/src/gitpod/v1/workspaces_pb.js index f5e5f6bb386762..b78833af5df4c5 100644 --- a/components/public-api/typescript/src/gitpod/v1/workspaces_pb.js +++ b/components/public-api/typescript/src/gitpod/v1/workspaces_pb.js @@ -1,3 +1,9 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + // source: gitpod/v1/workspaces.proto /** * @fileoverview diff --git a/components/server/package.json b/components/server/package.json index 0117d9da5ab808..dce5f3a1d7bc00 100644 --- a/components/server/package.json +++ b/components/server/package.json @@ -46,6 +46,7 @@ "base-64": "^1.0.0", "bitbucket": "^2.7.0", "body-parser": "^1.19.2", + "configcat-node": "^6.7.1", "cookie": "^0.4.2", "cookie-parser": "^1.4.6", "cors": "^2.8.4", diff --git a/components/server/src/experiments.ts b/components/server/src/experiments.ts new file mode 100644 index 00000000000000..e428b83aed7048 --- /dev/null +++ b/components/server/src/experiments.ts @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +import * as configcat from "configcat-node"; +import { IConfigCatClient } from "configcat-common/lib/ConfigCatClient"; + +let logger = configcat.createConsoleLogger(3); // Setting log level to 3 (Info) +let client: IConfigCatClient | undefined; + +export function getExperimentsClient(): IConfigCatClient { + if (client === undefined) { + client = configcat.createClient("WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw", { + // <-- This is the actual SDK Key for your Test environment + logger: logger, + }); + } + + return client; +} diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 7b81f3d7ad96ba..7e0ed826900885 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -161,6 +161,7 @@ import { Deferred } from "@gitpod/gitpod-protocol/lib/util/deferred"; import { InstallationAdminTelemetryDataProvider } from "../installation-admin/telemetry-data-provider"; import { LicenseEvaluator } from "@gitpod/licensor/lib"; import { Feature } from "@gitpod/licensor/lib/api"; +import { getExperimentsClient } from "../experiments"; // shortcut export const traceWI = (ctx: TraceContext, wi: Omit) => TraceContext.setOWI(ctx, wi); // userId is already taken care of in WebsocketConnectionManager @@ -2135,6 +2136,20 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { // Anyone who can read a team's information (i.e. any team member) can create a new project. await this.guardTeamOperation(params.teamId, "get"); } + + const isFeatureEnabled = await getExperimentsClient().getValueAsync("isMyFirstFeatureEnabled", false, { + identifier: user.id, + custom: { + project_name: params.name, + }, + }); + if (isFeatureEnabled) { + throw new ResponseError( + ErrorCodes.NOT_FOUND, + `Feature is disabled for this user or project - sample usage of experiements`, + ); + } + const project = this.projectsService.createProject(params, user); this.analytics.track({ userId: user.id, diff --git a/components/supervisor/pkg/supervisor/supervisor.go b/components/supervisor/pkg/supervisor/supervisor.go index 78d1ea5f86d234..2bf6db0e6d169a 100644 --- a/components/supervisor/pkg/supervisor/supervisor.go +++ b/components/supervisor/pkg/supervisor/supervisor.go @@ -57,9 +57,7 @@ import ( "github.com/gitpod-io/gitpod/supervisor/pkg/ports" "github.com/gitpod-io/gitpod/supervisor/pkg/terminal" - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" dto "github.com/prometheus/client_model/go" "github.com/prometheus/pushgateway/handler" @@ -1048,13 +1046,6 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv ) } - grpcMetrics := grpc_prometheus.NewServerMetrics() - grpcMetrics.EnableHandlingTimeHistogram() - opts = append(opts, - grpc.StreamInterceptor(grpcMetrics.StreamServerInterceptor()), - grpc.UnaryInterceptor(grpcMetrics.UnaryServerInterceptor()), - ) - m := cmux.New(l) restMux := grpcruntime.NewServeMux() grpcMux := m.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc")) @@ -1079,17 +1070,8 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv return true })) - reg := prometheus.NewRegistry() - reg.MustRegister(grpcMetrics) - - reg.MustRegister( - collectors.NewGoCollector(), - collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), - ) ms := storage.NewDiskMetricStore("", time.Minute*5, prometheus.DefaultGatherer, nil) - g := prometheus.Gatherers{ - reg, prometheus.GathererFunc(func() ([]*dto.MetricFamily, error) { return ms.GetMetricFamilies(), nil }), } r := route.New() diff --git a/yarn.lock b/yarn.lock index 6e984daa40821f..a552e851949c94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5813,6 +5813,27 @@ concurrently@^6.2.1: tree-kill "^1.2.2" yargs "^16.2.0" +configcat-common@^4.6.1, configcat-common@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/configcat-common/-/configcat-common-4.6.2.tgz#ef37114cf77c10378e686078bc45903508e0ed49" + integrity sha512-o7qp5xb3K9w3tL0dK0g2/IwzOym4SOcdl+Hgh7d1125fKamDk8Jg6nBb+jEkA0qs0msYI+kpcL7pEsihYUhEDg== + +configcat-js@^5.7.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/configcat-js/-/configcat-js-5.7.2.tgz#2466269f941c8564c0d2670ffbc74dc0657f1450" + integrity sha512-Pvryi3y1z1ZyhId5fGv6Weel6YU6EuTHHYdfY1SOaVSvNeXNU9HwLpzMUCwdINtSXyxtHd0xUMumRUje2h7/Ng== + dependencies: + configcat-common "^4.6.2" + +configcat-node@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/configcat-node/-/configcat-node-6.7.1.tgz#87c6be569d646575c969d00966a97416a4b6a4fa" + integrity sha512-+tdKZkrWo3JdRezU90daly9LmL2efCDTnjHlKMUpwtVjrNjPVXggrydrgB5QUKmJUspWUd9bFSXS3jQgoGpB4g== + dependencies: + configcat-common "^4.6.1" + got "^9.6.0" + tunnel "0.0.6" + configstore@^5.0.0, configstore@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" @@ -17078,6 +17099,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tunnel@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"