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
8c8fdadb
Commit
8c8fdadb
authored
Sep 11, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trace failed executions
parent
e1283100
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
pkg/services/alerting/engine.go
+10
-6
pkg/tsdb/graphite/graphite.go
+1
-1
No files found.
pkg/services/alerting/engine.go
View file @
8c8fdadb
...
...
@@ -2,9 +2,12 @@ package alerting
import
(
"context"
"fmt"
"time"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
tlog
"github.com/opentracing/opentracing-go/log"
"github.com/benbjohnson/clock"
"github.com/grafana/grafana/pkg/log"
...
...
@@ -101,20 +104,21 @@ func (e *Engine) processJob(grafanaCtx context.Context, job *Job) error {
}()
alertCtx
,
cancelFn
:=
context
.
WithTimeout
(
context
.
Background
(),
alertTimeout
)
span
:=
opentracing
.
StartSpan
(
"alert execution"
)
alertCtx
=
opentracing
.
ContextWithSpan
(
alertCtx
,
span
)
job
.
Running
=
true
evalContext
:=
NewEvalContext
(
alertCtx
,
job
.
Rule
)
done
:=
make
(
chan
struct
{})
span
:=
opentracing
.
StartSpan
(
"alerting"
)
alertCtx
=
opentracing
.
ContextWithSpan
(
alertCtx
,
span
)
evalContext
.
Ctx
=
alertCtx
done
:=
make
(
chan
struct
{})
go
func
()
{
defer
func
()
{
if
err
:=
recover
();
err
!=
nil
{
e
.
log
.
Error
(
"Alert Panic"
,
"error"
,
err
,
"stack"
,
log
.
Stack
(
1
))
ext
.
Error
.
Set
(
span
,
true
)
span
.
LogFields
(
tlog
.
Error
(
fmt
.
Errorf
(
"error: %v"
,
err
)))
span
.
Finish
()
close
(
done
)
}
}()
...
...
@@ -126,8 +130,8 @@ func (e *Engine) processJob(grafanaCtx context.Context, job *Job) error {
span
.
SetTag
(
"dashboardId"
,
evalContext
.
Rule
.
DashboardId
)
span
.
SetTag
(
"firing"
,
evalContext
.
Firing
)
close
(
done
)
span
.
Finish
()
close
(
done
)
}()
var
err
error
=
nil
...
...
pkg/tsdb/graphite/graphite.go
View file @
8c8fdadb
...
...
@@ -81,7 +81,7 @@ func (e *GraphiteExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice,
return
result
}
span
,
ctx
:=
opentracing
.
StartSpanFromContext
(
ctx
,
"
alerting.graphite
"
)
span
,
ctx
:=
opentracing
.
StartSpanFromContext
(
ctx
,
"
graphite query
"
)
span
.
SetTag
(
"target"
,
target
)
span
.
SetTag
(
"from"
,
from
)
span
.
SetTag
(
"until"
,
until
)
...
...
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