Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patterns: Logs sample #430

Merged
merged 30 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cda8d2a
chore(patterns): wip poc
gtk-grafana Jun 7, 2024
04b2947
Merge remote-tracking branch 'origin/main' into gtk-grafana/issues/38…
gtk-grafana Jun 7, 2024
4861376
chore(patterns): wip poc
gtk-grafana Jun 7, 2024
3324068
chore: document/comment
gtk-grafana Jun 10, 2024
449451e
fix(patterns): refactor expanded row to fix orphaned scene bug - wip
gtk-grafana Jun 10, 2024
3f22c45
Merge branch 'main' into gtk-grafana/issues/389/patterns-table-log-sa…
gtk-grafana Jun 11, 2024
ddc29c8
chore(patterns): interpolate query string pattern value
gtk-grafana Jun 11, 2024
75c380e
feat(patterns): include all indexed labels to patterns query, and pat…
gtk-grafana Jun 11, 2024
1b4fd90
Merge remote-tracking branch 'origin/main' into gtk-grafana/issues/38…
gtk-grafana Jun 17, 2024
e0bcfcc
chore(patterns): apply detected field and line-filter to patterns sam…
gtk-grafana Jun 17, 2024
debdb2a
chore: update dependencies to 11.1
gtk-grafana Jun 27, 2024
7cc9bdd
Merge remote-tracking branch 'origin/main' into gtk-grafana/issues/38…
gtk-grafana Jul 26, 2024
478ec14
feat: if first query is empty, run without filters and show warning
gtk-grafana Jul 26, 2024
9250a11
chore: add error state if second query fails to get results
gtk-grafana Jul 26, 2024
4b7503e
fix: allow filtering after removing line-filter
gtk-grafana Jul 26, 2024
054fbd8
chore: clean up
gtk-grafana Jul 26, 2024
d0127ff
chore: add error state for initial query
gtk-grafana Jul 26, 2024
0779607
chore: refactor
gtk-grafana Jul 26, 2024
6dc343b
chore: update error message
gtk-grafana Jul 26, 2024
db2d687
chore: update error message
gtk-grafana Jul 26, 2024
2d66c1e
Merge remote-tracking branch 'origin/main' into gtk-grafana/issues/38…
gtk-grafana Aug 1, 2024
0c0ddb5
chore: cleanup/refactor
gtk-grafana Aug 2, 2024
3279d2c
chore: cleanup/refactor
gtk-grafana Aug 2, 2024
58663dd
chore: whoopsie
gtk-grafana Aug 2, 2024
f1d1ad3
Merge branch 'main' into gtk-grafana/issues/389/patterns-table-log-sa…
gtk-grafana Aug 2, 2024
9de4e6a
Merge branch 'main' into gtk-grafana/issues/389/patterns-table-log-sa…
gtk-grafana Aug 2, 2024
49b076e
chore: fix after main refactor
gtk-grafana Aug 2, 2024
5ad556f
Merge branch 'main' into gtk-grafana/issues/389/patterns-table-log-sa…
gtk-grafana Aug 2, 2024
8997905
chore: update spellcheck
gtk-grafana Aug 2, 2024
84f8a4f
Merge branch 'main' into gtk-grafana/issues/389/patterns-table-log-sa…
gtk-grafana Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: refactor
  • Loading branch information
gtk-grafana committed Jul 26, 2024
commit 0779607eb7f1930f334ac02fb7131aa1718799bc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ export class PatternsLogsSampleScene extends SceneObjectBase<PatternsLogsSampleS
if (lineFilterVariable.state.value) {
lineFilterVariable.changeValueTo('');

const children = this.state.body?.state.children;
const noticeFlexItem = children?.[0];
const noticeFlexItem = this.getNoticeFlexItem();

// The query we just fired is already correct after we clear the filters, we just need to hide the warning, and allow filtering
noticeFlexItem?.setState({
Expand Down Expand Up @@ -162,7 +161,7 @@ export class PatternsLogsSampleScene extends SceneObjectBase<PatternsLogsSampleS

private setWarningMessage(reactNode: React.ReactNode) {
const noticeFlexItem = this.getNoticeFlexItem();
const panelFlexItem = this.getVizFlexItem();
const vizFlexItem = this.getVizFlexItem();

if (noticeFlexItem instanceof SceneFlexItem) {
noticeFlexItem.setState({
Expand All @@ -173,7 +172,7 @@ export class PatternsLogsSampleScene extends SceneObjectBase<PatternsLogsSampleS
}),
});
}
return panelFlexItem;
return vizFlexItem;
}

private getNoticeFlexItem() {
Expand All @@ -186,8 +185,7 @@ export class PatternsLogsSampleScene extends SceneObjectBase<PatternsLogsSampleS
}

private getFlexItemChildren() {
const children = this.state.body?.state.children;
return children;
return this.state.body?.state.children;
}

/**
Expand All @@ -209,9 +207,8 @@ export class PatternsLogsSampleScene extends SceneObjectBase<PatternsLogsSampleS
value.data.state === LoadingState.Done &&
(value.data.series.length === 0 || value.data.series.every((frame) => frame.length === 0))
) {
const children = this.state.body?.state.children;
const noticeFlexItem = children?.[0];
const panelFlexItem = children?.[1];
const noticeFlexItem = this.getNoticeFlexItem();
const panelFlexItem = this.getVizFlexItem();

// Add a warning notice that the patterns shown will not show up in their current log results due to their existing filters.
if (noticeFlexItem instanceof SceneFlexItem) {
Expand Down