This commit is contained in:
Bogdan Berce 2015-01-22 15:51:15 -08:00
Родитель 7be010cb24
Коммит d501d2ecd2
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -31,6 +31,7 @@ Once installed, you can send telemetry to Application Insights. Here are a few s
from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.track_event('Test event')
tc.flush()
```
**Sending an event telemetry item with custom properties and measurements**
@ -38,6 +39,7 @@ tc.track_event('Test event')
from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.track_event('Test event', { 'foo': 'bar' }, { 'baz': 42 })
tc.flush()
```
**Sending a trace telemetry item with custom properties**
@ -45,6 +47,7 @@ tc.track_event('Test event', { 'foo': 'bar' }, { 'baz': 42 })
from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.track_trace('Test trace', { 'foo': 'bar' })
tc.flush()
```
**Sending a metric telemetry item**
@ -52,6 +55,7 @@ tc.track_trace('Test trace', { 'foo': 'bar' })
from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.track_metric('My Metric', 42)
tc.flush()
```
**Sending an exception telemetry item with custom properties and measurements**
@ -68,6 +72,7 @@ try:
raise Exception("blah")
except:
tc.track_exception(*sys.exc_info(), properties={ 'foo': 'bar' }, measurements={ 'x': 42 })
tc.flush()
```
**Configuring context for a telemetry client instance**