Merge pull request #2884 from SigNoz/release/v0.20.2

Release/v0.20.2
This commit is contained in:
Prashant Shahi 2023-06-09 17:42:04 +05:30 committed by GitHub
commit 4a467435e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 14 additions and 20 deletions

View File

@ -137,7 +137,7 @@ services:
condition: on-failure
query-service:
image: signoz/query-service:0.20.0
image: signoz/query-service:0.20.2
command: ["-config=/root/config/prometheus.yml"]
# ports:
# - "6060:6060" # pprof port
@ -166,7 +166,7 @@ services:
<<: *clickhouse-depend
frontend:
image: signoz/frontend:0.20.0
image: signoz/frontend:0.20.2
deploy:
restart_policy:
condition: on-failure

View File

@ -153,7 +153,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.20.0}
image: signoz/query-service:${DOCKER_TAG:-0.20.2}
container_name: query-service
command: ["-config=/root/config/prometheus.yml"]
# ports:
@ -181,7 +181,7 @@ services:
<<: *clickhouse-depend
frontend:
image: signoz/frontend:${DOCKER_TAG:-0.20.0}
image: signoz/frontend:${DOCKER_TAG:-0.20.2}
container_name: frontend
restart: on-failure
depends_on:

View File

@ -146,7 +146,6 @@ export const initialQueryPromQLData: IPromQLQuery = {
export const initialClickHouseData: IClickHouseQuery = {
name: createNewBuilderItemName({ existNames: [], sourceNames: alphabet }),
rawQuery: '',
legend: '',
disabled: false,
query: '',

View File

@ -39,7 +39,6 @@ export const alertDefaults: AlertDef = {
A: {
name: 'A',
query: ``,
rawQuery: ``,
legend: '',
disabled: false,
},
@ -73,7 +72,6 @@ export const logAlertDefaults: AlertDef = {
A: {
name: 'A',
query: `select \ntoStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 30 MINUTE) AS interval, \ntoFloat64(count()) as value \nFROM signoz_logs.distributed_logs \nWHERE timestamp BETWEEN {{.start_timestamp_nano}} AND {{.end_timestamp_nano}} \nGROUP BY interval;\n\n-- available variables:\n-- \t{{.start_timestamp_nano}}\n-- \t{{.end_timestamp_nano}}\n\n-- required columns (or alias):\n-- \tvalue\n-- \tinterval`,
rawQuery: `select \ntoStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 30 MINUTE) AS interval, \ntoFloat64(count()) as value \nFROM signoz_logs.distributed_logs \nWHERE timestamp BETWEEN {{.start_timestamp_nano}} AND {{.end_timestamp_nano}} \nGROUP BY interval;\n\n-- available variables:\n-- \t{{.start_timestamp_nano}}\n-- \t{{.end_timestamp_nano}}\n\n-- required columns (or alias):\n-- \tvalue\n-- \tinterval`,
legend: '',
disabled: false,
},
@ -107,7 +105,6 @@ export const traceAlertDefaults: AlertDef = {
chQueries: {
A: {
name: 'A',
rawQuery: `SELECT \n\ttoStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, \n\ttagMap['peer.service'] AS op_name, \n\ttoFloat64(avg(durationNano)) AS value \nFROM signoz_traces.distributed_signoz_index_v2 \nWHERE tagMap['peer.service']!='' \nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} \nGROUP BY (op_name, interval);\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`,
query: `SELECT \n\ttoStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, \n\ttagMap['peer.service'] AS op_name, \n\ttoFloat64(avg(durationNano)) AS value \nFROM signoz_traces.distributed_signoz_index_v2 \nWHERE tagMap['peer.service']!='' \nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} \nGROUP BY (op_name, interval);\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`,
legend: '',
disabled: false,
@ -142,7 +139,6 @@ export const exceptionAlertDefaults: AlertDef = {
chQueries: {
A: {
name: 'A',
rawQuery: `SELECT \n\tcount() as value,\n\ttoStartOfInterval(timestamp, toIntervalMinute(1)) AS interval,\n\tserviceName\nFROM signoz_traces.distributed_signoz_error_index_v2\nWHERE exceptionType !='OSError'\nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}}\nGROUP BY serviceName, interval;\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`,
query: `SELECT \n\tcount() as value,\n\ttoStartOfInterval(timestamp, toIntervalMinute(1)) AS interval,\n\tserviceName\nFROM signoz_traces.distributed_signoz_error_index_v2\nWHERE exceptionType !='OSError'\nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}}\nGROUP BY serviceName, interval;\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`,
legend: '',
disabled: false,

View File

@ -64,7 +64,7 @@ function ChartPreview({
case EQueryType.CLICKHOUSE:
return (
query.clickhouse_sql?.length > 0 &&
query.clickhouse_sql[0].rawQuery?.length > 0
query.clickhouse_sql[0].query?.length > 0
);
case EQueryType.QUERY_BUILDER:
return (

View File

@ -162,7 +162,7 @@ function FormAlertRules({
}
currentQuery.clickhouse_sql.forEach((item) => {
if (item.rawQuery === '') {
if (item.query === '') {
notifications.error({
message: 'Error',
description: t('chquery_required'),

View File

@ -50,7 +50,7 @@ function ClickHouseQueryBuilder({
const handleUpdateEditor = useCallback(
(value: string) => {
handleUpdateQuery('rawQuery', value);
handleUpdateQuery('query', value);
},
[handleUpdateQuery],
);
@ -75,7 +75,7 @@ function ClickHouseQueryBuilder({
language="sql"
height="200px"
onChange={handleUpdateEditor}
value={queryData.rawQuery}
value={queryData.query}
options={{
scrollbar: {
alwaysConsumeMouseWheel: false,

View File

@ -2,7 +2,7 @@ import { IClickHouseQuery } from 'types/api/queryBuilder/queryBuilderData';
export interface IClickHouseQueryHandleChange {
queryIndex: number | string;
rawQuery?: IClickHouseQuery['rawQuery'];
query?: IClickHouseQuery['query'];
legend?: IClickHouseQuery['legend'];
toggleDisable?: IClickHouseQuery['disabled'];
toggleDelete?: boolean;

View File

@ -22,7 +22,7 @@ export const mapQueryDataFromApi = (
? Object.keys(compositeQuery.chQueries).map((key) => ({
...compositeQuery.chQueries[key],
name: key,
rawQuery: compositeQuery.chQueries[key].query,
query: compositeQuery.chQueries[key].query,
}))
: initialQuery.clickhouse_sql;

View File

@ -67,9 +67,9 @@ export async function GetMetricQueryRange({
case EQueryType.CLICKHOUSE: {
const chQueries = {};
queryData.map((query) => {
if (!query.rawQuery) return;
if (!query.query) return;
chQueries[query.name] = {
query: query.rawQuery,
query: query.query,
disabled: query.disabled,
};
legendMap[query.name] = query.legend;

View File

@ -63,7 +63,6 @@ export type IBuilderQuery = {
export interface IClickHouseQuery {
name: string;
rawQuery: string;
legend: string;
disabled: boolean;
query: string;

View File

@ -3879,7 +3879,7 @@ func (r *ClickHouseReader) GetLogAggregateAttributes(ctx context.Context, req *v
}
// add other attributes
for _, field := range constants.StaticFieldsLogsV3 {
if !stringAllowed && field.DataType == v3.AttributeKeyDataTypeString && (v3.AttributeKey{} == field) {
if (!stringAllowed && field.DataType == v3.AttributeKeyDataTypeString) || (v3.AttributeKey{} == field) {
continue
} else if len(req.SearchText) == 0 || strings.Contains(field.Key, req.SearchText) {
response.AttributeKeys = append(response.AttributeKeys, field)

View File

@ -293,7 +293,7 @@ func (a AttributeKey) Validate() error {
if a.IsColumn {
switch a.Type {
case AttributeKeyTypeResource, AttributeKeyTypeTag:
case AttributeKeyTypeResource, AttributeKeyTypeTag, AttributeKeyTypeUnspecified:
break
default:
return fmt.Errorf("invalid attribute type: %s", a.Type)