diff --git a/EventAPI.md b/EventAPI.md index 9f4e625ca..b719a1eed 100644 --- a/EventAPI.md +++ b/EventAPI.md @@ -15,7 +15,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ) func main() { diff --git a/README.md b/README.md index d8d7b6263..6ce416a51 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ ![golang banner 2017-07-11](https://disznc.s3.amazonaws.com/Instana-Go-2017-07-11-at-16.01.45.png) # Instana Go Sensor -golang-sensor requires Go version 1.7 or greater. +go-sensor requires Go version 1.7 or greater. The Instana Go sensor consists of two parts: * metrics sensor * [OpenTracing](http://opentracing.io) tracer -[![Build Status](https://travis-ci.org/instana/golang-sensor.svg?branch=master)](https://travis-ci.org/instana/golang-sensor) +[![Build Status](https://travis-ci.org/instana/go-sensor.svg?branch=master)](https://travis-ci.org/instana/go-sensor) [![OpenTracing Badge](https://img.shields.io/badge/OpenTracing-enabled-blue.svg)](http://opentracing.io) -## Common Operations +## Common Operations -The Instana Go sensor offers a set of quick features to support tracing of the most common operations like handling HTTP requests and executing HTTP requests. +The Instana Go sensor offers a set of quick features to support tracing of the most common operations like handling HTTP requests and executing HTTP requests. To create an instance of the Instana sensor just request a new instance using the _instana.NewSensor_ factory method and providing the name of the application. It is recommended to use a single Instana only. The sensor implementation is fully thread-safe and can be shared by multiple threads. @@ -31,7 +31,7 @@ Minimal changes are required for Instana to be able to capture the necessary inf That said, a simple handler function like the following will simple be wrapped and registered like normal. -For your own preference registering the handler and wrapping it can be two separate steps or a single one. The following example code shows both versions, starting with two steps. +For your own preference registering the handler and wrapping it can be two separate steps or a single one. The following example code shows both versions, starting with two steps. ``` func myHandler(w http.ResponseWriter, req *http.Request) { time.Sleep(450 * time.Millisecond) @@ -40,7 +40,7 @@ func myHandler(w http.ResponseWriter, req *http.Request) { // Doing registration and wrapping in two separate steps func main() { http.HandleFunc( - "/path/to/handler", + "/path/to/handler", sensor.TracingHandler("myHandler", myHandler), ) } @@ -63,9 +63,9 @@ To have Instana inject information into the request headers, create the _http.Re req, err := http.NewRequest("GET", url, nil) client := &http.Client{} resp, err := sensor.TracingHttpRequest( - "myExternalCall", - parentRequest, - req, + "myExternalCall", + parentRequest, + req, client ) ``` @@ -110,7 +110,7 @@ The Instana tracer will remap OpenTracing HTTP headers into Instana Headers, so The sensor, be it instantiated explicitly or implicitly through the tracer, provides a simple wrapper API to send events to Instana as described in [its documentation](https://docs.instana.io/quick_start/api/#event-sdk-rest-web-service). -To learn more, see the [Events API](https://github.com/instana/golang-sensor/blob/master/EventAPI.md) document in this repository. +To learn more, see the [Events API](https://github.com/instana/go-sensor/blob/master/EventAPI.md) document in this repository. ## Examples diff --git a/eum_test.go b/eum_test.go index c768af369..e707232f9 100644 --- a/eum_test.go +++ b/eum_test.go @@ -3,7 +3,7 @@ package instana_test import ( "testing" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" "github.com/stretchr/testify/assert" ) diff --git a/example/event/change/change_event_no_sensor.go b/example/event/change/change_event_no_sensor.go index 5a35cec9e..2481da41b 100644 --- a/example/event/change/change_event_no_sensor.go +++ b/example/event/change/change_event_no_sensor.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ) func main() { diff --git a/example/event/change_event/change_event_no_sensor.go b/example/event/change_event/change_event_no_sensor.go index e44102b13..1034a7de8 100644 --- a/example/event/change_event/change_event_no_sensor.go +++ b/example/event/change_event/change_event_no_sensor.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ) func main() { diff --git a/example/event/default_service/default_service_event.go b/example/event/default_service/default_service_event.go index a3fb884d1..6129ea464 100644 --- a/example/event/default_service/default_service_event.go +++ b/example/event/default_service/default_service_event.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ) const ( diff --git a/example/event/host/host_event.go b/example/event/host/host_event.go index 9774ca2b9..9715e9d13 100644 --- a/example/event/host/host_event.go +++ b/example/event/host/host_event.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ) func main() { diff --git a/example/event/service/service_event.go b/example/event/service/service_event.go index 3f46872d4..a6f5b1ab7 100644 --- a/example/event/service/service_event.go +++ b/example/event/service/service_event.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ) const ( diff --git a/example/httpclient/multi_request.go b/example/httpclient/multi_request.go index dd1e7bc76..f7df4de75 100644 --- a/example/httpclient/multi_request.go +++ b/example/httpclient/multi_request.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ot "github.com/opentracing/opentracing-go" ) diff --git a/example/many.go b/example/many.go index 9f0540126..cd6779817 100644 --- a/example/many.go +++ b/example/many.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ot "github.com/opentracing/opentracing-go" ext "github.com/opentracing/opentracing-go/ext" "github.com/opentracing/opentracing-go/log" diff --git a/example/ot-simple/simple.go b/example/ot-simple/simple.go index 187227a28..6c67a8d01 100644 --- a/example/ot-simple/simple.go +++ b/example/ot-simple/simple.go @@ -4,7 +4,7 @@ import ( "math/rand" "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ot "github.com/opentracing/opentracing-go" ext "github.com/opentracing/opentracing-go/ext" "github.com/opentracing/opentracing-go/log" diff --git a/example/rpc/parse/parse.go b/example/rpc/parse/parse.go new file mode 100644 index 000000000..19e26cbf8 --- /dev/null +++ b/example/rpc/parse/parse.go @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" + "strconv" +) + +func main() { + fmt.Print(strconv.ParseInt("938a406416457535", 16, 64)) +} diff --git a/example/rpc/rpc b/example/rpc/rpc new file mode 100755 index 000000000..5f0328ee8 Binary files /dev/null and b/example/rpc/rpc differ diff --git a/example/rpc/rpc.go b/example/rpc/rpc.go index 5e8bf8451..42732e4ea 100644 --- a/example/rpc/rpc.go +++ b/example/rpc/rpc.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ot "github.com/opentracing/opentracing-go" "golang.org/x/net/context" ) diff --git a/example/webserver/instana/http.go b/example/webserver/instana/http.go index 763188913..fc5d09e9b 100644 --- a/example/webserver/instana/http.go +++ b/example/webserver/instana/http.go @@ -1,7 +1,7 @@ package main import ( - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" "net/http" "time" ) diff --git a/example/webserver/opentracing/http.go b/example/webserver/opentracing/http.go index 9d01ebe4d..a09dd34a8 100644 --- a/example/webserver/opentracing/http.go +++ b/example/webserver/opentracing/http.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ot "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" "golang.org/x/net/context" diff --git a/propagation_test.go b/propagation_test.go index 67f033384..8ae6a6951 100644 --- a/propagation_test.go +++ b/propagation_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" opentracing "github.com/opentracing/opentracing-go" "github.com/stretchr/testify/assert" ) diff --git a/recorder_test.go b/recorder_test.go index 17862d113..0a6916114 100644 --- a/recorder_test.go +++ b/recorder_test.go @@ -3,7 +3,7 @@ package instana_test import ( "testing" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ext "github.com/opentracing/opentracing-go/ext" "github.com/stretchr/testify/assert" ) diff --git a/span_test.go b/span_test.go index f6afa6aba..f3f2ff7c0 100644 --- a/span_test.go +++ b/span_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" ot "github.com/opentracing/opentracing-go" ext "github.com/opentracing/opentracing-go/ext" "github.com/opentracing/opentracing-go/log" diff --git a/tracer_test.go b/tracer_test.go index 25e226e01..03818c55b 100644 --- a/tracer_test.go +++ b/tracer_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/instana/golang-sensor" + "github.com/instana/go-sensor" //opentracing "github.com/opentracing/opentracing-go" )