Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
0f88b470
Commit
0f88b470
authored
Sep 09, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for elasticsearch annotations when timestamp is a field and not in source, Fixes #777
parent
4798aa47
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
src/app/partials/annotations_editor.html
+3
-0
src/app/services/elasticsearch/es-datasource.js
+13
-2
No files found.
src/app/partials/annotations_editor.html
View file @
0f88b470
...
...
@@ -16,6 +16,9 @@
<div
class=
"dashboard-editor-body"
>
<div
class=
"editor-row row"
ng-if=
"editor.index == 0"
>
<div
class=
"span6"
>
<div
ng-if=
"variables.length === 0"
>
<em>
No annotations defined
</em>
</div>
<table
class=
"grafana-options-table"
>
<tr
ng-repeat=
"annotation in annotations"
>
<td
style=
"width:90%"
>
...
...
src/app/services/elasticsearch/es-datasource.js
View file @
0f88b470
...
...
@@ -76,7 +76,11 @@ function (angular, _, $, config, kbn, moment) {
var
queryInterpolated
=
templateSrv
.
replace
(
queryString
);
var
filter
=
{
"bool"
:
{
"must"
:
[{
"range"
:
range
}]
}
};
var
query
=
{
"bool"
:
{
"should"
:
[{
"query_string"
:
{
"query"
:
queryInterpolated
}
}]
}
};
var
data
=
{
"query"
:
{
"filtered"
:
{
"query"
:
query
,
"filter"
:
filter
}
},
"size"
:
100
};
var
data
=
{
"fields"
:
[
timeField
,
"_source"
],
"query"
:
{
"filtered"
:
{
"query"
:
query
,
"filter"
:
filter
}
},
"size"
:
100
};
return
this
.
_request
(
'POST'
,
'/_search'
,
annotation
.
index
,
data
).
then
(
function
(
results
)
{
var
list
=
[];
...
...
@@ -84,9 +88,16 @@ function (angular, _, $, config, kbn, moment) {
for
(
var
i
=
0
;
i
<
hits
.
length
;
i
++
)
{
var
source
=
hits
[
i
].
_source
;
var
fields
=
hits
[
i
].
fields
;
var
time
=
source
[
timeField
];
if
(
_
.
isString
(
fields
[
timeField
])
||
_
.
isNumber
(
fields
[
timeField
]))
{
time
=
fields
[
timeField
];
}
var
event
=
{
annotation
:
annotation
,
time
:
moment
.
utc
(
source
[
timeField
]
).
valueOf
(),
time
:
moment
.
utc
(
time
).
valueOf
(),
title
:
source
[
titleField
],
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment