Skip to content

Commit

Permalink
Merge pull request #30 from bketelsen/org-rename
Browse files Browse the repository at this point in the history
[org-rename]
  • Loading branch information
jjjordanmsft committed May 8, 2019
2 parents 91c278e + f61ba05 commit c0ae8a1
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
@@ -1,4 +1,4 @@
# How to Contribute

If you're interested in contributing, take a look at the general [contributer's guide](https://github.com/Microsoft/ApplicationInsights-Home/blob/master/CONTRIBUTING.md) first.
If you're interested in contributing, take a look at the general [contributer's guide](https://github.com/microsoft/ApplicationInsights-Home/blob/master/CONTRIBUTING.md) first.

48 changes: 24 additions & 24 deletions README.md
@@ -1,6 +1,6 @@
# Microsoft Application Insights SDK for Go

[![Build Status](https://travis-ci.org/Microsoft/ApplicationInsights-Go.svg?branch=master)](https://travis-ci.org/Microsoft/ApplicationInsights-Go) [![Documentation](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go?status.svg)](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights) [![Release](https://img.shields.io/github/release/Microsoft/ApplicationInsights-Go/all.svg)](https://github.com/Microsoft/ApplicationInsights-Go/releases)
[![Build Status](https://travis-ci.org/Microsoft/ApplicationInsights-Go.svg?branch=master)](https://travis-ci.org/Microsoft/ApplicationInsights-Go) [![Documentation](https://godoc.org/github.com/microsoft/ApplicationInsights-Go?status.svg)](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights) [![Release](https://img.shields.io/github/release/Microsoft/ApplicationInsights-Go/all.svg)](https://github.com/microsoft/ApplicationInsights-Go/releases)

This project provides a Go SDK for Application Insights.
[Application Insights](http://azure.microsoft.com/en-us/services/application-insights/)
Expand All @@ -25,39 +25,39 @@ some of the more mature SDK's. In particular, the gaps are:

Additionally, this is considered a community-supported SDK. Read more about
the status of this and other SDK's in the
[ApplicationInsights-Home](https://github.com/Microsoft/ApplicationInsights-Home)
[ApplicationInsights-Home](https://github.com/microsoft/ApplicationInsights-Home)
repository.

## Requirements
**Install**
```
go get github.com/Microsoft/ApplicationInsights-Go/appinsights
go get github.com/microsoft/ApplicationInsights-Go/appinsights
```
**Get an instrumentation key**
>**Note**: an instrumentation key is required before any data can be sent. Please see the "[Getting an Application Insights Instrumentation Key](https://github.com/Microsoft/AppInsights-Home/wiki#getting-an-application-insights-instrumentation-key)" section of the wiki for more information. To try the SDK without an instrumentation key, set the instrumentationKey config value to a non-empty string.
>**Note**: an instrumentation key is required before any data can be sent. Please see the "[Getting an Application Insights Instrumentation Key](https://github.com/microsoft/AppInsights-Home/wiki#getting-an-application-insights-instrumentation-key)" section of the wiki for more information. To try the SDK without an instrumentation key, set the instrumentationKey config value to a non-empty string.
# Usage

## Setup

To start tracking telemetry, you'll want to first initialize a
[telemetry client](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#TelemetryClient).
[telemetry client](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#TelemetryClient).

```go
import "github.com/Microsoft/ApplicationInsights-Go/appinsights"
import "github.com/microsoft/ApplicationInsights-Go/appinsights"

func main() {
client := appinsights.NewTelemetryClient("<instrumentation key>")
}
```

If you want more control over the client's behavior, you should initialize a
new [TelemetryConfiguration](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#TelemetryConfiguration)
new [TelemetryConfiguration](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#TelemetryConfiguration)
object and use it to create a client:

```go
import "time"
import "github.com/Microsoft/ApplicationInsights-Go/appinsights"
import "github.com/microsoft/ApplicationInsights-Go/appinsights"

func main() {
telemetryConfig := appinsights.NewTelemetryConfiguration("<instrumentation key>")
Expand All @@ -80,7 +80,7 @@ it in your data model.

## Telemetry submission

The [TelemetryClient](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#TelemetryClient)
The [TelemetryClient](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#TelemetryClient)
itself has several methods for submitting telemetry:

```go
Expand Down Expand Up @@ -132,7 +132,7 @@ then be submitted through the `TelemetryClient.Track` method, as illustrated
in the below sections:

### Trace
[Trace telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#TraceTelemetry)
[Trace telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#TraceTelemetry)
represent printf-like trace statements that can be text searched. They have
an associated severity level, values for which are found in the package's
constants:
Expand Down Expand Up @@ -164,7 +164,7 @@ client.Track(trace)
```

### Events
[Event telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#EventTelemetry)
[Event telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#EventTelemetry)
represent structured event records.

```go
Expand All @@ -174,7 +174,7 @@ client.Track(event)
```

### Single-value metrics
[Metric telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#MetricTelemetry)
[Metric telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#MetricTelemetry)
each represent a single data point.

```go
Expand All @@ -186,7 +186,7 @@ client.Track(metric)
### Pre-aggregated metrics
To reduce the number of metric values that may be sent through telemetry,
when using a particularly high volume of measurements, metric data can be
[pre-aggregated by the client](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#AggregateMetricTelemetry)
[pre-aggregated by the client](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#AggregateMetricTelemetry)
and submitted all at once.

```go
Expand Down Expand Up @@ -219,7 +219,7 @@ client.Track(aggregate)
```

### Requests
[Request telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#RequestTelemetry)
[Request telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#RequestTelemetry)
represent completion of an external request to the application and contains
a summary of that request execution and results. This SDK's request
telemetry is focused on HTTP requests.
Expand Down Expand Up @@ -254,7 +254,7 @@ client.Track(request)
```

### Dependencies
[Remote dependency telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#RemoteDependencyTelemetry)
[Remote dependency telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#RemoteDependencyTelemetry)
represent interactions of the monitored component with a remote
component/service like SQL or an HTTP endpoint.

Expand Down Expand Up @@ -285,7 +285,7 @@ client.Track(dependency)
```

### Exceptions
[Exception telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#ExceptionTelemetry)
[Exception telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#ExceptionTelemetry)
represent handled or unhandled exceptions that occurred during the execution
of the monitored application. This SDK is geared towards handling panics or
unexpected results from important functions:
Expand Down Expand Up @@ -357,7 +357,7 @@ if err != nil {
```

### Availability
[Availability telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights/#AvailabilityTelemetry)
[Availability telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights/#AvailabilityTelemetry)
represent the result of executing an availability test. This is useful if
you are writing availability monitors in Go.

Expand All @@ -382,7 +382,7 @@ client.Track(availability)
```

### Page Views
[Page view telemetry items](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights/#PageViewTelemetry)
[Page view telemetry items](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights/#PageViewTelemetry)
represent generic actions on a page like a button click. These are typically
generated by the client side rather than the server side, but is available
here nonetheless.
Expand All @@ -403,10 +403,10 @@ client.Track(pageview)
Telemetry items all have a `Tags` property that contains information *about*
the submitted telemetry, such as user, session, and device information. The
`Tags` property is an instance of the
[contracts.ContextTags](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts/#ContextTags)
[contracts.ContextTags](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights/contracts/#ContextTags)
type, which is a `map[string]string` under the hood, but has helper methods
to access the most commonly used data. An instance of
[TelemetryContext](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights/#TelemetryContext)
[TelemetryContext](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights/#TelemetryContext)
exists on the `TelemetryClient`, and also contains a `Tags` property. These
tags are applied to all telemetry sent through the client. If a context tag
is found on both the client's `TelemetryContext` and in the telemetry item's
Expand All @@ -418,8 +418,8 @@ A few examples for illustration:
import (
"os"

"github.com/Microsoft/ApplicationInsights-Go/appinsights"
"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

func main() {
Expand Down Expand Up @@ -465,7 +465,7 @@ func main() {
```

### Shutdown
The Go SDK submits data asynchronously. The [InMemoryChannel](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights/#InMemoryChannel)
The Go SDK submits data asynchronously. The [InMemoryChannel](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights/#InMemoryChannel)
launches its own goroutine used to accept and send telemetry. If you're not
careful, this may result in lost telemetry when the service needs to shut
down. The channel has a few methods to deal with this case:
Expand Down Expand Up @@ -513,7 +513,7 @@ func main() {

We recommend something similar to the above to minimize lost telemetry
through shutdown.
[The documentation](https://godoc.org/github.com/Microsoft/ApplicationInsights-Go/appinsights#TelemetryChannel)
[The documentation](https://godoc.org/github.com/microsoft/ApplicationInsights-Go/appinsights#TelemetryChannel)
explains in more detail what can lead to the cases above.

### Diagnostics
Expand Down
2 changes: 1 addition & 1 deletion appinsights/client.go
Expand Up @@ -3,7 +3,7 @@ package appinsights
import (
"time"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

// Application Insights telemetry client provides interface to track telemetry
Expand Down
2 changes: 1 addition & 1 deletion appinsights/constants.go
Expand Up @@ -2,7 +2,7 @@ package appinsights

// NOTE: This file was automatically generated.

import "github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
import "github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"

// Type of the metric data measurement.
const (
Expand Down
2 changes: 1 addition & 1 deletion appinsights/contracts/contexttagkeys.go
Expand Up @@ -99,7 +99,7 @@ const (
CloudRoleInstance string = "ai.cloud.roleInstance"

// SDK version. See
// https://github.com/Microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification
// https://github.com/microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification
// for information.
InternalSdkVersion string = "ai.internal.sdkVersion"

Expand Down
4 changes: 2 additions & 2 deletions appinsights/contracts/contexttags.go
Expand Up @@ -503,7 +503,7 @@ func (tags CloudContextTags) SetRoleInstance(value string) {
}

// SDK version. See
// https://github.com/Microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification
// https://github.com/microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification
// for information.
func (tags InternalContextTags) GetSdkVersion() string {
if result, ok := tags["ai.internal.sdkVersion"]; ok {
Expand All @@ -514,7 +514,7 @@ func (tags InternalContextTags) GetSdkVersion() string {
}

// SDK version. See
// https://github.com/Microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification
// https://github.com/microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification
// for information.
func (tags InternalContextTags) SetSdkVersion(value string) {
if value != "" {
Expand Down
2 changes: 1 addition & 1 deletion appinsights/contracts/package.go
@@ -1,4 +1,4 @@
// Data contract definitions for telemetry submitted to Application Insights.
// This is generated from the schemas found at
// https://github.com/Microsoft/ApplicationInsights-Home/tree/master/EndpointSpecs/Schemas/Bond
// https://github.com/microsoft/ApplicationInsights-Home/tree/master/EndpointSpecs/Schemas/Bond
package contracts
2 changes: 1 addition & 1 deletion appinsights/exception.go
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"strings"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

// Exception telemetry items represent a handled or unhandled exceptions that
Expand Down
2 changes: 1 addition & 1 deletion appinsights/exception_test.go
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

type myStringer struct{}
Expand Down
2 changes: 1 addition & 1 deletion appinsights/inmemorychannel.go
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"code.cloudfoundry.org/clock"
"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion appinsights/jsonserializer.go
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

type telemetryBufferItems []*contracts.Envelope
Expand Down
2 changes: 1 addition & 1 deletion appinsights/telemetry.go
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"time"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

// Common interface implemented by telemetry data contracts
Expand Down
2 changes: 1 addition & 1 deletion appinsights/telemetry_test.go
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

const float_precision = 1e-4
Expand Down
2 changes: 1 addition & 1 deletion appinsights/telemetrychannel.go
@@ -1,7 +1,7 @@
package appinsights

import (
"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion appinsights/telemetrycontext.go
Expand Up @@ -3,7 +3,7 @@ package appinsights
import (
"strings"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

// Encapsulates contextual data common to all telemetry submitted through a
Expand Down
2 changes: 1 addition & 1 deletion appinsights/telemetrycontext_test.go
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

func TestDefaultTags(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion appinsights/transmitter_test.go
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/Microsoft/ApplicationInsights-Go/appinsights/contracts"
"github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"
)

type testServer struct {
Expand Down
4 changes: 2 additions & 2 deletions generateschema.ps1
Expand Up @@ -19,7 +19,7 @@ The full path to BondSchemaGenerator.exe
The path to the directory that contains all of the input .bond files.
.LINK https://github.com/Microsoft/ApplicationInsights-Home
.LINK https://github.com/microsoft/ApplicationInsights-Home
#>

Expand Down Expand Up @@ -75,7 +75,7 @@ try {
# Check locally.
if (-not (Test-Path .\ApplicationInsights-Home -PathType Container)) {
# Clone into it!
git clone https://github.com/Microsoft/ApplicationInsights-Home.git
git clone https://github.com/microsoft/ApplicationInsights-Home.git
}
}

Expand Down

0 comments on commit c0ae8a1

Please sign in to comment.