Update README.md
This commit is contained in:
Родитель
7be010cb24
Коммит
d501d2ecd2
|
@ -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**
|
||||
|
|
Загрузка…
Ссылка в новой задаче