Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

echo Instrumentation Example

This is an example of producing distributed traces using the SignalFx Tracing Library for Go. This example provides an instrumented API server that serves a simple in-memory store exposing a CRUD API.

Start Server

To run this example locally and send traces to your available Smart Agent or Gateway, please clone this repository and from this directory do the following:

$ cd server
$ go get
$ go run server.go

By default the service name is simple-crud-api and the tracing endpoint is http://localhost:9080/v1/trace. These values can be overridden by setting ECHO_SERVICE_NAME and ECHO_TRACING_ENDPOINT environment variables

Generate Traces

The following operations can be performed to generate traces.

Create a record

curl -X POST \                                                 
  -H 'Content-Type: application/json' \
  -d '{"record":{"name":"Joe Doe", "age" : 29}}' \
  localhost:1323/records

Get a record

 curl localhost:1323/records/1 

Update a record

 curl -X PUT \                                                  
  -H 'Content-Type: application/json' \
  -d '{"record":{"name":"Joe Doe", "age" : 28, "email" : "joedoe@gmail.com"}}' \
  localhost:1323/records/1

Delete a record

 curl -XDELETE localhost:1323/records/1