Reputation: 63
I am trying to send metrics generated from my Go microservice similar to this-
import (
"github.com/DataDog/datadog-go/statsd"
"log"
)
func main() {
// Create the client
c, err := statsd.New("127.0.0.1:8125")
if err != nil {
log.Fatal(err)
}
// Prefix every metric with the app name
c.Namespace = "myapp."
// Count two events
err = c.Count("my_counter", 2, nil, 1)
if err != nil {
log.Fatal(err)
}
// Close the client
err = c.Close()
if err != nil {
log.Fatal(err)
}
}
I am using Gitlab to push the image into Azure Container Registry and eventually deploying it into my Kubernetes cluster. I am able to see the logs for this microservice, but not being able to see the custom metrics generated. I have already set the hostPort
as mentioned here for the Kubernetes agent setup. Any help in finding the cause of the error will be really helpful.
Upvotes: 0
Views: 2517