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
7095a9d7
Commit
7095a9d7
authored
Aug 22, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into alerting
parents
3b8bba3e
90388710
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
pkg/api/cloudwatch/metrics.go
+2
-0
public/app/plugins/datasource/prometheus/datasource.ts
+6
-6
public/app/plugins/datasource/prometheus/metric_find_query.js
+10
-5
No files found.
pkg/api/cloudwatch/metrics.go
View file @
7095a9d7
...
...
@@ -28,6 +28,7 @@ var customMetricsDimensionsMap map[string]map[string]map[string]*CustomMetricsCa
func
init
()
{
metricsMap
=
map
[
string
][]
string
{
"AWS/ApiGateway"
:
{
"4XXError"
,
"5XXError"
,
"CacheHitCount"
,
"CacheMissCount"
,
"Count"
,
"IntegrationLatency"
,
"Latency"
},
"AWS/ApplicationELB"
:
{
"ActiveConnectionCount"
,
"ClientTLSNegotiationErrorCount"
,
"HealthyHostCount"
,
"HTTPCode_ELB_4XX_Count"
,
"HTTPCode_ELB_5XX_Count"
,
"HTTPCode_Target_2XX_Count"
,
"HTTPCode_Target_3XX_Count"
,
"HTTPCode_Target_4XX_Count"
,
"HTTPCode_Target_5XX_Count"
,
"NewConnectionCount"
,
"ProcessedBytes"
,
"RejectedConnectionCount"
,
"RequestCount"
,
"TargetConnectionErrorCount"
,
"TargetResponseTime"
,
"TargetTLSNegotiationErrorCount"
,
"UnhealthyHostCount"
},
"AWS/AutoScaling"
:
{
"GroupMinSize"
,
"GroupMaxSize"
,
"GroupDesiredCapacity"
,
"GroupInServiceInstances"
,
"GroupPendingInstances"
,
"GroupStandbyInstances"
,
"GroupTerminatingInstances"
,
"GroupTotalInstances"
},
"AWS/Billing"
:
{
"EstimatedCharges"
},
...
...
@@ -87,6 +88,7 @@ func init() {
"AWS/WorkSpaces"
:
{
"Available"
,
"Unhealthy"
,
"ConnectionAttempt"
,
"ConnectionSuccess"
,
"ConnectionFailure"
,
"SessionLaunchTime"
,
"InSessionLatency"
,
"SessionDisconnect"
},
}
dimensionsMap
=
map
[
string
][]
string
{
"AWS/ApiGateway"
:
{
"ApiName"
,
"Method"
,
"Resource"
,
"Stage"
},
"AWS/ApplicationELB"
:
{
"LoadBalancer"
,
"TargetGroup"
,
"AvailabilityZone"
},
"AWS/AutoScaling"
:
{
"AutoScalingGroupName"
},
"AWS/Billing"
:
{
"ServiceName"
,
"LinkedAccount"
,
"Currency"
},
...
...
public/app/plugins/datasource/prometheus/datasource.ts
View file @
7095a9d7
...
...
@@ -62,8 +62,8 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
// Called once per panel (graph)
this
.
query
=
function
(
options
)
{
var
self
=
this
;
var
start
=
getPrometheusTime
(
options
.
range
.
from
,
false
);
var
end
=
getPrometheusTime
(
options
.
range
.
to
,
true
);
var
start
=
this
.
getPrometheusTime
(
options
.
range
.
from
,
false
);
var
end
=
this
.
getPrometheusTime
(
options
.
range
.
to
,
true
);
var
queries
=
[];
var
activeTargets
=
[];
...
...
@@ -172,8 +172,8 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
step
:
'60s'
};
var
start
=
getPrometheusTime
(
options
.
range
.
from
,
false
);
var
end
=
getPrometheusTime
(
options
.
range
.
to
,
true
);
var
start
=
this
.
getPrometheusTime
(
options
.
range
.
from
,
false
);
var
end
=
this
.
getPrometheusTime
(
options
.
range
.
to
,
true
);
var
self
=
this
;
return
this
.
performTimeSeriesQuery
(
query
,
start
,
end
).
then
(
function
(
results
)
{
...
...
@@ -279,10 +279,10 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
return
metricName
+
'{'
+
labelPart
+
'}'
;
};
function
getPrometheusTime
(
date
,
roundUp
):
number
{
this
.
getPrometheusTime
=
function
(
date
,
roundUp
)
{
if
(
_
.
isString
(
date
))
{
date
=
dateMath
.
parse
(
date
,
roundUp
);
}
return
Math
.
ceil
(
date
.
valueOf
()
/
1000
);
}
}
;
}
public/app/plugins/datasource/prometheus/metric_find_query.js
View file @
7095a9d7
...
...
@@ -51,9 +51,11 @@ function (_) {
});
});
}
else
{
var
start
=
this
.
datasource
.
getPrometheusTime
(
this
.
range
.
from
,
false
);
var
end
=
this
.
datasource
.
getPrometheusTime
(
this
.
range
.
to
,
true
);
url
=
'/api/v1/series?match[]='
+
encodeURIComponent
(
metric
)
+
'&start='
+
(
this
.
range
.
from
.
valueOf
()
/
1000
)
+
'&end='
+
(
this
.
range
.
to
.
valueOf
()
/
1000
)
;
+
'&start='
+
start
+
'&end='
+
end
;
return
this
.
datasource
.
_request
(
'GET'
,
url
)
.
then
(
function
(
result
)
{
...
...
@@ -88,7 +90,8 @@ function (_) {
};
PrometheusMetricFindQuery
.
prototype
.
queryResultQuery
=
function
(
query
)
{
var
url
=
'/api/v1/query?query='
+
encodeURIComponent
(
query
)
+
'&time='
+
(
this
.
range
.
to
.
valueOf
()
/
1000
);
var
end
=
this
.
datasource
.
getPrometheusTime
(
this
.
range
.
to
,
true
);
var
url
=
'/api/v1/query?query='
+
encodeURIComponent
(
query
)
+
'&time='
+
end
;
return
this
.
datasource
.
_request
(
'GET'
,
url
)
.
then
(
function
(
result
)
{
...
...
@@ -109,9 +112,11 @@ function (_) {
};
PrometheusMetricFindQuery
.
prototype
.
metricNameAndLabelsQuery
=
function
(
query
)
{
var
start
=
this
.
datasource
.
getPrometheusTime
(
this
.
range
.
from
,
false
);
var
end
=
this
.
datasource
.
getPrometheusTime
(
this
.
range
.
to
,
true
);
var
url
=
'/api/v1/series?match[]='
+
encodeURIComponent
(
query
)
+
'&start='
+
(
this
.
range
.
from
.
valueOf
()
/
1000
)
+
'&end='
+
(
this
.
range
.
to
.
valueOf
()
/
1000
)
;
+
'&start='
+
start
+
'&end='
+
end
;
var
self
=
this
;
return
this
.
datasource
.
_request
(
'GET'
,
url
)
...
...
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