-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-endpoint instrumentation doesn't show up with overlapping API endpoints. #18
Comments
instance ReflectMethod method => HasEndpoint (Verb method status cts a) where
getEndpoint _ req = case pathInfo req of
[] | requestMethod req == method -> Just (APIEndpoint [] method)
_ -> Nothing
where method = reflectMethod (Proxy :: Proxy method)
This was an error. |
Sorry for the above; a few more hours show that I was wrong (the check proves that there aren't further segments in the path). I've tried to reproduce at least whether e.g. in the repl: > :set -XTypeOperators -XDataKinds
> :{
> type TheAPI = "try" :> "this" :> GetNoContent
> :<|> "try" :> "that" :> GetNoContent
> :<|> "try" :> "those" :> GetNoContent
> :<|> "lookup" :> GetNoContent
> :<|> Raw
> :}
> import Servant.Ekg
> import Data.Text
*Servant.Ekg Data.Text> getEndpoint (Proxy :: Proxy TheAPI) (defaultRequest{pathInfo = pack <$> ["try", "that"]})
Just (APIEndpoint {pathSegments = ["try","that"], method = "GET"}) All the tests I've tried here with the above API return the correct result, but I wonder if there's something different about your API. |
Using
lts-14.27
.The API type has overlapping endpoints plus a raw endpoint for Pandoc-generated API documentation. The application runs hoisted on a custom monad
where
nt
does the natural transformation viarunReaderT
andrunLoggerT
.After a vanilla
System.Remote.Monitoring.forkServer
, I'm wrapping the application as followswhere
runSettings
doesrunTLS
over a custom TCP port.I can connect to EKG. The standard EKG metrics are there, but none of the Servant specific measurements show up.
The text was updated successfully, but these errors were encountered: