Interface ITelemetryClient
Send events, metrics and other telemetry to the telemetry provider service.
Namespace: DNVGL.One.Telemetry.Core
Assembly: DNVGL.One.Telemetry.Core.dll
Syntax
public interface ITelemetryClient
Properties
View SourceInstrumentationKey
Gets or sets the default instrumentation key for all telemetry objects logged in this ITelemetryClient.
Declaration
string InstrumentationKey { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
View SourceFlush()
Flushes the in-memory buffer and any metrics being pre-aggregated.
Declaration
void Flush()
Remarks
View SourceIsEnabled()
Check to determine if the tracking is enabled.
Declaration
bool IsEnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean |
StartDependencyOperation(String, String, String)
Start operation creates an operation object with a respective telemetry item.
Declaration
IDependencyTelemetryOperationHolder StartDependencyOperation(string operationName, string operationId, string parentOperationId = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | operationName | Name of the operation that customer is planning to propagate. |
| System.String | operationId | Operation ID to set in the new operation. |
| System.String | parentOperationId | Optional parent operation ID to set in the new operation. |
Returns
| Type | Description |
|---|---|
| IDependencyTelemetryOperationHolder | Operation item object with a new telemetry item having current start time and timestamp. |
StartRequestOperation(String, String, String)
Start operation creates an operation object with a respective telemetry item.
Declaration
IRequestTelemetryOperationHolder StartRequestOperation(string operationName, string operationId, string parentOperationId = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | operationName | Name of the operation that customer is planning to propagate. |
| System.String | operationId | Operation ID to set in the new operation. |
| System.String | parentOperationId | Optional parent operation ID to set in the new operation. |
Returns
| Type | Description |
|---|---|
| IRequestTelemetryOperationHolder | Operation item object with a new telemetry item having current start time and timestamp. |
TrackAvailability(String, DateTimeOffset, TimeSpan, String, Boolean, String, IDictionary<String, String>, IDictionary<String, Double>)
Send information about availability of an application.
Declaration
void TrackAvailability(string name, DateTimeOffset timeStamp, TimeSpan duration, string runLocation, bool success, string message = null, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Availability test name. |
| DateTimeOffset | timeStamp | The time when the availability was captured. |
| TimeSpan | duration | The time taken for the availability test to run. |
| System.String | runLocation | Name of the location the availability test was run from. |
| System.Boolean | success | True if the availability test ran successfully. |
| System.String | message | Error message on availability test run failure. |
| IDictionary<System.String, System.String> | properties | Named string values you can use to classify and search for this availability telemetry. |
| IDictionary<System.String, System.Double> | metrics | Additional values associated with this availability telemetry. |
Remarks
View SourceTrackDependency(String, String, String, DateTimeOffset, TimeSpan, Boolean)
Send information about an external dependency (outgoing call) in the application.
Declaration
void TrackDependency(string dependencyTypeName, string dependencyName, string data, DateTimeOffset startTime, TimeSpan duration, bool success)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | dependencyTypeName | External dependency type. Very low cardinality value for logical grouping and interpretation of fields. Examples are SQL, Azure table, and HTTP. |
| System.String | dependencyName | Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template. |
| System.String | data | Command initiated by this dependency call. Examples are SQL statement and HTTP URLs with all query parameters. |
| DateTimeOffset | startTime | The time when the dependency was called. |
| TimeSpan | duration | The time taken by the external dependency to handle the call. |
| System.Boolean | success | True if the dependency call was handled successfully. |
Remarks
View SourceTrackDependency(String, String, String, String, DateTimeOffset, TimeSpan, String, Boolean)
Send information about an external dependency (outgoing call) in the application.
Declaration
void TrackDependency(string dependencyTypeName, string target, string dependencyName, string data, DateTimeOffset startTime, TimeSpan duration, string resultCode, bool success)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | dependencyTypeName | External dependency type. Very low cardinality value for logical grouping and interpretation of fields. Examples are SQL, Azure table, and HTTP. |
| System.String | target | External dependency target. |
| System.String | dependencyName | Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template. |
| System.String | data | Command initiated by this dependency call. Examples are SQL statement and HTTP URLs with all query parameters. |
| DateTimeOffset | startTime | The time when the dependency was called. |
| TimeSpan | duration | The time taken by the external dependency to handle the call. |
| System.String | resultCode | Result code of dependency call execution. |
| System.Boolean | success | True if the dependency call was handled successfully. |
Remarks
View SourceTrackEvent(String, IDictionary<String, String>, IDictionary<String, Double>)
Send an event telemetry instance for display in Diagnostic Search and in the Analytics Portal.
Declaration
void TrackEvent(string eventName, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | eventName | A name for the event. |
| IDictionary<System.String, System.String> | properties | Named string values you can use to search and classify events. |
| IDictionary<System.String, System.Double> | metrics | Measurements associated with this event. |
Remarks
View SourceTrackException(Exception, IDictionary<String, String>, IDictionary<String, Double>)
Send an exception telemetry instance for display in Diagnostic Search.
Declaration
void TrackException(Exception exception, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | exception | The exception to log. |
| IDictionary<System.String, System.String> | properties | Named string values you can use to classify and search for this exception. |
| IDictionary<System.String, System.Double> | metrics | Additional values associated with this exception. |
Remarks
View SourceTrackMetric(String, Double, IDictionary<String, String>)
This method is deprecated. Metrics should always be pre-aggregated across a time period before being sent.
Use one of the GetMetric(..) overloads to get a metric object for accessing SDK pre-aggregation capabilities.
If you are implementing your own pre-aggregation logic, you can use the Track(ITelemetry metricTelemetry) method to
send the resulting aggregates.
If your application requires sending a separate telemetry item at every occasion without aggregation across time,
you likely have a use case for event telemetry.
Declaration
void TrackMetric(string name, double value, IDictionary<string, string> properties = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Metric name. |
| System.Double | value | Metric value. |
| IDictionary<System.String, System.String> | properties | Named string values you can use to classify and filter metrics. |
TrackPageView(String)
Send information about the page viewed in the application.
Declaration
void TrackPageView(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the page. |
Remarks
View SourceTrackRequest(String, DateTimeOffset, TimeSpan, String, Boolean)
Send information about a request handled by the application.
Declaration
void TrackRequest(string name, DateTimeOffset startTime, TimeSpan duration, string responseCode, bool success)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The request name. |
| DateTimeOffset | startTime | The time when the page was requested. |
| TimeSpan | duration | The time taken by the application to handle the request. |
| System.String | responseCode | The response status code. |
| System.Boolean | success | True if the request was handled successfully by the application. |
Remarks
View SourceTrackTrace(String)
Send a trace message for display in Diagnostic Search.
Declaration
void TrackTrace(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Message to display. |
Remarks
View SourceTrackTrace(String, SeverityLevel)
Send a trace message for display in Diagnostic Search.
Declaration
void TrackTrace(string message, SeverityLevel severityLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Message to display. |
| SeverityLevel | severityLevel | Trace severity level. |
Remarks
View SourceTrackTrace(String, SeverityLevel, IDictionary<String, String>)
Send a trace message for display in Diagnostic Search.
Declaration
void TrackTrace(string message, SeverityLevel severityLevel, IDictionary<string, string> properties)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Message to display. |
| SeverityLevel | severityLevel | Trace severity level. |
| IDictionary<System.String, System.String> | properties | Named string values you can use to search and classify events. |
Remarks
View SourceTrackTrace(String, IDictionary<String, String>)
Send a trace message for display in Diagnostic Search.
Declaration
void TrackTrace(string message, IDictionary<string, string> properties)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Message to display. |
| IDictionary<System.String, System.String> | properties | Named string values you can use to search and classify events. |