Closed iand675 closed 9 years ago
For the WAI middleware, I would like to be able to alter the transaction name, but it sets it automatically.
I'll add configure which has transactionName field.
transactionName :: Request -> ByteString
Also, it would be nice if you could expose the TransactionId in a way that doesn't error out if the helics middleware is missing.
Hmm... I cannot imagine case that get transaction id when middleware is missing. Could you tell me about its use case?
Thanks!
Hmm... I cannot imagine case that get transaction id when middleware is missing. Could you tell me about its use case?
For example, I want to write some code that uses helics in production, but doesn't use it in development. I know the environment based on an environment variable. I'd like to still have some instrumentation code in development that just doesn't run if the transaction id doesn't exist. For example:
dbSegment :: Request -> IO a -> IO a
dbSegment r m = case lookupTransactionId r of
Nothing -> m
Just tid -> datastoreSegment autoScope def m tid
Ok. I understood! Thanks for your explanation. I'll add Request -> Maybe TransactionId
function.
For the WAI middleware, I would like to be able to alter the transaction name, but it sets it automatically. Also, it would be nice if you could expose the TransactionId in a way that doesn't error out if the helics middleware is missing, for example: