Module opentelemetry_application_insights::attrs[][src]

Attributes for Application Insights context fields

You can use these attributes in spans to set any of the Application Insights context fields.

Usage

use opentelemetry::{global, trace::Tracer as _};
use opentelemetry_application_insights::attrs as ai;

let tracer = global::tracer("my-component");
let _span = tracer
    .span_builder("span-name")
    .with_attributes(vec![
        ai::SESSION_ID.string("42"),
        ai::DEVICE_LOCALE.string("en-GB"),
    ])
    .start(&tracer);

Constants

APPLICATION_VERSION

Application version. Information in the application context fields is always about the application that is sending the telemetry.

CLOUD_ROLE

Name of the role the application is a part of. Maps directly to the role name in azure.

CLOUD_ROLE_INSTANCE

Name of the instance where the application is running. Computer name for on-premisis, instance name for Azure.

DEVICE_ID

Unique client device id. Computer name in most cases.

DEVICE_LOCALE

Device locale using - pattern, following RFC 5646. Example ‘en-US’.

DEVICE_MODEL

Model of the device the end user of the application is using. Used for client scenarios. If this field is empty then it is derived from the user agent.

DEVICE_OEM_NAME

Client device OEM name taken from the browser.

DEVICE_OS_VERSION

Operating system name and version of the device the end user of the application is using. If this field is empty then it is derived from the user agent. Example ‘Windows 10 Pro 10.0.10586.0’

DEVICE_TYPE

The type of the device the end user of the application is using. Used primarily to distinguish JavaScript telemetry from server side telemetry. Examples: ‘PC’, ‘Phone’, ‘Browser’. ‘PC’ is the default value.

INTERNAL_AGENT_VERSION

Agent version. Used to indicate the version of StatusMonitor installed on the computer if it is used for data collection.

INTERNAL_NODE_NAME

This is the node name used for billing purposes. Use it to override the standard detection of nodes.

INTERNAL_SDK_VERSION

SDK version. See https://github.com/Microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification for information.

LOCATION_CITY

The city of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.

LOCATION_COUNTRY

The country of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.

LOCATION_IP

The IP address of the client device. IPv4 and IPv6 are supported. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.

LOCATION_PROVINCE

The province/state of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.

OPERATION_CORRELATION_VECTOR

The correlation vector is a light weight vector clock which can be used to identify and order related events across clients and services.

OPERATION_ID

A unique identifier for the operation instance. The operation.id is created by either a request or a page view. All other telemetry sets this to the value for the containing request or page view. Operation.id is used for finding all the telemetry items for a specific operation instance.

OPERATION_NAME

The name (group) of the operation. The operation.name is created by either a request or a page view. All other telemetry items set this to the value for the containing request or page view. Operation.name is used for finding all the telemetry items for a group of operations (i.e. ‘GET Home/Index’).

OPERATION_PARENT_ID

The unique identifier of the telemetry item’s immediate parent.

OPERATION_SYNTHETIC_SOURCE

Name of synthetic source. Some telemetry from the application may represent a synthetic traffic. It may be web crawler indexing the web site, site availability tests or traces from diagnostic libraries like Application Insights SDK itself.

SESSION_ID

Session ID - the instance of the user’s interaction with the app. Information in the session context fields is always about the end user. When telemetry is sent from a service, the session context is about the user that initiated the operation in the service.

SESSION_IS_FIRST

Boolean value indicating whether the session identified by ai.session.id is first for the user or not.

USER_ACCOUNT_ID

In multi-tenant applications this is the account ID or name which the user is acting with. Examples may be subscription ID for Azure portal or blog name blogging platform.

USER_AUTH_USER_ID

Authenticated user id. The opposite of ai.user.id, this represents the user with a friendly name. Since it’s PII information it is not collected by default by most SDKs.

USER_ID

Anonymous user id. Represents the end user of the application. When telemetry is sent from a service, the user context is about the user that initiated the operation in the service.