Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests, docs and examples to use new repo name #66

Merged
merged 2 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EventAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package main

import (
"time"
"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
)

func main() {
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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)
Expand All @@ -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),
)
}
Expand All @@ -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
)
```
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion eum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package instana_test
import (
"testing"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion example/event/change/change_event_no_sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"time"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion example/event/change_event/change_event_no_sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"time"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion example/event/default_service/default_service_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"time"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion example/event/host/host_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"time"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion example/event/service/service_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"time"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion example/httpclient/multi_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"time"

"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
ot "github.com/opentracing/opentracing-go"
)

Expand Down
2 changes: 1 addition & 1 deletion example/many.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion example/ot-simple/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions example/rpc/parse/parse.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package main

import (
"fmt"
"strconv"
)

func main() {
fmt.Print(strconv.ParseInt("938a406416457535", 16, 64))
}
Binary file added example/rpc/rpc
Binary file not shown.
2 changes: 1 addition & 1 deletion example/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion example/webserver/instana/http.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/instana/golang-sensor"
"github.com/instana/go-sensor"
"net/http"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion example/webserver/opentracing/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion propagation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion recorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion span_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down