azure.applicationinsights.operations package

class azure.applicationinsights.operations.EventsOperations(client, config, serializer, deserializer)[source]

EventsOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

get(app_id, event_type, event_id, timespan=None, custom_headers=None, raw=False, **operation_config)[source]

Get an event.

Gets the data for a single event.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • event_type (str or EventType) – The type of events to query; either a standard event type (traces, customEvents, pageViews, requests, dependencies, exceptions, availabilityResults) or $all to query across all event types. Possible values include: ‘$all’, ‘traces’, ‘customEvents’, ‘pageViews’, ‘browserTimings’, ‘requests’, ‘dependencies’, ‘exceptions’, ‘availabilityResults’, ‘performanceCounters’, ‘customMetrics’

  • event_id (str) – ID of event.

  • timespan (str) – Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

EventsResults or ClientRawResponse if raw=true

Return type

EventsResults or ClientRawResponse

Raises

ErrorResponseException

get_by_type(app_id, event_type, timespan=None, filter=None, search=None, orderby=None, select=None, skip=None, top=None, format=None, count=None, apply=None, custom_headers=None, raw=False, **operation_config)[source]

Execute OData query.

Executes an OData query for events.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • event_type (str or EventType) – The type of events to query; either a standard event type (traces, customEvents, pageViews, requests, dependencies, exceptions, availabilityResults) or $all to query across all event types. Possible values include: ‘$all’, ‘traces’, ‘customEvents’, ‘pageViews’, ‘browserTimings’, ‘requests’, ‘dependencies’, ‘exceptions’, ‘availabilityResults’, ‘performanceCounters’, ‘customMetrics’

  • timespan (str) – Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression.

  • filter (str) – An expression used to filter the returned events

  • search (str) – A free-text search expression to match for whether a particular event should be returned

  • orderby (str) – A comma-separated list of properties with "asc" (the default) or "desc" to control the order of returned events

  • select (str) – Limits the properties to just those requested on each returned event

  • skip (int) – The number of items to skip over before returning events

  • top (int) – The number of events to return

  • format (str) – Format for the returned events

  • count (bool) – Request a count of matching items included with the returned events

  • apply (str) – An expression used for aggregation over returned events

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

EventsResults or ClientRawResponse if raw=true

Return type

EventsResults or ClientRawResponse

Raises

ErrorResponseException

get_odata_metadata(app_id, custom_headers=None, raw=False, **operation_config)[source]

Get OData metadata.

Gets OData EDMX metadata describing the event data model.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

object or ClientRawResponse if raw=true

Return type

object or ClientRawResponse

Raises

ErrorResponseException

models = <module 'azure.applicationinsights.models' from '/mnt/vss/_work/1/s/sdk/applicationinsights/azure-applicationinsights/.tox/sphinx/lib/python3.9/site-packages/azure/applicationinsights/models/__init__.py'>
class azure.applicationinsights.operations.MetricsOperations(client, config, serializer, deserializer)[source]

MetricsOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

get(app_id, metric_id, timespan=None, interval=None, aggregation=None, segment=None, top=None, orderby=None, filter=None, custom_headers=None, raw=False, **operation_config)[source]

Retrieve metric data.

Gets metric values for a single metric.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • metric_id (str or MetricId) – ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: ‘requests/count’, ‘requests/duration’, ‘requests/failed’, ‘users/count’, ‘users/authenticated’, ‘pageViews/count’, ‘pageViews/duration’, ‘client/processingDuration’, ‘client/receiveDuration’, ‘client/networkDuration’, ‘client/sendDuration’, ‘client/totalDuration’, ‘dependencies/count’, ‘dependencies/failed’, ‘dependencies/duration’, ‘exceptions/count’, ‘exceptions/browser’, ‘exceptions/server’, ‘sessions/count’, ‘performanceCounters/requestExecutionTime’, ‘performanceCounters/requestsPerSecond’, ‘performanceCounters/requestsInQueue’, ‘performanceCounters/memoryAvailableBytes’, ‘performanceCounters/exceptionsPerSecond’, ‘performanceCounters/processCpuPercentage’, ‘performanceCounters/processIOBytesPerSecond’, ‘performanceCounters/processPrivateBytes’, ‘performanceCounters/processorCpuPercentage’, ‘availabilityResults/availabilityPercentage’, ‘availabilityResults/duration’, ‘billing/telemetryCount’, ‘customEvents/count’

  • timespan (str) – The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of PT12H (“last 12 hours”) is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response.

  • interval (timedelta) – The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response.

  • aggregation (list[str or MetricsAggregation]) – The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used.

  • segment (list[str or MetricsSegment]) – The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter.

  • top (int) – The number of segments to return. This value is only valid when segment is specified.

  • orderby (str) – The aggregation function and direction to sort the segments by. This value is only valid when segment is specified.

  • filter (str) – An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

MetricsResult or ClientRawResponse if raw=true

Return type

MetricsResult or ClientRawResponse

Raises

ErrorResponseException

get_metadata(app_id, custom_headers=None, raw=False, **operation_config)[source]

Retrieve metric metatadata.

Gets metadata describing the available metrics.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

object or ClientRawResponse if raw=true

Return type

object or ClientRawResponse

Raises

ErrorResponseException

get_multiple(app_id, body, custom_headers=None, raw=False, **operation_config)[source]

Retrieve metric data.

Gets metric values for multiple metrics.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • body (list[MetricsPostBodySchema]) – The batched metrics query.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[MetricsResultsItem] or ClientRawResponse

Raises

ErrorResponseException

models = <module 'azure.applicationinsights.models' from '/mnt/vss/_work/1/s/sdk/applicationinsights/azure-applicationinsights/.tox/sphinx/lib/python3.9/site-packages/azure/applicationinsights/models/__init__.py'>
class azure.applicationinsights.operations.QueryOperations(client, config, serializer, deserializer)[source]

QueryOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

execute(app_id, body, custom_headers=None, raw=False, **operation_config)[source]

Execute an Analytics query.

Executes an Analytics query for data.

Here is an example for using POST with an Analytics query.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • body (QueryBody) – The Analytics query. Learn more about the Analytics query syntax.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

QueryResults or ClientRawResponse if raw=true

Return type

QueryResults or ClientRawResponse

Raises

ErrorResponseException

models = <module 'azure.applicationinsights.models' from '/mnt/vss/_work/1/s/sdk/applicationinsights/azure-applicationinsights/.tox/sphinx/lib/python3.9/site-packages/azure/applicationinsights/models/__init__.py'>

Submodules

azure.applicationinsights.operations.events_operations module

class azure.applicationinsights.operations.events_operations.EventsOperations(client, config, serializer, deserializer)[source]

EventsOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

get(app_id, event_type, event_id, timespan=None, custom_headers=None, raw=False, **operation_config)[source]

Get an event.

Gets the data for a single event.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • event_type (str or EventType) – The type of events to query; either a standard event type (traces, customEvents, pageViews, requests, dependencies, exceptions, availabilityResults) or $all to query across all event types. Possible values include: ‘$all’, ‘traces’, ‘customEvents’, ‘pageViews’, ‘browserTimings’, ‘requests’, ‘dependencies’, ‘exceptions’, ‘availabilityResults’, ‘performanceCounters’, ‘customMetrics’

  • event_id (str) – ID of event.

  • timespan (str) – Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

EventsResults or ClientRawResponse if raw=true

Return type

EventsResults or ClientRawResponse

Raises

ErrorResponseException

get_by_type(app_id, event_type, timespan=None, filter=None, search=None, orderby=None, select=None, skip=None, top=None, format=None, count=None, apply=None, custom_headers=None, raw=False, **operation_config)[source]

Execute OData query.

Executes an OData query for events.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • event_type (str or EventType) – The type of events to query; either a standard event type (traces, customEvents, pageViews, requests, dependencies, exceptions, availabilityResults) or $all to query across all event types. Possible values include: ‘$all’, ‘traces’, ‘customEvents’, ‘pageViews’, ‘browserTimings’, ‘requests’, ‘dependencies’, ‘exceptions’, ‘availabilityResults’, ‘performanceCounters’, ‘customMetrics’

  • timespan (str) – Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression.

  • filter (str) – An expression used to filter the returned events

  • search (str) – A free-text search expression to match for whether a particular event should be returned

  • orderby (str) – A comma-separated list of properties with "asc" (the default) or "desc" to control the order of returned events

  • select (str) – Limits the properties to just those requested on each returned event

  • skip (int) – The number of items to skip over before returning events

  • top (int) – The number of events to return

  • format (str) – Format for the returned events

  • count (bool) – Request a count of matching items included with the returned events

  • apply (str) – An expression used for aggregation over returned events

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

EventsResults or ClientRawResponse if raw=true

Return type

EventsResults or ClientRawResponse

Raises

ErrorResponseException

