Compare commits

..

1 Commits

Author SHA1 Message Date
SagarRajput-7
1138585189 feat: added support for deployment env filtering in overview tble 2025-01-30 20:28:00 +05:30
5 changed files with 45 additions and 22 deletions

View File

@@ -309,7 +309,7 @@ request_sudo() {
echo -e "Got it! Thanks!! 🙏\n"
echo -e "Okay! We will bring up the SigNoz cluster from here 🚀\n"
fi
fi
fi
}
echo ""
@@ -317,7 +317,7 @@ echo -e "👋 Thank you for trying out SigNoz! "
echo ""
sudo_cmd=""
docker_compose_cmd="docker compose"
docker_compose_cmd=""
# Check sudo permissions
if (( $EUID != 0 )); then
@@ -325,13 +325,7 @@ if (( $EUID != 0 )); then
echo " In case of any failure or prompt, please consider running the script with sudo privileges."
echo ""
else
if hash sudo 2>/dev/null; then
sudo_cmd="sudo"
else
echo "🟡 Running installer with root permissions but sudo command not found, running without sudo"
echo " In case of any failure or prompt, please consider installing sudo and running the script again."
echo ""
fi
sudo_cmd="sudo"
fi
# Checking OS and assigning package manager
@@ -472,10 +466,11 @@ if ! is_command_present docker; then
fi
if has_docker_compose_plugin; then
echo "docker compose plugin found, using it"
echo "docker compose plugin is present, using it"
docker_compose_cmd="docker compose"
# Install docker-compose
else
docker_compose_cmd="docker-compose"
echo "docker compose plugin not found, using docker-compose instead"
if ! is_command_present docker-compose; then
request_sudo
install_docker_compose

View File

@@ -6,7 +6,10 @@ import {
getValuesFromQueryParams,
setQueryParamsFromOptions,
} from 'components/CeleryTask/CeleryUtils';
import { useCeleryFilterOptions } from 'components/CeleryTask/useCeleryFilterOptions';
import {
FilterCofigs,
useCeleryFilterOptions,
} from 'components/CeleryTask/useCeleryFilterOptions';
import { SelectMaxTagPlaceholder } from 'components/MessagingQueues/MQCommon/MQCommon';
import { QueryParams } from 'constants/query';
import useUrlQuery from 'hooks/useUrlQuery';
@@ -14,20 +17,24 @@ import { Check, Share2 } from 'lucide-react';
import { useState } from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import { useCopyToClipboard } from 'react-use';
import { DataSource } from 'types/common/queryBuilder';
interface SelectOptionConfig {
placeholder: string;
queryParam: QueryParams;
filterType: string | string[];
filterConfigs?: FilterCofigs;
}
function FilterSelect({
placeholder,
queryParam,
filterType,
filterConfigs,
}: SelectOptionConfig): JSX.Element {
const { handleSearch, isFetching, options } = useCeleryFilterOptions(
filterType,
filterConfigs,
);
const urlQuery = useUrlQuery();
@@ -65,12 +72,26 @@ function FilterSelect({
);
}
FilterSelect.defaultProps = {
filterConfigs: undefined,
};
function CeleryOverviewConfigOptions(): JSX.Element {
const [isURLCopied, setIsURLCopied] = useState(false);
const [, handleCopyToClipboard] = useCopyToClipboard();
const selectConfigs: SelectOptionConfig[] = [
{
placeholder: 'Environment',
queryParam: QueryParams.environment,
filterType: 'resource_deployment_environment',
filterConfigs: {
aggregateOperator: 'rate',
dataSource: DataSource.METRICS,
aggregateAttribute: 'signoz_calls_total',
},
},
{
placeholder: 'Service Name',
queryParam: QueryParams.service,
@@ -115,6 +136,7 @@ function CeleryOverviewConfigOptions(): JSX.Element {
placeholder={config.placeholder}
queryParam={config.queryParam}
filterType={config.filterType}
filterConfigs={config.filterConfigs}
/>
))}
</Row>

View File

@@ -322,6 +322,11 @@ function makeFilters(urlQuery: URLSearchParams): Filter[] {
{ paramName: QueryParams.kindString, key: 'kind_string', operator: 'in' },
{ paramName: QueryParams.service, key: 'service.name', operator: 'in' },
{ paramName: QueryParams.spanName, key: 'name', operator: 'in' },
{
paramName: QueryParams.environment,
key: 'deployment.environment',
operator: 'in',
},
];
return filterConfigs

View File

@@ -6,13 +6,17 @@ import { DataSource } from 'types/common/queryBuilder';
import { useGetAllFilters } from './CeleryTaskConfigOptions/useGetCeleryFilters';
export interface FilterCofigs {
aggregateOperator?: string;
dataSource?: DataSource;
aggregateAttribute?: string;
filterAttributeKeyDataType?: DataTypes;
tagType?: string;
}
export const useCeleryFilterOptions = (
type: string | string[],
aggregateOperator?: string,
dataSource?: DataSource,
aggregateAttribute?: string,
filterAttributeKeyDataType?: DataTypes,
tagType?: string,
filterCofigs?: FilterCofigs,
): {
searchText: string;
handleSearch: (value: string) => void;
@@ -23,11 +27,7 @@ export const useCeleryFilterOptions = (
const { isFetching, options } = useGetAllFilters({
attributeKey: type,
searchText,
aggregateOperator,
dataSource,
aggregateAttribute,
filterAttributeKeyDataType,
tagType,
...filterCofigs,
});
const handleDebouncedSearch = useDebouncedFn((searchText): void => {
setSearchText(searchText as string);

View File

@@ -46,4 +46,5 @@ export enum QueryParams {
msgSystem = 'msgSystem',
destination = 'destination',
kindString = 'kindString',
environment = 'environment',
}