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
9c7022be
Commit
9c7022be
authored
Oct 09, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: add status code
parent
412a1f6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
pkg/tsdb/stackdriver/metric_descriptors_query.go
+7
-3
No files found.
pkg/tsdb/stackdriver/metric_descriptors_query.go
View file @
9c7022be
...
...
@@ -22,7 +22,7 @@ func (e *StackdriverExecutor) executeMetricDescriptors(ctx context.Context, tsdb
Results
:
make
(
map
[
string
]
*
tsdb
.
QueryResult
),
}
req
,
err
:=
e
.
createRequest
(
ctx
,
e
.
dsInfo
,
"metricDescriptors"
)
req
,
err
:=
e
.
createRequest
(
ctx
,
e
.
dsInfo
,
"metricDescriptors
s
"
)
if
err
!=
nil
{
slog
.
Error
(
"Failed to create request"
,
"error"
,
err
)
return
nil
,
fmt
.
Errorf
(
"Failed to create request. error: %v"
,
err
)
...
...
@@ -35,7 +35,11 @@ func (e *StackdriverExecutor) executeMetricDescriptors(ctx context.Context, tsdb
data
,
err
:=
e
.
unmarshalMetricDescriptors
(
res
)
if
err
!=
nil
{
return
nil
,
err
queryResult
.
ErrorString
=
fmt
.
Sprintf
(
`Status code: %d`
,
res
.
StatusCode
)
logger
.
Info
(
"error2"
,
"ErrorString"
,
queryResult
.
ErrorString
)
queryResult
.
Error
=
err
result
.
Results
[
tsdbQuery
.
Queries
[
0
]
.
RefId
]
=
queryResult
return
result
,
nil
}
parts
:=
strings
.
Split
(
req
.
URL
.
Path
,
"/"
)
...
...
@@ -73,7 +77,7 @@ func (e *StackdriverExecutor) unmarshalMetricDescriptors(res *http.Response) (Me
if
res
.
StatusCode
/
100
!=
2
{
slog
.
Error
(
"Request failed"
,
"status"
,
res
.
Status
,
"body"
,
string
(
body
))
return
MetricDescriptorsResponse
{},
fmt
.
Errorf
(
string
(
body
))
return
MetricDescriptorsResponse
{},
fmt
.
Errorf
(
`Status code: %d - %s`
,
res
.
StatusCode
,
string
(
body
))
}
var
data
MetricDescriptorsResponse
...
...
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