Merge pull request #1512 from SigNoz/release/v0.10.2

Release/v0.10.2
This commit is contained in:
Ankit Nayan 2022-08-11 18:52:34 +05:30 committed by GitHub
commit 1865d75df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 10 deletions

View File

@ -40,7 +40,7 @@ services:
condition: on-failure condition: on-failure
query-service: query-service:
image: signoz/query-service:0.10.1 image: signoz/query-service:0.10.2
command: ["-config=/root/config/prometheus.yml"] command: ["-config=/root/config/prometheus.yml"]
# ports: # ports:
# - "6060:6060" # pprof port # - "6060:6060" # pprof port
@ -68,7 +68,7 @@ services:
- clickhouse - clickhouse
frontend: frontend:
image: signoz/frontend:0.10.1 image: signoz/frontend:0.10.2
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure

View File

@ -39,7 +39,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` # 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: query-service:
image: signoz/query-service:0.10.1 image: signoz/query-service:0.10.2
container_name: query-service container_name: query-service
command: ["-config=/root/config/prometheus.yml"] command: ["-config=/root/config/prometheus.yml"]
# ports: # ports:
@ -66,7 +66,7 @@ services:
condition: service_healthy condition: service_healthy
frontend: frontend:
image: signoz/frontend:0.10.1 image: signoz/frontend:0.10.2
container_name: frontend container_name: frontend
restart: on-failure restart: on-failure
depends_on: depends_on:

View File

@ -7,7 +7,8 @@ import convertToNanoSecondsToSecond from 'lib/convertToNanoSecondsToSecond';
import { colors } from 'lib/getRandomColor'; import { colors } from 'lib/getRandomColor';
import history from 'lib/history'; import history from 'lib/history';
import { convertRawQueriesToTraceSelectedTags } from 'lib/resourceAttributes'; import { convertRawQueriesToTraceSelectedTags } from 'lib/resourceAttributes';
import React, { useRef } from 'react'; import { escapeRegExp } from 'lodash-es';
import React, { useMemo, useRef } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { AppState } from 'store/reducers'; import { AppState } from 'store/reducers';
@ -29,7 +30,11 @@ function Application({ getWidget }: DashboardProps): JSX.Element {
resourceAttributeQueries, resourceAttributeQueries,
topLevelOperations, topLevelOperations,
} = useSelector<AppState, MetricReducer>((state) => state.metrics); } = useSelector<AppState, MetricReducer>((state) => state.metrics);
const operationsRegex = topLevelOperations.join('|'); const operationsRegex = useMemo(() => {
return encodeURIComponent(
topLevelOperations.map((e) => escapeRegExp(e)).join('|'),
);
}, [topLevelOperations]);
const selectedTraceTags: string = JSON.stringify( const selectedTraceTags: string = JSON.stringify(
convertRawQueriesToTraceSelectedTags(resourceAttributeQueries, 'array') || [], convertRawQueriesToTraceSelectedTags(resourceAttributeQueries, 'array') || [],
@ -195,7 +200,7 @@ function Application({ getWidget }: DashboardProps): JSX.Element {
}} }}
widget={getWidget([ widget={getWidget([
{ {
query: `sum(rate(signoz_latency_count{service_name="${servicename}", operation=~"${operationsRegex}"${resourceAttributePromQLQuery}}[5m]))`, query: `sum(rate(signoz_latency_count{service_name="${servicename}", operation=~\`${operationsRegex}\`${resourceAttributePromQLQuery}}[5m]))`,
legend: 'Operations', legend: 'Operations',
}, },
])} ])}
@ -229,7 +234,7 @@ function Application({ getWidget }: DashboardProps): JSX.Element {
}} }}
widget={getWidget([ widget={getWidget([
{ {
query: `max(sum(rate(signoz_calls_total{service_name="${servicename}", operation=~"${operationsRegex}", status_code="STATUS_CODE_ERROR"${resourceAttributePromQLQuery}}[5m]) OR rate(signoz_calls_total{service_name="${servicename}", operation=~"${operationsRegex}", http_status_code=~"5.."${resourceAttributePromQLQuery}}[5m]))*100/sum(rate(signoz_calls_total{service_name="${servicename}", operation=~"${operationsRegex}"${resourceAttributePromQLQuery}}[5m]))) < 1000 OR vector(0)`, query: `max(sum(rate(signoz_calls_total{service_name="${servicename}", operation=~\`${operationsRegex}\`, status_code="STATUS_CODE_ERROR"${resourceAttributePromQLQuery}}[5m]) OR rate(signoz_calls_total{service_name="${servicename}", operation=~\`${operationsRegex}\`, http_status_code=~"5.."${resourceAttributePromQLQuery}}[5m]))*100/sum(rate(signoz_calls_total{service_name="${servicename}", operation=~\`${operationsRegex}\`${resourceAttributePromQLQuery}}[5m]))) < 1000 OR vector(0)`,
legend: 'Error Percentage', legend: 'Error Percentage',
}, },
])} ])}

