Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions packages/api/src/generated/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ export const V1BulkCreateSecretsInput = Schema.Struct({
.check(Schema.isPattern(new RegExp("^(?!SUPABASE_).*"))),
value: Schema.String.check(Schema.isMaxLength(24576)),
}),
),
).check(Schema.isMaxLength(100)),
});
export const V1BulkDeleteSecretsInput = Schema.Struct({
ref: Schema.String.check(Schema.isMinLength(20))
Expand Down Expand Up @@ -2421,7 +2421,11 @@ export const V1GetJitAccessConfigOutput = Schema.Union(
}),
Schema.Struct({
state: Schema.Literal("unavailable"),
unavailableReason: Schema.Literals(["postgres_upgrade_required", "temporarily_unavailable"]),
unavailableReason: Schema.Literals([
"postgres_upgrade_required",
"ssl_enforcement_required",
"temporarily_unavailable",
]),
}),
],
{ mode: "oneOf" },
Expand Down Expand Up @@ -4354,6 +4358,12 @@ export const V1RunAQueryInput = Schema.Struct({
parameters: Schema.optionalKey(Schema.Array(Schema.Json)),
read_only: Schema.optionalKey(Schema.Boolean),
});
export const V1ScrapeProjectMetricsInput = Schema.Struct({
ref: Schema.String.check(Schema.isMinLength(20))
.check(Schema.isMaxLength(20))
.check(Schema.isPattern(new RegExp("^[a-z]+$"))),
});
export const V1ScrapeProjectMetricsOutput = Schema.String;
export const V1SetupAReadReplicaInput = Schema.Struct({
ref: Schema.String.check(Schema.isMinLength(20))
.check(Schema.isMaxLength(20))
Expand Down Expand Up @@ -5559,7 +5569,11 @@ export const V1UpdateJitAccessConfigOutput = Schema.Union(
}),
Schema.Struct({
state: Schema.Literal("unavailable"),
unavailableReason: Schema.Literals(["postgres_upgrade_required", "temporarily_unavailable"]),
unavailableReason: Schema.Literals([
"postgres_upgrade_required",
"ssl_enforcement_required",
"temporarily_unavailable",
]),
}),
],
{ mode: "oneOf" },
Expand Down Expand Up @@ -6282,6 +6296,7 @@ export const openApiOperationIdMap = {
"v1-revoke-token": "v1RevokeToken",
"v1-rollback-migrations": "v1RollbackMigrations",
"v1-run-a-query": "v1RunAQuery",
"v1-scrape-project-metrics": "v1ScrapeProjectMetrics",
"v1-setup-a-read-replica": "v1SetupAReadReplica",
"v1-shutdown-realtime": "v1ShutdownRealtime",
"v1-undo": "v1Undo",
Expand Down Expand Up @@ -8276,6 +8291,20 @@ export const operationDefinitions = {
inputSchema: V1RunAQueryInput,
outputSchema: V1RunAQueryOutput,
},
v1ScrapeProjectMetrics: {
id: "v1ScrapeProjectMetrics",
description:
"Prometheus scrape endpoint. Returns metrics of a customer project in the Prometheus open exposition format.",
method: "GET",
path: "/v1/projects/{ref}/analytics/endpoints/metrics",
pathParams: ["ref"],
queryParams: [],
headerParams: [],
requestBody: { kind: "none" },
response: { kind: "text" },
inputSchema: V1ScrapeProjectMetricsInput,
outputSchema: V1ScrapeProjectMetricsOutput,
},
v1SetupAReadReplica: {
id: "v1SetupAReadReplica",
description: "[Beta] Set up a read replica",
Expand Down
18 changes: 18 additions & 0 deletions packages/api/src/generated/effect-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,20 @@ export const versionedEffectOperations = {
const client = yield* SupabaseApiClient;
return yield* client.execute<"v1RunAQuery">(operationDefinitions.v1RunAQuery, input);
}),
scrapeProjectMetrics: (
input: typeof operationDefinitions.v1ScrapeProjectMetrics.inputSchema.Type,
): Effect.Effect<
typeof operationDefinitions.v1ScrapeProjectMetrics.outputSchema.Type,
SupabaseApiError,
SupabaseApiClient
> =>
Effect.gen(function* () {
const client = yield* SupabaseApiClient;
return yield* client.execute<"v1ScrapeProjectMetrics">(
operationDefinitions.v1ScrapeProjectMetrics,
input,
);
}),
setupAReadReplica: (
input: typeof operationDefinitions.v1SetupAReadReplica.inputSchema.Type,
): Effect.Effect<
Expand Down Expand Up @@ -2901,6 +2915,10 @@ export function executeApiClientOperation(
return Schema.decodeUnknownEffect(operationDefinitions.v1RunAQuery.inputSchema)(input).pipe(
Effect.flatMap((decoded) => api.v1.runAQuery(decoded)),
);
case "v1ScrapeProjectMetrics":
return Schema.decodeUnknownEffect(operationDefinitions.v1ScrapeProjectMetrics.inputSchema)(
input,
).pipe(Effect.flatMap((decoded) => api.v1.scrapeProjectMetrics(decoded)));
case "v1SetupAReadReplica":
return Schema.decodeUnknownEffect(operationDefinitions.v1SetupAReadReplica.inputSchema)(
input,
Expand Down
75 changes: 74 additions & 1 deletion packages/api/src/generated/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7049,6 +7049,74 @@
"x-endpoint-owners": ["analytics"]
}
},
"/v1/projects/{ref}/analytics/endpoints/metrics": {
"get": {
"description": "Prometheus scrape endpoint. Returns metrics of a customer project in the Prometheus open exposition format.",
"operationId": "v1-scrape-project-metrics",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Prometheus / OpenMetrics text exposition",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
},
"application/openmetrics-text": {
"schema": {
"type": "string"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden action"
},
"429": {
"description": "Rate limit exceeded"
},
"500": {
"description": "Failed to fetch project's metrics"
}
},
"security": [
{
"bearer": []
},
{
"fga_permissions": ["analytics_logs_read"]
}
],
"summary": "Scrape a project's metrics",
"tags": ["Analytics"],
"x-badges": [
{
"name": "OAuth scope: analytics:read",
"position": "after"
}
],
"x-endpoint-owners": ["analytics"],
"x-oauth-scope": "analytics:read"
}
},
"/v1/projects/{ref}/cli/login-role": {
"post": {
"operationId": "v1-create-login-role",
Expand Down Expand Up @@ -13018,7 +13086,11 @@
},
"unavailableReason": {
"type": "string",
"enum": ["postgres_upgrade_required", "temporarily_unavailable"]
"enum": [
"postgres_upgrade_required",
"ssl_enforcement_required",
"temporarily_unavailable"
]
}
},
"required": ["state", "unavailableReason"]
Expand Down Expand Up @@ -13474,6 +13546,7 @@
},
"required": ["name", "value"]
},
"maxItems": 100,
"example": [
{
"name": "OPENAI_API_KEY",
Expand Down
Loading