get_odata_metadata(app_id, custom_headers=None, raw=False, **operation_config)[source]

Get OData metadata.

Gets OData EDMX metadata describing the event data model.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

object or ClientRawResponse if raw=true

Return type

object or ClientRawResponse

Raises

ErrorResponseException

models = <module 'azure.applicationinsights.models' from '/mnt/vss/_work/1/s/sdk/applicationinsights/azure-applicationinsights/.tox/sphinx/lib/python3.9/site-packages/azure/applicationinsights/models/__init__.py'>

azure.applicationinsights.operations.metrics_operations module

class azure.applicationinsights.operations.metrics_operations.MetricsOperations(client, config, serializer, deserializer)[source]

MetricsOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

get(app_id, metric_id, timespan=None, interval=None, aggregation=None, segment=None, top=None, orderby=None, filter=None, custom_headers=None, raw=False, **operation_config)[source]

Retrieve metric data.

Gets metric values for a single metric.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • metric_id (str or MetricId) – ID of the metric. This is either a standard AI metric, or an application-specific custom metric. Possible values include: ‘requests/count’, ‘requests/duration’, ‘requests/failed’, ‘users/count’, ‘users/authenticated’, ‘pageViews/count’, ‘pageViews/duration’, ‘client/processingDuration’, ‘client/receiveDuration’, ‘client/networkDuration’, ‘client/sendDuration’, ‘client/totalDuration’, ‘dependencies/count’, ‘dependencies/failed’, ‘dependencies/duration’, ‘exceptions/count’, ‘exceptions/browser’, ‘exceptions/server’, ‘sessions/count’, ‘performanceCounters/requestExecutionTime’, ‘performanceCounters/requestsPerSecond’, ‘performanceCounters/requestsInQueue’, ‘performanceCounters/memoryAvailableBytes’, ‘performanceCounters/exceptionsPerSecond’, ‘performanceCounters/processCpuPercentage’, ‘performanceCounters/processIOBytesPerSecond’, ‘performanceCounters/processPrivateBytes’, ‘performanceCounters/processorCpuPercentage’, ‘availabilityResults/availabilityPercentage’, ‘availabilityResults/duration’, ‘billing/telemetryCount’, ‘customEvents/count’

  • timespan (str) – The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of PT12H (“last 12 hours”) is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response.

  • interval (timedelta) – The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response.

  • aggregation (list[str or MetricsAggregation]) – The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used.

  • segment (list[str or MetricsSegment]) – The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter.

  • top (int) – The number of segments to return. This value is only valid when segment is specified.

  • orderby (str) – The aggregation function and direction to sort the segments by. This value is only valid when segment is specified.

  • filter (str) – An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

MetricsResult or ClientRawResponse if raw=true

Return type

MetricsResult or ClientRawResponse

Raises

ErrorResponseException

get_metadata(app_id, custom_headers=None, raw=False, **operation_config)[source]

Retrieve metric metatadata.

Gets metadata describing the available metrics.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

object or ClientRawResponse if raw=true

Return type

object or ClientRawResponse

Raises

ErrorResponseException

get_multiple(app_id, body, custom_headers=None, raw=False, **operation_config)[source]

Retrieve metric data.

Gets metric values for multiple metrics.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • body (list[MetricsPostBodySchema]) – The batched metrics query.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[MetricsResultsItem] or ClientRawResponse

Raises

ErrorResponseException

models = <module 'azure.applicationinsights.models' from '/mnt/vss/_work/1/s/sdk/applicationinsights/azure-applicationinsights/.tox/sphinx/lib/python3.9/site-packages/azure/applicationinsights/models/__init__.py'>

azure.applicationinsights.operations.query_operations module

class azure.applicationinsights.operations.query_operations.QueryOperations(client, config, serializer, deserializer)[source]

QueryOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

execute(app_id, body, custom_headers=None, raw=False, **operation_config)[source]

Execute an Analytics query.

Executes an Analytics query for data.

Here is an example for using POST with an Analytics query.

Parameters
  • app_id (str) – ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

  • body (QueryBody) –

    The Analytics query. Learn more about the Analytics query syntax.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

QueryResults or ClientRawResponse if raw=true

Return type

QueryResults or ClientRawResponse

Raises

ErrorResponseException

models = <module 'azure.applicationinsights.models' from '/mnt/vss/_work/1/s/sdk/applicationinsights/azure-applicationinsights/.tox/sphinx/lib/python3.9/site-packages/azure/applicationinsights/models/__init__.py'>