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
2446ee08
Unverified
Commit
2446ee08
authored
Jul 24, 2020
by
Arve Knudsen
Committed by
GitHub
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CloudWatch: Fix passing of namespace for getting custom metrics (#26515)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent
ad4f8b70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
pkg/tsdb/cloudwatch/metric_find_query.go
+6
-7
No files found.
pkg/tsdb/cloudwatch/metric_find_query.go
View file @
2446ee08
...
...
@@ -18,6 +18,7 @@ import (
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/tsdb"
"github.com/grafana/grafana/pkg/util/errutil"
)
// Known AWS regions.
...
...
@@ -384,11 +385,8 @@ func (e *cloudWatchExecutor) handleGetMetrics(ctx context.Context, parameters *s
}
}
else
{
var
err
error
dsInfo
:=
e
.
getDSInfo
(
region
)
dsInfo
.
Namespace
=
namespace
if
namespaceMetrics
,
err
=
e
.
getMetricsForCustomMetrics
(
region
);
err
!=
nil
{
return
nil
,
errors
.
New
(
"Unable to call AWS API"
)
if
namespaceMetrics
,
err
=
e
.
getMetricsForCustomMetrics
(
region
,
namespace
);
err
!=
nil
{
return
nil
,
errutil
.
Wrap
(
"unable to call AWS API"
,
err
)
}
}
sort
.
Strings
(
namespaceMetrics
)
...
...
@@ -417,7 +415,7 @@ func (e *cloudWatchExecutor) handleGetDimensions(ctx context.Context, parameters
dsInfo
.
Namespace
=
namespace
if
dimensionValues
,
err
=
e
.
getDimensionsForCustomMetrics
(
region
);
err
!=
nil
{
return
nil
,
err
ors
.
New
(
"Unable to call AWS API"
)
return
nil
,
err
util
.
Wrap
(
"unable to call AWS API"
,
err
)
}
}
sort
.
Strings
(
dimensionValues
)
...
...
@@ -727,11 +725,12 @@ func (e *cloudWatchExecutor) getAllMetrics(region string) (cloudwatch.ListMetric
var
metricsCacheLock
sync
.
Mutex
func
(
e
*
cloudWatchExecutor
)
getMetricsForCustomMetrics
(
region
string
)
([]
string
,
error
)
{
func
(
e
*
cloudWatchExecutor
)
getMetricsForCustomMetrics
(
region
,
namespace
string
)
([]
string
,
error
)
{
metricsCacheLock
.
Lock
()
defer
metricsCacheLock
.
Unlock
()
dsInfo
:=
e
.
getDSInfo
(
region
)
dsInfo
.
Namespace
=
namespace
if
_
,
ok
:=
customMetricsMetricsMap
[
dsInfo
.
Profile
];
!
ok
{
customMetricsMetricsMap
[
dsInfo
.
Profile
]
=
make
(
map
[
string
]
map
[
string
]
*
customMetricsCache
)
...
...
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