Analytics Item
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,
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
Properties
Link copied to clipboard
The Azure API version of the resource.
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Date and time in UTC when this item was created.
Link copied to clipboard
Date and time in UTC of the last modification that was made to this item.