From d387722a90e7ecc0e65889fd13ea62f16fe8198a Mon Sep 17 00:00:00 2001 From: pavlobaron Date: Tue, 25 Apr 2017 10:37:35 +0200 Subject: [PATCH] describe event API --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 511d70cf7..7db87c987 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ The Instana Go sensor consists of two parts: * metrics sensor * [OpenTracing](http://opentracing.io) tracer +## Sensor + To use sensor only without tracing ability, import the `instana` package and run instana.InitSensor(opt) @@ -20,6 +22,8 @@ in your main function. The init function takes an `Options` object with the foll Once initialised, the sensor will try to connect to the given Instana agent and in case of connection success will send metrics and snapshot information through the agent to the backend. +## OpenTracing + In case you want to use the OpenTracing tracer, it will automatically initialise the sensor and thus also activate the metrics stream. To activate the global tracer, run for example ot.InitGlobalTracer(instana.NewTracerWithOptions(&instana.Options{ @@ -32,6 +36,16 @@ The tracer is able to protocol and piggyback OpenTracing baggage, tags and logs. The Instana tracer will remap OpenTracing HTTP headers into Instana Headers, so parallel use with some other OpenTracing model is not possible. The instana tracer is based on the OpenTracing Go basictracer with necessary modifications to map to the Instana tracing model. Also, sampling isn't implemented yet and will be focus of future work. +## Events API + +The sensor, be it instantiated explicitly or implicitly throught the tracer, provides a simple wrapper API to send events into Instana as described in https://instana.atlassian.net/wiki/display/DOCS/Event+SDK+REST+Web+Service : + + SentDefaultServiceEvent: send the event with default service name + SendServiceEvent: send the event for a service named explicitly + SendHostEvent: send an event that will not be assigned to a service, like in case of general events + +## Examples + Following examples are included in the `examples` folder: * **ot-simple/simple.go** - demoes generally how to use the tracer