2022-12-05 05:14:40 +03:00
|
|
|
module Test.Specs.MetricsSpec (spec) where
|
2022-08-17 04:46:18 +03:00
|
|
|
|
2022-12-05 05:14:40 +03:00
|
|
|
import Hasura.Backends.DataConnector.API (MetricsCapabilities (..))
|
2023-01-30 09:59:04 +03:00
|
|
|
import Test.AgentAPI (getMetrics)
|
2022-12-05 05:14:40 +03:00
|
|
|
import Test.Sandwich (describe, shouldNotBe)
|
2023-01-30 09:59:04 +03:00
|
|
|
import Test.TestHelpers (AgentClientTestSpec, it)
|
2022-08-17 04:46:18 +03:00
|
|
|
import Prelude
|
|
|
|
|
|
|
|
-- NOTE: We currently only check that the response is non-empty, but should probably check that
|
|
|
|
-- it conforms to the prometheus/openmetrics format at some point in the future.
|
2023-01-30 09:59:04 +03:00
|
|
|
spec :: MetricsCapabilities -> AgentClientTestSpec
|
2022-12-05 05:14:40 +03:00
|
|
|
spec MetricsCapabilities = describe "Metrics API" $ do
|
2022-08-17 04:46:18 +03:00
|
|
|
it "Returns a response from the /metrics endpoint" $ do
|
2022-12-05 05:14:40 +03:00
|
|
|
response <- getMetrics
|
2022-08-17 04:46:18 +03:00
|
|
|
response `shouldNotBe` ""
|