I am using the mgo
driver to connect to CosmosDB. Mgo
works fine, but we are having some scale issues. Azure returns a header (x-ms-request-charge
) that lets you know how expensive a query is.
Is there a way to look at the response headers from a Mongo query in mgo
? Something like:
session := s.Session.Copy()
defer session.Close()
collection := session.DB(s.DBName).C("documents")
result := &MyCoolDocument{}
err := collection.FindId(id).One(result)
response := collection.LastResponse() // Made up
fmt.Println(response.Headers()) // Made up