Add Microsoft Application Insights output plugin (#4010)

This commit is contained in:
Karol Zadora-Przylecki
2018-05-15 16:05:59 -07:00
committed by Daniel Nelson
parent 99033241c4
commit 863af9d1d4
10 changed files with 971 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package application_insights
import "github.com/Microsoft/ApplicationInsights-Go/appinsights"
type Transmitter struct {
client appinsights.TelemetryClient
}
func NewTransmitter(ikey string) *Transmitter {
return &Transmitter{client: appinsights.NewTelemetryClient(ikey)}
}
func (t *Transmitter) Track(telemetry appinsights.Telemetry) {
t.client.Track(telemetry)
}
func (t *Transmitter) Close() <-chan struct{} {
return t.client.Channel().Close(0)
}