@@ -892,7 +892,8 @@ func (h *httpAPI) Alerts(ctx context.Context) (AlertsResult, error) {
892
892
}
893
893
894
894
var res AlertsResult
895
- return res , json .Unmarshal (body , & res )
895
+ err = json .Unmarshal (body , & res )
896
+ return res , err
896
897
}
897
898
898
899
func (h * httpAPI ) AlertManagers (ctx context.Context ) (AlertManagersResult , error ) {
@@ -909,7 +910,8 @@ func (h *httpAPI) AlertManagers(ctx context.Context) (AlertManagersResult, error
909
910
}
910
911
911
912
var res AlertManagersResult
912
- return res , json .Unmarshal (body , & res )
913
+ err = json .Unmarshal (body , & res )
914
+ return res , err
913
915
}
914
916
915
917
func (h * httpAPI ) CleanTombstones (ctx context.Context ) error {
@@ -938,7 +940,8 @@ func (h *httpAPI) Config(ctx context.Context) (ConfigResult, error) {
938
940
}
939
941
940
942
var res ConfigResult
941
- return res , json .Unmarshal (body , & res )
943
+ err = json .Unmarshal (body , & res )
944
+ return res , err
942
945
}
943
946
944
947
func (h * httpAPI ) DeleteSeries (ctx context.Context , matches []string , startTime , endTime time.Time ) error {
@@ -981,7 +984,8 @@ func (h *httpAPI) Flags(ctx context.Context) (FlagsResult, error) {
981
984
}
982
985
983
986
var res FlagsResult
984
- return res , json .Unmarshal (body , & res )
987
+ err = json .Unmarshal (body , & res )
988
+ return res , err
985
989
}
986
990
987
991
func (h * httpAPI ) Buildinfo (ctx context.Context ) (BuildinfoResult , error ) {
@@ -998,7 +1002,8 @@ func (h *httpAPI) Buildinfo(ctx context.Context) (BuildinfoResult, error) {
998
1002
}
999
1003
1000
1004
var res BuildinfoResult
1001
- return res , json .Unmarshal (body , & res )
1005
+ err = json .Unmarshal (body , & res )
1006
+ return res , err
1002
1007
}
1003
1008
1004
1009
func (h * httpAPI ) Runtimeinfo (ctx context.Context ) (RuntimeinfoResult , error ) {
@@ -1015,7 +1020,8 @@ func (h *httpAPI) Runtimeinfo(ctx context.Context) (RuntimeinfoResult, error) {
1015
1020
}
1016
1021
1017
1022
var res RuntimeinfoResult
1018
- return res , json .Unmarshal (body , & res )
1023
+ err = json .Unmarshal (body , & res )
1024
+ return res , err
1019
1025
}
1020
1026
1021
1027
func (h * httpAPI ) LabelNames (ctx context.Context , matches []string , startTime , endTime time.Time ) ([]string , Warnings , error ) {
@@ -1036,7 +1042,8 @@ func (h *httpAPI) LabelNames(ctx context.Context, matches []string, startTime, e
1036
1042
return nil , w , err
1037
1043
}
1038
1044
var labelNames []string
1039
- return labelNames , w , json .Unmarshal (body , & labelNames )
1045
+ err = json .Unmarshal (body , & labelNames )
1046
+ return labelNames , w , err
1040
1047
}
1041
1048
1042
1049
func (h * httpAPI ) LabelValues (ctx context.Context , label string , matches []string , startTime , endTime time.Time ) (model.LabelValues , Warnings , error ) {
@@ -1063,7 +1070,8 @@ func (h *httpAPI) LabelValues(ctx context.Context, label string, matches []strin
1063
1070
return nil , w , err
1064
1071
}
1065
1072
var labelValues model.LabelValues
1066
- return labelValues , w , json .Unmarshal (body , & labelValues )
1073
+ err = json .Unmarshal (body , & labelValues )
1074
+ return labelValues , w , err
1067
1075
}
1068
1076
1069
1077
type apiOptions struct {
@@ -1158,7 +1166,8 @@ func (h *httpAPI) Series(ctx context.Context, matches []string, startTime, endTi
1158
1166
}
1159
1167
1160
1168
var mset []model.LabelSet
1161
- return mset , warnings , json .Unmarshal (body , & mset )
1169
+ err = json .Unmarshal (body , & mset )
1170
+ return mset , warnings , err
1162
1171
}
1163
1172
1164
1173
func (h * httpAPI ) Snapshot (ctx context.Context , skipHead bool ) (SnapshotResult , error ) {
@@ -1180,7 +1189,8 @@ func (h *httpAPI) Snapshot(ctx context.Context, skipHead bool) (SnapshotResult,
1180
1189
}
1181
1190
1182
1191
var res SnapshotResult
1183
- return res , json .Unmarshal (body , & res )
1192
+ err = json .Unmarshal (body , & res )
1193
+ return res , err
1184
1194
}
1185
1195
1186
1196
func (h * httpAPI ) Rules (ctx context.Context ) (RulesResult , error ) {
@@ -1197,7 +1207,8 @@ func (h *httpAPI) Rules(ctx context.Context) (RulesResult, error) {
1197
1207
}
1198
1208
1199
1209
var res RulesResult
1200
- return res , json .Unmarshal (body , & res )
1210
+ err = json .Unmarshal (body , & res )
1211
+ return res , err
1201
1212
}
1202
1213
1203
1214
func (h * httpAPI ) Targets (ctx context.Context ) (TargetsResult , error ) {
@@ -1214,7 +1225,8 @@ func (h *httpAPI) Targets(ctx context.Context) (TargetsResult, error) {
1214
1225
}
1215
1226
1216
1227
var res TargetsResult
1217
- return res , json .Unmarshal (body , & res )
1228
+ err = json .Unmarshal (body , & res )
1229
+ return res , err
1218
1230
}
1219
1231
1220
1232
func (h * httpAPI ) TargetsMetadata (ctx context.Context , matchTarget , metric , limit string ) ([]MetricMetadata , error ) {
@@ -1238,7 +1250,8 @@ func (h *httpAPI) TargetsMetadata(ctx context.Context, matchTarget, metric, limi
1238
1250
}
1239
1251
1240
1252
var res []MetricMetadata
1241
- return res , json .Unmarshal (body , & res )
1253
+ err = json .Unmarshal (body , & res )
1254
+ return res , err
1242
1255
}
1243
1256
1244
1257
func (h * httpAPI ) Metadata (ctx context.Context , metric , limit string ) (map [string ][]Metadata , error ) {
@@ -1261,7 +1274,8 @@ func (h *httpAPI) Metadata(ctx context.Context, metric, limit string) (map[strin
1261
1274
}
1262
1275
1263
1276
var res map [string ][]Metadata
1264
- return res , json .Unmarshal (body , & res )
1277
+ err = json .Unmarshal (body , & res )
1278
+ return res , err
1265
1279
}
1266
1280
1267
1281
func (h * httpAPI ) TSDB (ctx context.Context ) (TSDBResult , error ) {
@@ -1278,7 +1292,8 @@ func (h *httpAPI) TSDB(ctx context.Context) (TSDBResult, error) {
1278
1292
}
1279
1293
1280
1294
var res TSDBResult
1281
- return res , json .Unmarshal (body , & res )
1295
+ err = json .Unmarshal (body , & res )
1296
+ return res , err
1282
1297
}
1283
1298
1284
1299
func (h * httpAPI ) WalReplay (ctx context.Context ) (WalReplayStatus , error ) {
@@ -1295,7 +1310,8 @@ func (h *httpAPI) WalReplay(ctx context.Context) (WalReplayStatus, error) {
1295
1310
}
1296
1311
1297
1312
var res WalReplayStatus
1298
- return res , json .Unmarshal (body , & res )
1313
+ err = json .Unmarshal (body , & res )
1314
+ return res , err
1299
1315
}
1300
1316
1301
1317
func (h * httpAPI ) QueryExemplars (ctx context.Context , query string , startTime , endTime time.Time ) ([]ExemplarQueryResult , error ) {
@@ -1316,7 +1332,8 @@ func (h *httpAPI) QueryExemplars(ctx context.Context, query string, startTime, e
1316
1332
}
1317
1333
1318
1334
var res []ExemplarQueryResult
1319
- return res , json .Unmarshal (body , & res )
1335
+ err = json .Unmarshal (body , & res )
1336
+ return res , err
1320
1337
}
1321
1338
1322
1339
// Warnings is an array of non critical errors
0 commit comments