View File

@ -30,11 +30,11 @@ const GetMinMax = (
minTime = minTimeAgo; minTime = minTimeAgo;
} else if (interval === '1day') { } else if (interval === '1day') {
// one day = 24*60(min) // one day = 24*60(min)
const minTimeAgo = getMinAgo({ minutes: 26 * 60 }).getTime(); const minTimeAgo = getMinAgo({ minutes: 24 * 60 }).getTime();
minTime = minTimeAgo; minTime = minTimeAgo;
} else if (interval === '1week') { } else if (interval === '1week') {
// one week = one day * 7 // one week = one day * 7
const minTimeAgo = getMinAgo({ minutes: 26 * 60 * 7 }).getTime(); const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 7 }).getTime();
minTime = minTimeAgo; minTime = minTimeAgo;
} else if (['4hr', '6hr'].includes(interval)) { } else if (['4hr', '6hr'].includes(interval)) {
const h = parseInt(interval.replace('hr', ''), 10); const h = parseInt(interval.replace('hr', ''), 10);

View File

@ -242,6 +242,8 @@ func (m *Manager) editTask(rule *PostableRule, taskName string) error {
m.mtx.Lock() m.mtx.Lock()
defer m.mtx.Unlock() defer m.mtx.Unlock()
zap.S().Debugf("msg:", "editing a rule task", "\t task name:", taskName)
newTask, err := m.prepareTask(false, rule, taskName) newTask, err := m.prepareTask(false, rule, taskName)
if err != nil { if err != nil {
@ -298,12 +300,14 @@ func (m *Manager) DeleteRule(id string) error {
func (m *Manager) deleteTask(taskName string) { func (m *Manager) deleteTask(taskName string) {
m.mtx.Lock() m.mtx.Lock()
defer m.mtx.Unlock() defer m.mtx.Unlock()
zap.S().Debugf("msg:", "deleting a rule task", "\t task name:", taskName)
oldg, ok := m.tasks[taskName] oldg, ok := m.tasks[taskName]
if ok { if ok {
oldg.Stop() oldg.Stop()
delete(m.tasks, taskName) delete(m.tasks, taskName)
delete(m.rules, ruleIdFromTaskName(taskName)) delete(m.rules, ruleIdFromTaskName(taskName))
zap.S().Debugf("msg:", "rule task deleted", "\t task name:", taskName)
} else { } else {
zap.S().Info("msg: ", "rule not found for deletion", "\t name:", taskName) zap.S().Info("msg: ", "rule not found for deletion", "\t name:", taskName)
} }
@ -337,6 +341,7 @@ func (m *Manager) addTask(rule *PostableRule, taskName string) error {
m.mtx.Lock() m.mtx.Lock()
defer m.mtx.Unlock() defer m.mtx.Unlock()
zap.S().Debugf("msg:", "adding a new rule task", "\t task name:", taskName)
newTask, err := m.prepareTask(false, rule, taskName) newTask, err := m.prepareTask(false, rule, taskName)
if err != nil { if err != nil {
@ -605,6 +610,10 @@ func (m *Manager) syncRuleStateWithTask(taskName string, rule *PostableRule) err
if err := m.addTask(rule, taskName); err != nil { if err := m.addTask(rule, taskName); err != nil {
return err return err
} }
} else {
if err := m.editTask(rule, taskName); err != nil {
return err
}
} }
} }
return nil return nil