Skip to content

Commit

Permalink
Merge pull request #6490 from SigNoz/release/v0.59.x
Browse files Browse the repository at this point in the history
Release/v0.59.x
  • Loading branch information
prashant-shahi authored Nov 20, 2024
2 parents c8d0f76 + 5a70123 commit 71d1e12
Show file tree
Hide file tree
Showing 22 changed files with 291 additions and 121 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BUILD_HASH ?= $(shell git rev-parse --short HEAD)
BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
BUILD_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
DEV_LICENSE_SIGNOZ_IO ?= https://staging-license.signoz.io/api/v1
ZEUS_URL ?= https://api.signoz.cloud
DEV_BUILD ?= "" # set to any non-empty value to enable dev build

# Internal variables or constants.
Expand All @@ -33,8 +34,9 @@ buildHash=${PACKAGE}/pkg/query-service/version.buildHash
buildTime=${PACKAGE}/pkg/query-service/version.buildTime
gitBranch=${PACKAGE}/pkg/query-service/version.gitBranch
licenseSignozIo=${PACKAGE}/ee/query-service/constants.LicenseSignozIo
zeusURL=${PACKAGE}/ee/query-service/constants.ZeusURL

LD_FLAGS=-X ${buildHash}=${BUILD_HASH} -X ${buildTime}=${BUILD_TIME} -X ${buildVersion}=${BUILD_VERSION} -X ${gitBranch}=${BUILD_BRANCH}
LD_FLAGS=-X ${buildHash}=${BUILD_HASH} -X ${buildTime}=${BUILD_TIME} -X ${buildVersion}=${BUILD_VERSION} -X ${gitBranch}=${BUILD_BRANCH} -X ${zeusURL}=${ZEUS_URL}
DEV_LD_FLAGS=-X ${licenseSignozIo}=${DEV_LICENSE_SIGNOZ_IO}

all: build-push-frontend build-push-query-service
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker-swarm/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ services:
condition: on-failure

query-service:
image: signoz/query-service:0.58.2
image: signoz/query-service:0.59.0
command:
[
"-config=/root/config/prometheus.yml",
Expand Down Expand Up @@ -186,7 +186,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:0.58.2
image: signoz/frontend:0.59.0
deploy:
restart_policy:
condition: on-failure
Expand All @@ -199,7 +199,7 @@ services:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf

otel-collector:
image: signoz/signoz-otel-collector:0.111.8
image: signoz/signoz-otel-collector:0.111.9
command:
[
"--config=/etc/otel-collector-config.yaml",
Expand Down Expand Up @@ -237,7 +237,7 @@ services:
- query-service

otel-collector-migrator:
image: signoz/signoz-schema-migrator:0.111.8
image: signoz/signoz-schema-migrator:0.111.9
deploy:
restart_policy:
condition: on-failure
Expand Down
4 changes: 2 additions & 2 deletions deploy/docker/clickhouse-setup/docker-compose-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ services:
- --storage.path=/data

otel-collector-migrator:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.8}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.9}
container_name: otel-migrator
command:
- "--dsn=tcp://clickhouse:9000"
Expand All @@ -84,7 +84,7 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
otel-collector:
container_name: signoz-otel-collector
image: signoz/signoz-otel-collector:0.111.8
image: signoz/signoz-otel-collector:0.111.9
command:
[
"--config=/etc/otel-collector-config.yaml",
Expand Down
10 changes: 5 additions & 5 deletions deploy/docker/clickhouse-setup/docker-compose-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.58.2}
image: signoz/query-service:${DOCKER_TAG:-0.59.0}
container_name: signoz-query-service
command:
[
Expand Down Expand Up @@ -201,7 +201,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.58.2}
image: signoz/frontend:${DOCKER_TAG:-0.59.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand All @@ -213,7 +213,7 @@ services:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf

otel-collector-migrator-sync:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.8}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.9}
container_name: otel-migrator-sync
command:
- "sync"
Expand All @@ -228,7 +228,7 @@ services:
# condition: service_healthy

otel-collector-migrator-async:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.8}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.9}
container_name: otel-migrator-async
command:
- "async"
Expand All @@ -245,7 +245,7 @@ services:
# condition: service_healthy

otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.8}
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.9}
container_name: signoz-otel-collector
command:
[
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker/clickhouse-setup/docker-compose.testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.58.2}
image: signoz/query-service:${DOCKER_TAG:-0.59.0}
container_name: signoz-query-service
command:
[
Expand Down Expand Up @@ -208,7 +208,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.58.2}
image: signoz/frontend:${DOCKER_TAG:-0.59.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand All @@ -220,7 +220,7 @@ services:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf

otel-collector-migrator:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.8}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.9}
container_name: otel-migrator
command:
- "--dsn=tcp://clickhouse:9000"
Expand All @@ -234,7 +234,7 @@ services:


otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.8}
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.9}
container_name: signoz-otel-collector
command:
[
Expand Down
2 changes: 1 addition & 1 deletion ee/query-service/app/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (ah *APIHandler) RegisterRoutes(router *mux.Router, am *baseapp.AuthMiddlew
router.HandleFunc("/api/v4/query_range", am.ViewAccess(ah.queryRangeV4)).Methods(http.MethodPost)

// Gateway
router.PathPrefix(gateway.RoutePrefix).HandlerFunc(am.AdminAccess(ah.ServeGatewayHTTP))
router.PathPrefix(gateway.RoutePrefix).HandlerFunc(am.EditAccess(ah.ServeGatewayHTTP))

ah.APIHandler.RegisterRoutes(router, am)

Expand Down
6 changes: 5 additions & 1 deletion ee/query-service/app/api/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ func (ah *APIHandler) getBilling(w http.ResponseWriter, r *http.Request) {
func convertLicenseV3ToLicenseV2(licenses []*model.LicenseV3) []model.License {
licensesV2 := []model.License{}
for _, l := range licenses {
planKeyFromPlanName, ok := model.MapOldPlanKeyToNewPlanName[l.PlanName]
if !ok {
planKeyFromPlanName = model.Basic
}
licenseV2 := model.License{
Key: l.Key,
ActivationId: "",
Expand All @@ -226,7 +230,7 @@ func convertLicenseV3ToLicenseV2(licenses []*model.LicenseV3) []model.License {
ValidationMessage: "",
IsCurrent: l.IsCurrent,
LicensePlan: model.LicensePlan{
PlanKey: l.PlanName,
PlanKey: planKeyFromPlanName,
ValidFrom: l.ValidFrom,
ValidUntil: l.ValidUntil,
Status: l.Status},
Expand Down
4 changes: 3 additions & 1 deletion ee/query-service/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ var LicenseAPIKey = GetOrDefaultEnv("SIGNOZ_LICENSE_API_KEY", "")
var SaasSegmentKey = GetOrDefaultEnv("SIGNOZ_SAAS_SEGMENT_KEY", "")
var FetchFeatures = GetOrDefaultEnv("FETCH_FEATURES", "false")
var ZeusFeaturesURL = GetOrDefaultEnv("ZEUS_FEATURES_URL", "ZeusFeaturesURL")
var ZeusURL = GetOrDefaultEnv("ZEUS_URL", "ZeusURL")

// this is set via build time variable
var ZeusURL = "https://api.signoz.cloud"

func GetOrDefaultEnv(key string, fallback string) string {
v := os.Getenv(key)
Expand Down
5 changes: 5 additions & 0 deletions ee/query-service/license/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ func (lm *Manager) GetLicensesV3(ctx context.Context) (response []*model.License
if lm.activeLicenseV3 != nil && l.Key == lm.activeLicenseV3.Key {
l.IsCurrent = true
}
if l.ValidUntil == -1 {
// for subscriptions, there is no end-date as such
// but for showing user some validity we default one year timespan
l.ValidUntil = l.ValidFrom + 31556926
}
response = append(response, l)
}

Expand Down
4 changes: 4 additions & 0 deletions ee/query-service/model/plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ var (
PlanNameBasic = "BASIC"
)

var (
MapOldPlanKeyToNewPlanName map[string]string = map[string]string{PlanNameBasic: Basic, PlanNameTeams: Pro, PlanNameEnterprise: Enterprise}
)

var (
LicenseStatusInactive = "INACTIVE"
)
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"fontfaceobserver": "2.3.0",
"history": "4.10.1",
"html-webpack-plugin": "5.5.0",
"http-proxy-middleware": "2.0.7",
"http-proxy-middleware": "3.0.3",
"i18next": "^21.6.12",
"i18next-browser-languagedetector": "^6.1.3",
"i18next-http-backend": "^1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/RouteTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function RouteTab({
}: RouteTabProps & TabsProps): JSX.Element {
const onChange = (activeRoute: string): void => {
if (onChangeHandler) {
onChangeHandler();
onChangeHandler(activeRoute);
}

const selectedRoute = routes.find((e) => e.key === activeRoute);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/RouteTab/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export type TabRoutes = {
export interface RouteTabProps {
routes: TabRoutes[];
activeKey: TabsProps['activeKey'];
onChangeHandler?: VoidFunction;
onChangeHandler?: (key: string) => void;
history: History<unknown>;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { Color } from '@signozhq/design-tokens';
import { Progress, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import logEvent from 'api/common/logEvent';
import { ConditionalAlertPopover } from 'container/AlertHistory/AlertPopover/AlertPopover';
import AlertLabels from 'pages/AlertDetails/AlertHeader/AlertLabels/AlertLabels';
import PaginationInfoText from 'periscope/components/PaginationInfoText/PaginationInfoText';
import { AlertRuleStats, AlertRuleTopContributors } from 'types/api/alerts/def';
import { HTMLAttributes } from 'react';
import {
AlertRuleStats,
AlertRuleTimelineTableResponse,
AlertRuleTopContributors,
} from 'types/api/alerts/def';

function TopContributorsRows({
topContributors,
Expand Down Expand Up @@ -70,10 +76,21 @@ function TopContributorsRows({
},
];

const handleRowClick = (
record: AlertRuleTopContributors,
): HTMLAttributes<AlertRuleTimelineTableResponse> => ({
onClick: (): void => {
logEvent('Alert history: Top contributors row: Clicked', {
labels: record.labels,
});
},
});

return (
<Table
rowClassName="contributors-row"
rowKey={(row): string => `top-contributor-${row.fingerprint}`}
onRow={handleRowClick}
columns={columns}
showHeader={false}
dataSource={topContributors}
Expand Down
16 changes: 15 additions & 1 deletion frontend/src/container/AlertHistory/Timeline/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import './Table.styles.scss';

import { Table } from 'antd';
import logEvent from 'api/common/logEvent';
import { initialFilters } from 'constants/queryBuilder';
import {
useGetAlertRuleDetailsTimelineTable,
useTimelineTable,
} from 'pages/AlertDetails/hooks';
import { useMemo, useState } from 'react';
import { HTMLAttributes, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { AlertRuleTimelineTableResponse } from 'types/api/alerts/def';
import { TagFilter } from 'types/api/queryBuilder/queryBuilderData';

import { timelineTableColumns } from './useTimelineTable';
Expand Down Expand Up @@ -43,6 +45,17 @@ function TimelineTable(): JSX.Element {
return <div>{t('something_went_wrong')}</div>;
}

const handleRowClick = (
record: AlertRuleTimelineTableResponse,
): HTMLAttributes<AlertRuleTimelineTableResponse> => ({
onClick: (): void => {
logEvent('Alert history: Timeline table row: Clicked', {
ruleId: record.ruleID,
labels: record.labels,
});
},
});

return (
<div className="timeline-table">
<Table
Expand All @@ -52,6 +65,7 @@ function TimelineTable(): JSX.Element {
labels: labels ?? {},
setFilters,
})}
onRow={handleRowClick}
dataSource={timelineData}
pagination={paginationConfig}
size="middle"
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/AlertDetails/AlertDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './AlertDetails.styles.scss';

import { Breadcrumb, Button, Divider } from 'antd';
import logEvent from 'api/common/logEvent';
import { Filters } from 'components/AlertDetailsFilters/Filters';
import NotFound from 'components/NotFound';
import RouteTab from 'components/RouteTab';
Expand Down Expand Up @@ -87,6 +88,12 @@ function AlertDetails(): JSX.Element {
return <NotFound />;
}

const handleTabChange = (route: string): void => {
if (route === ROUTES.ALERT_HISTORY) {
logEvent('Alert History tab: Visited', { ruleId });
}
};

return (
<div className="alert-details">
<Breadcrumb
Expand All @@ -113,6 +120,7 @@ function AlertDetails(): JSX.Element {
routes={routes}
activeKey={pathname}
history={history}
onChangeHandler={handleTabChange}
tabBarExtraContent={<Filters />}
/>
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/setupProxy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable */
// @ts-ignore
// @ts-nocheck
import { createProxyMiddleware } from 'http-proxy-middleware';
import { legacyCreateProxyMiddleware } from 'http-proxy-middleware';

export default function (app) {
app.use(
'/tunnel',
createProxyMiddleware({
target: process.env.TUNNEL_DOMAIN,
legacyCreateProxyMiddleware({
target: `${process.env.TUNNEL_DOMAIN}/tunnel`,
changeOrigin: true,
}),
);
Expand Down
Loading

0 comments on commit 71d1e12

Please sign in to comment.