Commit Graph

144 Commits

Author SHA1 Message Date
Chris Cowan
65b1e536d7
Elasticsearch: Add word highlighting to search results (#30293)
* Elasticsearch: Add word highlighting to logs

* Remove unused deps; refactor matching code to remove matchAll

* Adding searchWords test

* Adding two matches for highlighting

* Adding code comments

* formatting comments
2021-02-24 16:31:17 +00:00
Torkel Ödegaard
1d689888b0
Prettier: Upgrade to 2 (#30387)
* Updated package json but not updated source files

* Update eslint plugin

* updated files
2021-01-20 07:59:48 +01:00
Chris Cowan
5088e2044a
Elasticsearch: Support extended stats and percentiles in terms order by (#28910)
Adds support to the terms aggregation for ordering by percentiles and extended stats. 

Closes #5148

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-01-15 12:10:16 +01:00
Giordano Ricci
d8b4ed3a0e
Elasticsearch: fix handling of null values in query_builder (#30234) 2021-01-13 09:04:36 +00:00
Chris Cowan
cf1c01dd8b
Elasticsearch: Add Support for Serial Differencing Pipeline Aggregation (#28618)
* Elasticsearch: Add support for serial diff pipeline aggregation

* Removing settings transsforms

* Removing unused deps

* removing unused dep

* Fixing type in test

* Adding backend support for serial_diff
2021-01-08 11:52:23 +00:00
Alexander Zobnin
ae575158ed
Elasticsearch: Remove timeSrv dependency (#29770)
* Elasticsearch: use time range from queries or default one

* Fix tests

* Fix language provider tests

* Elasticsearch: remove timeSrv dependency for logs context (#29841)

* Elasticsearch: remove timeSrv dependency for logs context

* Add tests & slighlty improve getIndexList

Co-authored-by: Elfo404 <gio.ricci@grafana.com>
2020-12-17 14:24:20 +03:00
Chris Cowan
491a4dc967
Elasticsearch: View in context feature for logs (#28764)
* Elasticsearch: View in context feature for logs

* Fixing unused type

* Limit show context to esVersion > 5

* Fixing scope for showContextToggle; removing console.log

* Fix typing; adding check for lineField

* Update test to reflect new sorting keys for logs

* Removing sort from metadata fields

* Adding comment for clarity

* Fixing scenerio where the data is missing

* remove export & use optional chaining

Co-authored-by: Elfo404 <gio.ricci@grafana.com>
2020-12-10 11:19:14 +00:00
Giordano Ricci
bb45f5fedc
Elasticsearch: Migrate queryeditor to React (#28033)
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-12-04 14:29:40 +00:00
Chris Cowan
4ed7612e57
Elasticsearch: Add Moving Function Pipeline Aggregation (#28131)
* Elasticsearch: Add Moving Function Pipeline Aggregation

* Removing support for moving average in 7.x

* Fixing getMetricAggTypes to handle undefined esVersion

* Adding moving_fn to go code

* Update public/app/plugins/datasource/elasticsearch/metric_agg.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Adding test for esversion 70

* Removing default value for script, adding placeholder instead

* Fixing formatting

* Adding code for handling missing or obsolete aggregations

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
2020-11-11 17:42:28 +00:00
Chris Cowan
3af193358c
Elasticsearch: Support chained pipeline aggregations (#27945)
* Elasticsearch: Support multiple pipeline aggregations for a query

* Ensuring descendents are deleted with their parents.

* Update public/app/plugins/datasource/elasticsearch/metric_agg.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Update public/app/plugins/datasource/elasticsearch/query_def.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Update public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Fixing typo

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
2020-10-08 11:24:54 +01:00
Giordano Ricci
09574547b8
Elasticsearch: Fix ad-hoc filter support for Raw Data query and new table panel (#28064) 2020-10-07 09:37:31 +01:00
Giordano Ricci
d4f785d20a
Elasticsearch: Add query's refId to each series returned by a query (#27614) 2020-09-24 18:06:19 +01:00
Domas
9acb99904a
Elasticsearch: Fixes localized dates in index pattern (#27351)
Fixes #8403
2020-09-07 18:27:56 +02:00
Ivana Huckova
3fd810417f
Elasticsearch: Create Raw Doc metric to render raw JSON docs in columns in the new table panel (#26233)
* test

* WIP: Create v2 version

* Update tests, remove conosole logs, refactor

* Remove incorrect types

* Update type

* Rename legacy and new metrics

* Update

* Run request when Raw Data tto Raw Document switch

* Fix size updating

* Remove _source field from table results as we are showing each source field as column

* Remove _source just for metrics, not logs

* Revert "Remove _source just for metrics, not logs"

This reverts commit 611b6922f7.

* Revert "Remove _source field from table results as we are showing each source field as column"

This reverts commit 31a9d5f81b.

* Add vis preference for logs

* Update visualisation to logs

* Revert "Revert "Remove _source just for metrics""

This reverts commit a102ab2894.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-07-15 15:20:39 +02:00
Torkel Ödegaard
8f78b0e7bc
Chore: Fix all Typescript strict null errors (#26204)
* Chore: Fix typescript strict null errors

* Added new limit

* Fixed ts issue

* fixed tests

* trying to fix type inference

* Fixing more ts errors

* Revert tsconfig option

* Fix

* Fixed code

* More fixes

* fix tests

* Updated snapshot

* Chore: More ts strict null fixes

* More fixes in some really messed up azure config components

* More fixes, current count: 441

* 419

* More fixes

* Fixed invalid initial state in explore

* Fixing tests

* Fixed tests

* Explore fix

* More fixes

* Progress

* Sub 300

* Now at 218

* Progress

* Update

* Progress

* Updated tests

* at 159

* fixed tests

* Progress

* YAy blow 100! at 94

* 10,9,8,7,6,5,4,3,2,1... lift off

* Fixed tests

* Fixed more type errors

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-07-10 12:46:59 +02:00
Marcelo Nunes Alves
be961c5466
Elasticsearch: Fix using multiple bucket script aggregations when only grouping by terms (#24064)
* In the parser when it was configurate more bucket it put the formula in name column

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Process/Tests - backend (Go)

* Update pkg/tsdb/elasticsearch/response_parser.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* reverse

* Update pkg/tsdb/elasticsearch/response_parser.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-07-09 15:21:19 +02:00
Marcus Efraimsson
03f7fd0527
Elasticsearch: Support using a variable for histogram and terms min doc count (#25392)
Support using a variable for histogram and terms min doc count. 
This is an addition to #21064.

Ref #21052
Ref #21064
2020-06-17 10:04:38 +02:00
Kevin Retzke
51d1261a4b
Elasticsearch: Adds cumulative sum aggregation support (#24820)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-06-01 23:55:15 +02:00
Ryan McKinley
5dca59f720
Field: getFieldTitle as field / series display identity and use it in all field name matchers & field / series name displays (#24024)
* common title handling

* show labels

* update comment

* Update changelog for v7.0.0-beta1 (#24007)

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-Authored-By: Andrej Ocenas <mr.ocenas@gmail.com>
Co-Authored-By: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* verify-repo-update: Fix Dockerfile.deb (#24030)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CircleCI: Upgrade build pipeline tool (#24021)

* CircleCI: Upgrade build pipeline tool

* Devenv: ignore enterprise (#24037)

* Add header icon to Add data source page (#24033)

* latest.json: Update testing version (#24038)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix login page redirected from password reset (#24032)

* Storybook: Rewrite stories to CSF (#23989)

* ColorPicker to CSF format

* Convert stories to CSF

* Do not export ClipboardButton

* Update ConfirmButton

* Remove unused imports

* Fix feedback

* changelog enterprise 7.0.0-beta1 (#24039)

* CircleCI: Bump grafana/build-container revision (#24043)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Changelog: Updates changelog with more feature details (#24040)

* Changelog: Updates changelog with more feature details

* spell fix

* spell fix

* Updates

* Readme update

* Updates

* Select: fixes so component loses focus on selecting value or pressing outside of input. (#24008)

* changed the value container to a class component to get it to work with focus (maybe something with context?).

* added e2e tests to verify that the select focus is working as it should.

* fixed according to feedback.

* updated snapshot.

* Devenv: add remote renderer to grafana (#24050)

* NewPanelEditor: minor UI twekas (#24042)

* Forward ref for tabs, use html props

* Inspect:  add inspect label to drawer title

* Add tooltips to sidebar pane tabs, copy changes

* Remove unused import

* Place tooltips over tabs

* Inspector: dont show transformations select if there is only one data frame

* Review

* Changelog: Add a breaking change (#24051)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CircleCI: Unpin grafana/docs-base (#24054)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Search: close overlay on Esc press (#24003)

* Search: Close on Esc

* Search: Increase bottom padding for the last item in section

* Search: Move closing search to keybindingsSrv

* Search: Fix folder view

* Search: Do not move folders if already in folder

* Docs: Adds deprecation notice to changelog and docs for scripted dashboards (#24060)

* Update CHANGELOG.md (#24047)

Fix typo

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>

* Documentation: Alternative Team Sync Wording (#23960)

* Alternative wording for team sync docs

Signed-off-by: Joe Elliott <number101010@gmail.com>

* Update docs/sources/auth/team-sync.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Fix misspell issues (#23905)

* Fix misspell issues

See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* Fix codespell issues

See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* ci please?

* non-empty commit - ci?

* Trigger build

Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>

* fix compile error

* better series display

* better display

* now with prometheus and loki

* a few more tests

* Improvements and tests

* thinking

* More advanced and smart default title generation

* Another fix

* Progress but dam this will be hard

* Reverting the time series Value field name change

* revert revert going in circles

* add a field state object

* Use state title when converting back to legacy format

* Improved the join (series to columsn) transformer

* Got tests running again

* Rewrite of seriesToColums that simplifies and fixing tests

* Fixed the tricky problem of multiple time field when not used in join

* Prometheus: Restoring prometheus formatting

* Graphite: Disable Grafana's series naming

* fixed imports

* Fixed tests and made rename transform change title instead

* Fixing more tests

* fix more tests

* fixed import issue

* Fixed more circular dependencies

* Renamed to getFieldTitle

* More rename

* Review feedback

* Fix for showing field title in calculate field transformer

* fieldOverride: Make it clear that state title after applying defaults & overrides

* Fixed ts issue

* Update packages/grafana-ui/src/components/TransformersUI/OrganizeFieldsTransformerEditor.tsx

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Richard Hartmann <RichiH@users.noreply.github.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
Co-authored-by: Joe Elliott <joe.elliott@grafana.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Mario Trangoni <mario@mariotrangoni.de>
Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-05-07 10:42:03 +02:00
Hugo Häggmark
b51e28bc15
Chore: reduces strict null errors to 824 (#22744)
* Chore: reduces strict null errors with 100+

* Chore: lowers the build error number
2020-03-12 10:22:33 +01:00
Andrej Ocenas
934d93ad94
Elastic: Map level field based on config. (#22182)
* Map level field based on config.

* Fix type
2020-02-17 16:49:24 +01:00
Emil Hessman
25e2f1c2dd Plugins: Apply adhoc filter in Elasticsearch logs query (#21346)
Fixes #21086
2020-01-21 09:39:55 +00:00
Andrej Ocenas
5a3c1dc6a4
Elastic: Add data links in datasource config (#20186) 2019-12-11 17:40:56 +01:00
kay delaney
880fbcb09a
Chore/Tech debt: Remove (most) instances of $q angular service use (#20668)
* Chore/Tech debt: Remove (most) instances of $q angular service use
Removes instances where the angular $q service is used and replaces
it with native Promises.
2019-12-05 09:04:03 +00:00
Andrej Ocenas
4c9cb415ec Elastic: Fix parsing for millisecond number timestamps (#20290)
* Stop parsing 'field'

* Remove time field from query for docs queries

* Test refactor to test all versions

* Fix tests
2019-12-04 14:43:43 +01:00
kay delaney
ca3dff99e8
Chore: Bumps prettier version for new typescript syntax support (#20463)
* Chore: Bumps prettier version for new typescript syntax support

* Ran new version of prettier against the codebase
2019-11-19 13:59:39 +00:00
David
a499586f15
Elasticsearch: Support rendering in logs panel (#20229)
* Elasticsearch: Support rendering in logs panel

- add "Logs" metric query type so panels can inform the datasource that
the query is a logs query
- datasource modifies target when metric query type `logs` is detected
- then existing log result processeing paths are followed

* Fix failing test, number of agg types changed
2019-11-07 12:13:24 +00:00
Dominik Prokop
9b7748ec13
Chore: Reorg packages (#20111)
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data

* Move types from grafana-ui to grafana-data

* Move valueFormats to grafana-data

* Move utils from grafana-ui to grafana-data

* Update imports in grafana-ui

* revert data's tsconfig change

* Update imports in grafana-runtime

* Fix import paths in grafana-ui

* Move rxjs to devDeps

* Core import updates batch 1

* Import updates batch 2

* Imports fix batch 3

* Imports fixes batch i don't know

* Fix imorts in grafana-toolkit

* Fix imports after master merge
2019-10-31 10:48:05 +01:00
Andrej Ocenas
551e24f9f8
ReactMigration: Migrate Loki and Elastic config pages to React (#19979) 2019-10-25 16:43:20 +02:00
kay delaney
99411bf37a
Types: Adds type safety to appEvents (#19418)
* Types: Add type safety to appEvents
2019-10-14 09:27:47 +01:00
David
cf7ace6aad
Rename live option in queries (#19658) 2019-10-07 14:09:46 +02:00
James Beckett
ba11958a52 Elasticsearch: allow templating queries to order by doc_count (#18870)
* Elasticsearch Datasource: allow templating queries to order by doc_count

* Elasticsearch Datasource: add tests for doc_count templating queries
2019-09-16 18:41:53 +03:00
Ryan McKinley
c777301535 DataFrame: split DataFrameHelper into MutableDataFrame and FieldCache (#18795)
* add appending utility

* add appending utility

* update comment

* rename to mutable

* move mutable functions out of DataFrameHelper

* move mutable functions out of DataFrameHelper

* move mutable functions out of DataFrameHelper

* turn DataFrameHelper into FieldCache

* guess time from name

* graph the numbers

* return the timeField, not just the index

* just warn on duplicate field names

* only use a parser if the input is a string

* append init all fields to the same length

* typo

* only parse string if value is a string

* DataFrame: test fixes

* Switch to null for missing values

* Fixed tests
2019-09-01 14:44:22 +02:00
Ryan McKinley
5a41e8b119 Refactor: move KeyValue and deprecation warning to @grafana/data (#18582)
* move KeyValue and deprecation warning

* move KeyValue and deprecation warning

* rename displayProcessor file
2019-08-16 11:10:32 +02:00
Ryan McKinley
e59bae55d9
DataFrame: convert from row based to a columnar value format (#18391) 2019-08-15 09:18:51 -07:00
Tobias Skarhed
e1cec1069c noImplicitAny: 1670 errors (#18035)
* Sub 2000 errors

* Down to 1670 errors

* Minor fixes
2019-07-11 17:05:45 +02:00
Ryan McKinley
fcdc29746f
@grafana/data: export dateMath and rangeUtil (#17971) 2019-07-05 23:43:12 -07:00
Ryan McKinley
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
Marcus Efraimsson
0833f26b43
Elasticsearch: Fix default max concurrent shard requests (#17770)
Elasticsearch v7.0 changed the behavior of max concurrent shard
requests and the default to 5. v5.6 and before 7.0 the default
is 256. This adds some additional behavior given certain
version is selected when configure the datasource to set
default max concurrent shard requests.
Changing from a version pre-v7.0+ to v7.0+ sets max
concurrent shard requests to 5.
Changing from a version v7.0+ to a pre-v7.0 sets max
concurrent shard requests to 256.

Fixes #17454
2019-06-28 18:38:16 +02:00
Marcus Efraimsson
eecd8d1064 Elasticsearch: Visualize logs in Explore (#17605)
* explore: try to use existing mode when switching datasource

* elasticsearch: initial explore logs support

* Elasticsearch: Adds ElasticsearchOptions type
Updates tests accordingly

* Elasticsearch: Adds typing to query method

* Elasticsearch: Makes maxConcurrentShardRequests optional

* Explore: Allows empty query for elasticsearch datasource

* Elasticsearch: Unifies ElasticsearchQuery interface definition
Removes check for context === 'explore'

* Elasticsearch: Removes context property from ElasticsearchQuery interface
Adds field property
Removes metricAggs property
Adds typing to metrics property

* Elasticsearch: Runs default 'empty' query when 'clear all' button is pressed

* Elasticsearch: Removes index property from ElasticsearchOptions interface

* Elasticsearch: Removes commented code from ElasticsearchQueryField.tsx

* Elasticsearch: Adds comment warning usage of for...in to elastic_response.ts

* Elasticsearch: adds tests related to log queries
2019-06-24 21:15:03 +01:00
Hugo Häggmark
ceb9f0855b
Chore: Replaces moment with Grafanas DateTime (#16919)
* Wip: Initial commit

* Refactor: Replaces moment.utc(

* Refactor: replaces the last isMoment statements

* Refactor: Removes almost all moment imports

* Refactor: Moves moment_wrapper to grafana/ui

* Refactor: Renames momentWrapper

* Refactor: Removes one more moment import

* Refactor: Removes unitOfTime import

* Fix: Fixes Prettier error

* Refactor: Renames DateTimeType to DateTime

* Refactor: Renames isDateTimeType to isDateTime

* Refactor: Renames dateTime to dateTime

* Feature: Bans moment imports and types
2019-05-08 13:51:44 +02:00
Ryan McKinley
d881976c9d Refactor: move datemath to grafana/ui (#16890)
* move datemath to grafana/ui

* don't reference @grafana/ui from its own component
2019-05-06 12:36:42 +02:00
Alcides Viamontes E
cff2be0d66 elasticsearch: add 7.x version support (#16646)
Adds a new version option 7.0+ (70 internally).
Version 7.0+ doesn't include document types in index mappings 
so support for handling this have been added.
Version 7.0+ returns number of hits in a different way so 
support for handling this have been added.
Version 7.0+ doesn't support sending 
max_concurrent_shard_requests in multisearch header so 
support for sending this in query string have been added.
Update elastic6 docker block and dashboards (devenv) to use 
6.7.1 images, filebeat index name is now filebeat-YYYY.MM.DD 
and dashboard include correct tags and links.
Add elastic7 docker block and provisioning (devenv).
Updates documentation regarding new version.

Closes #15622
2019-04-25 09:41:13 +02:00
Igor Ratsuk
930fd8b43a Elasticsearch: Fix view percentiles metric in table without date histogram (#15686)
Fix for properly display percentiles metrics in table panel when 
using a query without date histogram and for example grouping by 
terms.

Fixes #3786
2019-03-29 13:22:04 +07:00
Daniel Lee
462e0d0c6f
Fix: Elasticsearch fix template variables in the alias field (#16629)
Fixes #16040

Fix so that a template variable in the alias field is not interpolated on blur and only the value sent in the query is interpolated. Does a deep clone of the options.targets to avoid changing the original alias field.
2019-03-26 16:15:23 +01:00
Torkel Ödegaard
cfea8bdcae Prettier had not been running as a precommit hook for some time so had to run in on all files again 2019-02-13 11:14:53 +01:00
Marcus Efraimsson
130e4aa666
Merge pull request #14608 from marefr/es_bucket_script
Fix support bucket script pipeline aggregations
2019-01-14 15:58:42 +01:00
SamuelToh
e1f6870fce 4075: Interpolate tempvar on alias 2019-01-10 09:53:06 +10:00
Marcus Efraimsson
b45f72a140
elasticsearch: support bucket script pipeline aggregations 2018-12-20 01:24:36 +01:00
Marcus Efraimsson
9a8ad70013
fix pipeline aggregations on doc count 2018-11-15 19:06:47 +01:00