Skip to content

Commit

Permalink
Fix: different issues
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Nov 22, 2023
1 parent 8c6c4bb commit d3a1c8d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
13 changes: 9 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ You need:

### Building

### All the stack

```shell
./build_and_start.sh
```

#### Frontend

```bash
$ yarn install
$ yarn build
$ npm install
$ npm run build
```

When developing the front, use `yarn dev`.
When developing the front, use `npm run dev`.

#### Backend

Expand Down Expand Up @@ -49,7 +55,6 @@ $ npm run test
$ go test -v ./pkg/...
```


## Release

TODO
6 changes: 6 additions & 0 deletions build_and_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

npm install
npm run build
mage -v
docker-compose up --build --force-recreate
6 changes: 4 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ services:
volumes:
- ./:/var/lib/grafana/plugins/grafana-quickwit-datasource
- ./provisioning:/etc/grafana/provisioning
# - ./grafana/storage:/var/lib/grafana
# - ./grafana/grafana.ini:/etc/grafana/grafana.ini
- gquickwit:/var/lib/grafana
extra_hosts:
- "host.docker.internal:host-gateway"

volumes:
gquickwit:
8 changes: 4 additions & 4 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { cloneDeep, first as _first, map as _map, groupBy } from 'lodash';
import { Observable, lastValueFrom, from, isObservable, of } from 'rxjs';
import { catchError, mergeMap, map } from 'rxjs/operators';
import { intervalMap } from './IntervalMap';
import { Interval } from './types';

import {
AbstractQuery,
Expand Down Expand Up @@ -33,7 +32,7 @@ import {
SupplementaryQueryType,
TimeRange,
} from '@grafana/data';
import { BucketAggregation, DataLinkConfig, ElasticsearchQuery, Field, FieldMapping, IndexMetadata, Logs, TermsQuery } from './types';
import { BucketAggregation, DataLinkConfig, ElasticsearchQuery, Field, FieldMapping, IndexMetadata, Logs, TermsQuery, Interval } from './types';
import { DataSourceWithBackend, getTemplateSrv, TemplateSrv } from '@grafana/runtime';
import { LogRowContextOptions, LogRowContextQueryDirection, QuickwitOptions } from 'quickwit';
import { ElasticQueryBuilder } from 'QueryBuilder';
Expand Down Expand Up @@ -437,6 +436,7 @@ export class QuickwitDataSource

private makeLogContextDataRequest = (row: LogRowModel, options?: LogRowContextOptions) => {
const direction = options?.direction || LogRowContextQueryDirection.Backward;

const logQuery: Logs = {
type: 'logs',
id: '1',
Expand All @@ -445,7 +445,7 @@ export class QuickwitDataSource
// Sorting of results in the context query
sortDirection: direction === LogRowContextQueryDirection.Backward ? 'desc' : 'asc',
// Used to get the next log lines before/after the current log line using sort field of selected log line
searchAfter: row.dataFrame.fields.find((f) => f.name === 'sort')?.values[row.rowIndex] ?? [row.timeEpochMs],
searchAfter: row.dataFrame.fields.find((f) => f.name === 'sort')?.values.get(row.rowIndex) ?? [row.timeEpochMs],
},
};

Expand Down Expand Up @@ -501,7 +501,7 @@ export class QuickwitDataSource
}

getLogRowContextUi?(row: LogRowModel, runContextQuery?: (() => void) | undefined): ReactNode {
throw new Error('Method not implemented.');
return true;
}

/**
Expand Down

0 comments on commit d3a1c8d

Please sign in to comment.