1 // Package csm provides Client Side Monitoring (CSM) which enables sending metrics
2 // via UDP connection. Using the Start function will enable the reporting of
3 // metrics on a given port. If Start is called, with different parameters, again,
6 // Pause can be called to pause any metrics publishing on a given port. Sessions
7 // that have had their handlers modified via InjectHandlers may still be used.
8 // However, the handlers will act as a no-op meaning no metrics will be published.
11 // r, err := csm.Start("clientID", ":31000")
13 // panic(fmt.Errorf("failed starting CSM: %v", err))
16 // sess, err := session.NewSession(&aws.Config{})
18 // panic(fmt.Errorf("failed loading session: %v", err))
21 // r.InjectHandlers(&sess.Handlers)
23 // client := s3.New(sess)
24 // resp, err := client.GetObject(&s3.GetObjectInput{
25 // Bucket: aws.String("bucket"),
26 // Key: aws.String("key"),
29 // // Will pause monitoring
31 // resp, err = client.GetObject(&s3.GetObjectInput{
32 // Bucket: aws.String("bucket"),
33 // Key: aws.String("key"),
36 // // Resume monitoring
39 // Start returns a Reporter that is used to enable or disable monitoring. If
40 // access to the Reporter is required later, calling Get will return the Reporter