Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
803cb20b
Commit
803cb20b
authored
Apr 12, 2016
by
Fabian Reinartz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #389 from prometheus/routing-tree-deux
Update routing tree location
parents
11378470
465fd250
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
4 deletions
+82
-4
routing-tree-editor.css
content/css/routing-tree-editor.css
+39
-0
configuration.md
content/docs/alerting/configuration.md
+3
-0
routing-tree-editor.html
content/webtools/alerting/routing-tree-editor.html
+26
-0
header.html
layouts/header.html
+1
-0
routing-tree.js
static/routing-tree.js
+13
-4
No files found.
content/css/routing-tree-editor.css
0 → 100644
View file @
803cb20b
.routing-table
{
font
:
12px
sans-serif
;
}
.node
circle
{
stroke
:
#e6522c
;
stroke-width
:
1.5px
;
}
.node
text
{
font
:
10px
sans-serif
;
}
.link
{
fill
:
none
;
stroke
:
#ccc
;
stroke-width
:
1.5px
;
}
.form-control.label-input
{
padding
:
2px
;
width
:
450px
;
}
textarea
{
border-color
:
#ddd
;
height
:
450px
;
padding
:
2px
0
;
width
:
100%
;
font-family
:
monospace
;
}
.block
{
display
:
block
;
}
.inline-block
{
display
:
inline-block
;
}
content/docs/alerting/configuration.md
View file @
803cb20b
...
@@ -12,6 +12,9 @@ While the command-line flags configure immutable system parameters, the
...
@@ -12,6 +12,9 @@ While the command-line flags configure immutable system parameters, the
configuration file defines inhibition rules, notification routing and
configuration file defines inhibition rules, notification routing and
notification receivers.
notification receivers.
The
[
visual editor
](
/webtools/alerting/routing-tree-editor
)
can assist in
building routing trees.
To view all available command-line flags, run
`alertmanager -h`
.
To view all available command-line flags, run
`alertmanager -h`
.
Alertmanager can reload its configuration at runtime. If the new configuration
Alertmanager can reload its configuration at runtime. If the new configuration
...
...
content/
doc
s/alerting/routing-tree-editor.html
→
content/
webtool
s/alerting/routing-tree-editor.html
View file @
803cb20b
---
---
title: Routing tree editor
title: Routing tree editor
sort_rank: 4
nav_icon: sliders
---
---
<style>
.routing-table
{
font
:
12px
sans-serif
;
}
.node
circle
{
stroke
:
#e6522c
;
stroke-width
:
1.5px
;
}
.node
text
{
font
:
10px
sans-serif
;
}
.link
{
fill
:
none
;
stroke
:
#ccc
;
stroke-width
:
1.5px
;
}
.form-control.label-input
{
padding
:
2px
;
width
:
450px
;
}
textarea
{
border-color
:
#ddd
;
height
:
450px
;
padding
:
2px
0
;
width
:
100%
;
font-family
:
monospace
;
}
.block
{
display
:
block
;
}
.inline-block
{
display
:
inline-block
;
}
</style>
<h1
id=
"routing-tree-editor"
class=
"page-header"
>
<h1
id=
"routing-tree-editor"
class=
"page-header"
>
Routing tree editor
Routing tree editor
<a
class=
"header-anchor"
href=
"#routing-tree-editor"
name=
"routing-tree-editor"
></a>
<a
class=
"header-anchor"
href=
"#routing-tree-editor"
name=
"routing-tree-editor"
></a>
...
@@ -61,10 +16,10 @@ textarea {
...
@@ -61,10 +16,10 @@ textarea {
<div
class=
"form-inline"
>
<div
class=
"form-inline"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
class=
"label-input form-control"
type=
"text"
placeholder=
'{service="foo-service", severity="critical"}'
\
>
<input
class=
"js-label-set-input label-input form-control"
type=
"text"
placeholder=
'{service="foo-service", severity="critical"}'
\
>
</div>
<button
type=
"button"
class=
"js-find-match btn btn-default"
>
Match Label Set
</button>
<button
type=
"button"
class=
"js-find-match btn btn-default"
>
Match Label Set
</button>
</div>
</div>
</div>
</div>
</div>
<script
src=
"/assets/d3.v3.min.js"
></script>
<script
src=
"/assets/d3.v3.min.js"
></script>
<script
src=
"/assets/js-yaml.min.js"
></script>
<script
src=
"/assets/js-yaml.min.js"
></script>
...
...
layouts/header.html
View file @
803cb20b
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<!-- Custom styles for this template -->
<!-- Custom styles for this template -->
<link
href=
"/css/docs.css"
rel=
"stylesheet"
>
<link
href=
"/css/docs.css"
rel=
"stylesheet"
>
<link
href=
"/css/routing-tree-editor.css"
rel=
"stylesheet"
>
<!-- Custom Fonts -->
<!-- Custom Fonts -->
<link
href=
"/assets/font-awesome-4.2.0/css/font-awesome.min.css"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"/assets/font-awesome-4.2.0/css/font-awesome.min.css"
rel=
"stylesheet"
type=
"text/css"
>
...
...
static/routing-tree.js
View file @
803cb20b
...
@@ -25,7 +25,6 @@ var tooltip = d3.select("body")
...
@@ -25,7 +25,6 @@ var tooltip = d3.select("body")
.
style
(
"
z-index
"
,
"
10
"
)
.
style
(
"
z-index
"
,
"
10
"
)
.
style
(
"
visibility
"
,
"
hidden
"
);
.
style
(
"
visibility
"
,
"
hidden
"
);
// Global for now so we can play with it from the console
function
parseSearch
(
searchString
)
{
function
parseSearch
(
searchString
)
{
var
labels
=
searchString
.
replace
(
/{|}|
\"
|
\s
/g
,
""
).
split
(
"
,
"
);
var
labels
=
searchString
.
replace
(
/{|}|
\"
|
\s
/g
,
""
).
split
(
"
,
"
);
var
o
=
{};
var
o
=
{};
...
@@ -58,7 +57,18 @@ d3.select(".js-parse-and-draw").on("click", function() {
...
@@ -58,7 +57,18 @@ d3.select(".js-parse-and-draw").on("click", function() {
// Click handler for input labelSet
// Click handler for input labelSet
d3
.
select
(
"
.js-find-match
"
).
on
(
"
click
"
,
function
()
{
d3
.
select
(
"
.js-find-match
"
).
on
(
"
click
"
,
function
()
{
var
searchValue
=
document
.
querySelector
(
"
input
"
).
value
labelServiceHandler
();
});
$
(
document
).
on
(
"
keyup
"
,
function
(
e
)
{
if
(
e
.
keyCode
!=
13
)
{
return
;
}
labelServiceHandler
();
});
function
labelServiceHandler
()
{
var
searchValue
=
document
.
querySelector
(
"
.js-label-set-input
"
).
value
var
labelSet
=
parseSearch
(
searchValue
);
var
labelSet
=
parseSearch
(
searchValue
);
var
matches
=
match
(
root
,
labelSet
)
var
matches
=
match
(
root
,
labelSet
)
var
nodes
=
tree
.
nodes
(
root
);
var
nodes
=
tree
.
nodes
(
root
);
...
@@ -66,8 +76,7 @@ d3.select(".js-find-match").on("click", function() {
...
@@ -66,8 +76,7 @@ d3.select(".js-find-match").on("click", function() {
nodes
.
forEach
(
function
(
n
)
{
n
.
matched
=
false
});
nodes
.
forEach
(
function
(
n
)
{
n
.
matched
=
false
});
nodes
[
idx
].
matched
=
true
;
nodes
[
idx
].
matched
=
true
;
update
(
root
);
update
(
root
);
// Animate path to node?
}
});
// Match does a depth-first left-to-right search through the route tree
// Match does a depth-first left-to-right search through the route tree
// and returns the matching routing nodes.
// and returns the matching routing nodes.
...
...
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