diff --git a/docker/.env.example b/docker/.env.example index 786316fdd96..734367c90c4 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -78,3 +78,10 @@ SUPABASE_PUBLIC_URL=http://localhost:8000 # Enable webp support IMGPROXY_ENABLE_WEBP_DETECTION=true + +# Configure Logflare API Calls +LOGFLARE_API_KEY=api-key +LOGFLARE_URL=http://localhost:54329 + +# Enable logging and observability in the UI +NEXT_PUBLIC_ENABLE_LOGS=true diff --git a/studio/.env b/studio/.env index 68180030ee1..58f33ddf217 100644 --- a/studio/.env +++ b/studio/.env @@ -9,9 +9,11 @@ SUPABASE_PUBLIC_URL=http://localhost:8000 SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q SENTRY_IGNORE_API_RESOLUTION_ERROR=1 - +LOGFLARE_URL=http://localhost:54329 +LOGFLARE_API_KEY=api-key # TODO: evaluate these variables at runtime instead # https://nextjs.org/docs/basic-features/environment-variables#loading-environment-variables NEXT_PUBLIC_SITE_URL=http://localhost:3000 NEXT_PUBLIC_GOTRUE_URL=$SUPABASE_PUBLIC_URL/auth/v1 NEXT_PUBLIC_HCAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001 +NEXT_PUBLIC_ENABLE_LOGS=true diff --git a/studio/components/interfaces/Settings/Logs/Logs.constants.ts b/studio/components/interfaces/Settings/Logs/Logs.constants.ts index e0e5c686ec2..c1cb707456d 100644 --- a/studio/components/interfaces/Settings/Logs/Logs.constants.ts +++ b/studio/components/interfaces/Settings/Logs/Logs.constants.ts @@ -1,4 +1,5 @@ import dayjs from 'dayjs' +import { IS_PLATFORM } from 'lib/constants' import { DatetimeHelper, FilterTableSet, LogTemplate } from '.' export const LOGS_EXPLORER_DOCS_URL = @@ -665,3 +666,5 @@ export const TIER_QUERY_LIMITS: { TEAM: { text: '90 days', value: 90, unit: 'day', promptUpgrade: false }, ENTERPRISE: { text: '90 days', value: 90, unit: 'day', promptUpgrade: false }, } + +export const SHOW_O11Y = IS_PLATFORM ? true : process.env.NEXT_PUBLIC_ENABLE_LOGS == 'true' diff --git a/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx b/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx index 9baa2711c85..0168c0234b2 100644 --- a/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx +++ b/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx @@ -14,6 +14,7 @@ import Link from 'next/link' import React from 'react' import { checkPermissions } from 'hooks' import { useProfileQuery } from 'data/profile/profile-query' +import { IS_PLATFORM } from 'lib/constants' export interface LogsQueryPanelProps { templates?: LogTemplate[] @@ -130,7 +131,7 @@ const LogsQueryPanel = ({ - {onSave && ( + {IS_PLATFORM && onSave && (