diff --git a/appstate/appstate.go b/appstate/appstate.go new file mode 100644 index 000000000..2435629a8 --- /dev/null +++ b/appstate/appstate.go @@ -0,0 +1,28 @@ +// Copyright 2013 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package appstate + +import ( + "github.com/prometheus/prometheus/config" + "github.com/prometheus/prometheus/retrieval" + "github.com/prometheus/prometheus/rules" + "github.com/prometheus/prometheus/storage/metric" +) + +type ApplicationState struct { + Config *config.Config + RuleManager rules.RuleManager + Persistence metric.MetricPersistence + TargetManager retrieval.TargetManager +} diff --git a/main.go b/main.go index 39af0be2f..35f6b7600 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ package main import ( "flag" + "github.com/prometheus/prometheus/appstate" "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/retrieval" "github.com/prometheus/prometheus/retrieval/format" @@ -73,7 +74,14 @@ func main() { log.Fatalf("Error loading rule files: %v", err) } - web.StartServing(persistence) + appState := &appstate.ApplicationState{ + Config: conf, + RuleManager: ruleManager, + Persistence: persistence, + TargetManager: targetManager, + } + + web.StartServing(appState) for { select { diff --git a/web/api/api.go b/web/api/api.go index 7aa4e891a..7c7b6155a 100644 --- a/web/api/api.go +++ b/web/api/api.go @@ -17,8 +17,8 @@ type MetricsService struct { time utility.Time } -func NewMetricsService(p metric.MetricPersistence) *MetricsService { +func NewMetricsService(persistence metric.MetricPersistence) *MetricsService { return &MetricsService{ - persistence: p, + persistence: persistence, } } diff --git a/web/static/css/graph.css b/web/static/css/graph.css new file mode 100644 index 000000000..5a84cbaab --- /dev/null +++ b/web/static/css/graph.css @@ -0,0 +1,23 @@ +body { + margin: 0; +} + +.graph_container { + font-family: Arial, Helvetica, sans-serif; +} + +.graph { + position: relative; +} + +svg { + border: 1px solid #aaa; + margin-bottom: 5px; +} + +.legend { + display: inline-block; + vertical-align: top; + margin: 0 0 0 0px; + background- +} diff --git a/web/static/css/prometheus.css b/web/static/css/prometheus.css index 52979a4c4..2a563b085 100644 --- a/web/static/css/prometheus.css +++ b/web/static/css/prometheus.css @@ -1,5 +1,4 @@ body { - margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; @@ -7,26 +6,6 @@ body { background-color: #eee; } -.graph_container { - font-family: Arial, Helvetica, sans-serif; -} - -.graph { - position: relative; -} - -svg { - border: 1px solid #aaa; - margin-bottom: 5px; -} - -.legend { - display: inline-block; - vertical-align: top; - margin: 0 0 0 0px; - background- -} - input:not([type=submit]):not([type=file]):not([type=button]) { border: 1px solid #aaa; -webkit-border-radius: 3px; diff --git a/web/static/graph.html b/web/static/graph.html index 2d64d9e6a..592f5a3c5 100644 --- a/web/static/graph.html +++ b/web/static/graph.html @@ -6,6 +6,7 @@ + diff --git a/web/static/index.html b/web/static/index.html index ce04c7bd4..df6e32cfa 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -4,6 +4,7 @@
+{{.Config}} ++