Server: Add health check route (#26999)

* Server: Add health check route

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Server: Remove health check middleware

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-08-18 14:58:08 +02:00
committed by GitHub
parent f33158dcdf
commit a2fbffe48a
7 changed files with 21 additions and 11 deletions
+5 -2
View File
@@ -53,7 +53,10 @@ func (e *cloudWatchExecutor) executeLogActions(ctx context.Context, queryContext
}
}
resultChan <- &tsdb.QueryResult{RefId: query.RefId, Dataframes: tsdb.NewDecodedDataFrames(data.Frames{dataframe})}
resultChan <- &tsdb.QueryResult{
RefId: query.RefId,
Dataframes: tsdb.NewDecodedDataFrames(data.Frames{dataframe}),
}
return nil
})
}
@@ -165,7 +168,7 @@ func (e *cloudWatchExecutor) handleDescribeLogGroups(ctx context.Context,
var response *cloudwatchlogs.DescribeLogGroupsOutput = nil
var err error
if len(logGroupNamePrefix) < 1 {
if len(logGroupNamePrefix) == 0 {
response, err = logsClient.DescribeLogGroupsWithContext(ctx, &cloudwatchlogs.DescribeLogGroupsInput{
Limit: aws.Int64(parameters.Get("limit").MustInt64(50)),
})
+5 -5
View File
@@ -109,11 +109,11 @@ type dataFrames struct {
encoded [][]byte
}
// NewDecodedDataFrames create new DataFrames from decoded frames.
// NewDecodedDataFrames instantiates DataFrames from decoded frames.
//
// This should be the primary function for creating DataFrames if your implementing a plugin.
// In Grafana alerting scenario it needs to operate on decoded frames why this function is
// preferrable. When encoded data frames is needed, e.g. returned from Grafana HTTP API, it will
// This should be the primary function for creating DataFrames if you're implementing a plugin.
// In a Grafana alerting scenario it needs to operate on decoded frames, which is why this function is
// preferrable. When encoded data frames are needed, e.g. returned from Grafana HTTP API, it will
// happen automatically when MarshalJSON() is called.
func NewDecodedDataFrames(decodedFrames data.Frames) DataFrames {
return &dataFrames{
@@ -121,7 +121,7 @@ func NewDecodedDataFrames(decodedFrames data.Frames) DataFrames {
}
}
// NewEncodedDataFrames create new DataFrames from encoded frames.
// NewEncodedDataFrames instantiates DataFrames from encoded frames.
//
// This one is primarily used for creating DataFrames when receiving encoded data frames from an external
// plugin or similar. This may allow the encoded data frames to be returned to Grafana UI without any additional