We recently started using Datadog in our application and even included a few things within our Dgraph GraphQL endpoint/lambdas to send logs to Datadog such as a custom query and mutation that we can just que up anytime we want to log something along with other operations.
type Query {
log(msg: String!): String @custom(...)
}
type Mutation {
log(msg: String!): String @custom(...)
}
Then we use it like this alongside other queries/mutations when we want to log something all in a single request
{
queryStuff { ... }
log(msg: "Queried some stuff")
}
mutation {
addStuff(...) { ... }
log(msg: "Added some stuff")
}
We will probably add it also in some onMutation hooks too in the near future when we have 21.03.
What we really like being able to do more so than that is logging some activity within Dgraph as our source for analytics which directly attaches analytics to the data it is logging.
We will soon be adding some anti-dogpile features to help reduce how often someone is contacted through our services and having analytics within our Dgraph data to know how many times in the last X that a contact has been emailed/called/visited helps to find ones that need to be contacted and those that don’t need to be contacted at any specific time based on contact history.