fix: search type to lowercase (#6197)

Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
This commit is contained in:
ktx-vaidehi
2025-03-13 21:43:05 +05:30
committed by GitHub
co-authored by Taiming Liu Bhargav
parent 2db5a8b041
commit 77a70ef4fa
17 changed files with 44 additions and 41 deletions
@@ -53,6 +53,7 @@ pub enum TriggerDataType {
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct TriggerData {
pub _timestamp: i64,
pub org: String,
+1 -1
View File
@@ -60,7 +60,7 @@ pub async fn save_pipeline(
) -> Result<HttpResponse, Error> {
let org_id = path.into_inner();
let mut pipeline = pipeline.into_inner();
pipeline.name = pipeline.name.trim().to_string();
pipeline.name = pipeline.name.trim().to_lowercase();
pipeline.org = org_id;
pipeline.id = ider::generate();
match pipeline::save_pipeline(pipeline).await {
+1 -1
View File
@@ -865,7 +865,7 @@ async fn handle_derived_stream_triggers(
_timestamp: Utc::now().timestamp_micros(),
org: new_trigger.org.clone(),
module: TriggerDataType::DerivedStream,
key: new_trigger.module_key.clone(),
key: new_trigger.module_key.to_lowercase(),
next_run_at: new_trigger.next_run_at,
is_realtime: new_trigger.is_realtime,
is_silenced: new_trigger.is_silenced,
+15 -14
View File
@@ -28,7 +28,7 @@ use config::{
},
utils::json,
};
use hashbrown::HashMap;
use hashbrown::{HashMap, hash_map::Entry};
use proto::cluster_rpc;
use crate::{common::meta::ingestion, service};
@@ -82,19 +82,20 @@ pub(super) async fn ingest_usages(mut curr_usages: Vec<UsageData>) {
node,
};
let is_new = groups.contains_key(&key);
let entry = groups.entry(key).or_insert_with(|| AggregatedData {
count: 1,
usage_data: usage_data.clone(),
});
if !is_new {
continue;
} else {
entry.usage_data.num_records += usage_data.num_records;
entry.usage_data.size += usage_data.size;
entry.usage_data.response_time += usage_data.response_time;
entry.count += 1;
match groups.entry(key) {
Entry::Vacant(vacant) => {
vacant.insert(AggregatedData {
count: 1,
usage_data: usage_data.clone(),
});
}
Entry::Occupied(mut occupied) => {
let entry = occupied.get_mut();
entry.usage_data.num_records += usage_data.num_records;
entry.usage_data.size += usage_data.size;
entry.usage_data.response_time += usage_data.response_time;
entry.count += 1;
}
}
}
@@ -30,6 +30,7 @@ const selectStreamAndStreamTypeForLogs = async (page, stream) => {
await page
.locator('[data-test="log-search-index-list-select-stream"]')
.click({ force: true });
await page.waitForTimeout(2000);
await page
.locator("div.q-item")
.getByText(`${stream}`)
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
:panelSchema="chartData"
:selectedTimeObj="dashboardPanelData.meta.dateTime"
:variablesData="{}"
searchType="UI"
searchType="ui"
/>
</div>
</div>
@@ -389,7 +389,7 @@ const saveQueryData = async () => {
promql_condition: null,
aggregation: formData.query_condition.aggregation,
vrl_function: null,
search_event_type: "DerivedStream",
search_event_type: "derivedstream",
},
trigger_condition: {
// same as before
@@ -215,8 +215,8 @@ export default defineComponent({
const selectedQueryTypeTab = ref<"summary" | "all">("summary");
const selectedSearchType = ref("Dashboards");
const searchTypes = ["Dashboards", "UI", "Others"]; // UI, Dashboards, Reports, Alerts, Values, Other, RUM, DerivedStream,
const selectedSearchType = ref("dashboards");
const searchTypes = ["dashboards", "ui", "Others"]; // UI, Dashboards, Reports, Alerts, Values, Other, RUM, DerivedStream,
const runningQueryTypes = [
{ label: "User Summary", value: "summary" },
@@ -642,7 +642,7 @@ export default defineComponent({
return {
...query,
search_type_label:
query.search_type === "Dashboards" || query.search_type === "UI"
query.search_type === "dashboards" || query.search_type === "ui"
? query.search_type
: "Others",
};
@@ -457,7 +457,7 @@ export const usePanelDataLoader = (
dashboard_id: dashboardId?.value,
folder_id: folderId?.value,
},
searchType.value ?? "Dashboards",
searchType.value ?? "dashboards",
),
abortControllerRef.signal,
);
@@ -1098,7 +1098,7 @@ export const usePanelDataLoader = (
dashboard_id: dashboardId?.value,
folder_id: folderId?.value,
},
searchType.value ?? "Dashboards",
searchType.value ?? "dashboards",
),
abortControllerRef.signal,
);
+4 -4
View File
@@ -1901,7 +1901,7 @@ const useLogs = () => {
query: queryReq,
page_type: searchObj.data.stream.streamType,
},
"UI",
"ui",
).then((res: any) => {
$q.notify({
type: "positive",
@@ -2091,7 +2091,7 @@ const useLogs = () => {
page_type: searchObj.data.stream.streamType,
traceparent,
},
"UI",
"ui",
)
.then(async (res) => {
// check for total records update for the partition and update pagination accordingly
@@ -2261,7 +2261,7 @@ const useLogs = () => {
page_type: searchObj.data.stream.streamType,
traceparent,
},
"UI",
"ui",
)
.then(async (res) => {
if (
@@ -2583,7 +2583,7 @@ const useLogs = () => {
page_type: searchObj.data.stream.streamType,
traceparent,
},
"UI",
"ui",
)
.then(async (res: any) => {
removeTraceId(traceId);
+1 -1
View File
@@ -417,7 +417,7 @@ export default {
page_type: searchObj.data.stream.streamType,
traceparent,
},
"UI",
"ui",
);
unflattendData.value = res.data.hits[0]._original;
} catch (err: any) {
+1 -1
View File
@@ -1256,7 +1256,7 @@ export default defineComponent({
query: this.searchObj.data.customDownloadQueryObj,
page_type: this.searchObj.data.stream.streamType,
},
"UI",
"ui",
)
.then((res) => {
this.customDownloadDialog = false;
+1 -1
View File
@@ -680,7 +680,7 @@ export default defineComponent({
query: req,
page_type: "traces",
},
"UI"
"ui"
)
.then((res) => {
searchObj.data.traceDetails.spanList = res.data?.hits || [];
+1 -1
View File
@@ -700,7 +700,7 @@ export default defineComponent({
query: req,
page_type: "traces",
},
"UI"
"ui"
)
.then((res: any) => {
if (!res.data?.hits?.length) {
+7 -7
View File
@@ -34,7 +34,7 @@ const search = {
dashboard_id?: string;
folder_id?: string;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const use_cache: boolean =
@@ -239,7 +239,7 @@ const search = {
page_type: string;
traceparent?: string;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const use_cache: boolean =
@@ -259,7 +259,7 @@ const search = {
jobId: string;
traceparent?: string;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const use_cache: boolean =
@@ -279,7 +279,7 @@ const search = {
jobId: string;
traceparent?: string;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const use_cache: boolean =
@@ -299,7 +299,7 @@ const search = {
jobId: string;
traceparent?: string;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const use_cache: boolean =
@@ -319,7 +319,7 @@ const search = {
page_type: string;
traceparent?: string;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const use_cache: boolean =
@@ -343,7 +343,7 @@ const search = {
traceparent?: string;
query: any;
},
search_type: string = "UI",
search_type: string = "ui",
) => {
if (!traceparent) traceparent = generateTraceContext()?.traceparent;
const { size, from } = query.query;
@@ -265,7 +265,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
@last-triggered-at-update="
handleLastTriggeredAtUpdate
"
searchType="Dashboards"
searchType="dashboards"
/>
<q-dialog v-model="showViewPanel">
<QueryInspector
@@ -458,7 +458,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
@last-triggered-at-update="
handleLastTriggeredAtUpdate
"
searchType="Dashboards"
searchType="dashboards"
/>
</template>
+1 -1
View File
@@ -175,7 +175,7 @@ export default defineComponent({
org_identifier: store.state.selectedOrganization.identifier,
query: queryReq,
page_type: streamData.value?.stream_type || "logs",
}, "UI")
}, "ui")
.then((res) => {
isLoading.value.pop();
if (res.data.from > 0) {