{menuItems.map((item, index) => (
,
- AxiosError
-> =>
+export const useGetDeploymentsData = (
+ isEnabled: boolean,
+): UseQueryResult, AxiosError> =>
useQuery, AxiosError>({
queryKey: ['getDeploymentsData'],
queryFn: () => getDeploymentsData(),
+ enabled: isEnabled,
});
diff --git a/frontend/src/hooks/useGetTenantLicense.ts b/frontend/src/hooks/useGetTenantLicense.ts
index 7a7f188dc0..edc99c32e8 100644
--- a/frontend/src/hooks/useGetTenantLicense.ts
+++ b/frontend/src/hooks/useGetTenantLicense.ts
@@ -1,15 +1,36 @@
+import { AxiosError } from 'axios';
import { useAppContext } from 'providers/App/App';
import { LicensePlatform } from 'types/api/licensesV3/getActive';
export const useGetTenantLicense = (): {
isCloudUser: boolean;
- isEECloudUser: boolean;
+ isEnterpriseSelfHostedUser: boolean;
+ isCommunityUser: boolean;
+ isCommunityEnterpriseUser: boolean;
} => {
- const { activeLicenseV3 } = useAppContext();
+ const { activeLicenseV3, activeLicenseV3FetchError } = useAppContext();
- return {
+ const responsePayload = {
isCloudUser: activeLicenseV3?.platform === LicensePlatform.CLOUD || false,
- isEECloudUser:
+ isEnterpriseSelfHostedUser:
activeLicenseV3?.platform === LicensePlatform.SELF_HOSTED || false,
+ isCommunityUser: false,
+ isCommunityEnterpriseUser: false,
};
+
+ if (
+ activeLicenseV3FetchError &&
+ (activeLicenseV3FetchError as AxiosError)?.response?.status === 404
+ ) {
+ responsePayload.isCommunityEnterpriseUser = true;
+ }
+
+ if (
+ activeLicenseV3FetchError &&
+ (activeLicenseV3FetchError as AxiosError)?.response?.status === 501
+ ) {
+ responsePayload.isCommunityUser = true;
+ }
+
+ return responsePayload;
};
diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx
index 4006b036be..632cbf04b2 100644
--- a/frontend/src/index.tsx
+++ b/frontend/src/index.tsx
@@ -1,12 +1,9 @@
import './ReactI18';
import 'styles.scss';
-import * as Sentry from '@sentry/react';
import AppRoutes from 'AppRoutes';
import { AxiosError } from 'axios';
import { ThemeProvider } from 'hooks/useDarkMode';
-import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
-import posthog from 'posthog-js';
import { AppProvider } from 'providers/App/App';
import TimezoneProvider from 'providers/Timezone';
import { createRoot } from 'react-dom/client';
@@ -37,54 +34,25 @@ const queryClient = new QueryClient({
const container = document.getElementById('root');
-if (process.env.POSTHOG_KEY) {
- posthog.init(process.env.POSTHOG_KEY, {
- api_host: 'https://us.i.posthog.com',
- person_profiles: 'identified_only', // or 'always' to create profiles for anonymous users as well
- });
-}
-
-Sentry.init({
- dsn: process.env.SENTRY_DSN,
- tunnel: process.env.TUNNEL_URL,
- environment: 'production',
- integrations: [
- Sentry.browserTracingIntegration(),
- Sentry.replayIntegration({
- maskAllText: false,
- blockAllMedia: false,
- }),
- ],
- // Performance Monitoring
- tracesSampleRate: 1.0, // Capture 100% of the transactions
- // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
- tracePropagationTargets: [],
- // Session Replay
- replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
- replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
-});
-
if (container) {
const root = createRoot(container);
root.render(
- }>
-
-
-
-
-
-
-
-
-
- {process.env.NODE_ENV === 'development' && (
-
- )}
-
-
-
-
- ,
+
+
+
+
+
+
+
+
+
+ {process.env.NODE_ENV === 'development' && (
+
+ )}
+
+
+
+ ,
);
}
diff --git a/frontend/src/pages/Settings/index.tsx b/frontend/src/pages/Settings/index.tsx
index a4165cae77..3baf2d11da 100644
--- a/frontend/src/pages/Settings/index.tsx
+++ b/frontend/src/pages/Settings/index.tsx
@@ -13,10 +13,7 @@ import { getRoutes } from './utils';
function SettingsPage(): JSX.Element {
const { pathname } = useLocation();
const { user, featureFlags, trialInfo } = useAppContext();
- const {
- isCloudUser: isCloudAccount,
- isEECloudUser: isEECloudAccount,
- } = useGetTenantLicense();
+ const { isCloudUser, isEnterpriseSelfHostedUser } = useGetTenantLicense();
const isWorkspaceBlocked = trialInfo?.workSpaceBlock || false;
@@ -37,8 +34,8 @@ function SettingsPage(): JSX.Element {
isCurrentOrgSettings,
isGatewayEnabled,
isWorkspaceBlocked,
- isCloudAccount,
- isEECloudAccount,
+ isCloudUser,
+ isEnterpriseSelfHostedUser,
t,
),
[
@@ -46,8 +43,8 @@ function SettingsPage(): JSX.Element {
isCurrentOrgSettings,
isGatewayEnabled,
isWorkspaceBlocked,
- isCloudAccount,
- isEECloudAccount,
+ isCloudUser,
+ isEnterpriseSelfHostedUser,
t,
],
);
diff --git a/frontend/src/pages/Settings/utils.ts b/frontend/src/pages/Settings/utils.ts
index e006e0f024..9ed3c428e4 100644
--- a/frontend/src/pages/Settings/utils.ts
+++ b/frontend/src/pages/Settings/utils.ts
@@ -17,8 +17,8 @@ export const getRoutes = (
isCurrentOrgSettings: boolean,
isGatewayEnabled: boolean,
isWorkspaceBlocked: boolean,
- isCloudAccount: boolean,
- isEECloudAccount: boolean,
+ isCloudUser: boolean,
+ isEnterpriseSelfHostedUser: boolean,
t: TFunction,
): RouteTabProps['routes'] => {
const settings = [];
@@ -42,17 +42,17 @@ export const getRoutes = (
settings.push(...multiIngestionSettings(t));
}
- if (isCloudAccount && !isGatewayEnabled) {
+ if (isCloudUser && !isGatewayEnabled) {
settings.push(...ingestionSettings(t));
}
settings.push(...alertChannels(t));
- if ((isCloudAccount || isEECloudAccount) && isAdmin) {
+ if ((isCloudUser || isEnterpriseSelfHostedUser) && isAdmin) {
settings.push(...apiKeys(t));
}
- if (isCloudAccount && isAdmin) {
+ if (isCloudUser && isAdmin) {
settings.push(...customDomainSettings(t));
}
diff --git a/pkg/http/render/render.go b/pkg/http/render/render.go
index fc2cf44d7b..63f6d07603 100644
--- a/pkg/http/render/render.go
+++ b/pkg/http/render/render.go
@@ -56,6 +56,8 @@ func Error(rw http.ResponseWriter, cause error) {
httpCode = http.StatusConflict
case errors.TypeUnauthenticated:
httpCode = http.StatusUnauthorized
+ case errors.TypeUnsupported:
+ httpCode = http.StatusNotImplemented
}
rea := make([]responseerroradditional, len(a))
diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go
index 6537432060..05d4c52299 100644
--- a/pkg/query-service/app/http_handler.go
+++ b/pkg/query-service/app/http_handler.go
@@ -614,6 +614,13 @@ func (aH *APIHandler) RegisterRoutes(router *mux.Router, am *AuthMiddleware) {
router.HandleFunc("/api/v1/getResetPasswordToken/{id}", am.AdminAccess(aH.getResetPasswordToken)).Methods(http.MethodGet)
router.HandleFunc("/api/v1/resetPassword", am.OpenAccess(aH.resetPassword)).Methods(http.MethodPost)
router.HandleFunc("/api/v1/changePassword/{id}", am.SelfAccess(aH.changePassword)).Methods(http.MethodPost)
+
+ router.HandleFunc("/api/v3/licenses", am.ViewAccess(func(rw http.ResponseWriter, req *http.Request) {
+ render.Success(rw, http.StatusOK, []any{})
+ })).Methods(http.MethodGet)
+ router.HandleFunc("/api/v3/licenses/active", am.ViewAccess(func(rw http.ResponseWriter, req *http.Request) {
+ render.Error(rw, errorsV2.New(errorsV2.TypeUnsupported, errorsV2.CodeUnsupported, "not implemented"))
+ })).Methods(http.MethodGet)
}
func (ah *APIHandler) MetricExplorerRoutes(router *mux.Router, am *AuthMiddleware) {
diff --git a/pkg/query-service/app/server.go b/pkg/query-service/app/server.go
index 2ad29dbce2..001b18d5fa 100644
--- a/pkg/query-service/app/server.go
+++ b/pkg/query-service/app/server.go
@@ -113,8 +113,6 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
// initiate feature manager
fm := featureManager.StartManager()
- readerReady := make(chan bool)
-
fluxIntervalForTraceDetail, err := time.ParseDuration(serverOptions.FluxIntervalForTraceDetail)
if err != nil {
return nil, err
@@ -150,7 +148,6 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
c = cache.NewCache(cacheOpts)
}
- <-readerReady
rm, err := makeRulesManager(
serverOptions.RuleRepoURL,
serverOptions.SigNoz.SQLStore.SQLxDB(),