AnalyticsItem

class AnalyticsItem : KotlinCustomResource

Properties that define an Analytics item that is associated to an Application Insights component. Uses Azure REST API version 2015-05-01.

Example Usage

AnalyticsItemPut

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var analyticsItem = new AzureNative.ApplicationInsights.AnalyticsItem("analyticsItem", new()
{
Content = @"let newExceptionsTimeRange = 1d;
let timeRangeToCheckBefore = 7d;
exceptions
| where timestamp < ago(timeRangeToCheckBefore)
| summarize count() by problemId
| join kind= rightanti (
exceptions
| where timestamp >= ago(newExceptionsTimeRange)
| extend stack = tostring(details[0].rawStack)
| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId
) on problemId
| order by count_ desc
",
Name = "Exceptions - New in the last 24 hours",
ResourceGroupName = "my-resource-group",
ResourceName = "my-component",
Scope = AzureNative.ApplicationInsights.ItemScope.Shared,
ScopePath = "analyticsItems",
Type = AzureNative.ApplicationInsights.ItemType.Query,
});
});
package main
import (
applicationinsights "github.com/pulumi/pulumi-azure-native-sdk/applicationinsights/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := applicationinsights.NewAnalyticsItem(ctx, "analyticsItem", &applicationinsights.AnalyticsItemArgs{
Content: pulumi.String(`let newExceptionsTimeRange = 1d;
let timeRangeToCheckBefore = 7d;
exceptions
| where timestamp < ago(timeRangeToCheckBefore)
| summarize count() by problemId
| join kind= rightanti (
exceptions
| where timestamp >= ago(newExceptionsTimeRange)
| extend stack = tostring(details[0].rawStack)
| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId
) on problemId
| order by count_ desc
`),
Name: pulumi.String("Exceptions - New in the last 24 hours"),
ResourceGroupName: pulumi.String("my-resource-group"),
ResourceName: pulumi.String("my-component"),
Scope: pulumi.String(applicationinsights.ItemScopeShared),
ScopePath: pulumi.String("analyticsItems"),
Type: pulumi.String(applicationinsights.ItemTypeQuery),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.applicationinsights.AnalyticsItem;
import com.pulumi.azurenative.applicationinsights.AnalyticsItemArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var analyticsItem = new AnalyticsItem("analyticsItem", AnalyticsItemArgs.builder()
.content("""
let newExceptionsTimeRange = 1d;
let timeRangeToCheckBefore = 7d;
exceptions
| where timestamp < ago(timeRangeToCheckBefore)
| summarize count() by problemId
| join kind= rightanti (
exceptions
| where timestamp >= ago(newExceptionsTimeRange)
| extend stack = tostring(details[0].rawStack)
| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId
) on problemId
| order by count_ desc
""")
.name("Exceptions - New in the last 24 hours")
.resourceGroupName("my-resource-group")
.resourceName("my-component")
.scope("shared")
.scopePath("analyticsItems")
.type("query")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:applicationinsights:AnalyticsItem myresource1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val content: Output<String>?

The content of this item

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>?

The user-defined name of the item.

Link copied to clipboard

A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scope: Output<String>?

Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.

Link copied to clipboard
val timeCreated: Output<String>

Date and time in UTC when this item was created.

Link copied to clipboard
val timeModified: Output<String>

Date and time in UTC of the last modification that was made to this item.

Link copied to clipboard
val type: Output<String>?

Enum indicating the type of the Analytics item.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>

This instance's version of the data model. This can change as new features are added.