Analytics Item Args
data class AnalyticsItemArgs(val content: Output<String>? = null, val id: Output<String>? = null, val name: Output<String>? = null, val overrideItem: Output<Boolean>? = null, val properties: Output<ApplicationInsightsComponentAnalyticsItemPropertiesArgs>? = null, val resourceGroupName: Output<String>? = null, val resourceName: Output<String>? = null, val scope: Output<Either<String, ItemScope>>? = null, val scopePath: Output<String>? = null, val type: Output<Either<String, ItemType>>? = null) : ConvertibleToJava<AnalyticsItemArgs>
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
Constructors
Link copied to clipboard
constructor(content: Output<String>? = null, id: Output<String>? = null, name: Output<String>? = null, overrideItem: Output<Boolean>? = null, properties: Output<ApplicationInsightsComponentAnalyticsItemPropertiesArgs>? = null, resourceGroupName: Output<String>? = null, resourceName: Output<String>? = null, scope: Output<Either<String, ItemScope>>? = null, scopePath: Output<String>? = null, type: Output<Either<String, ItemType>>? = null)
Properties
Link copied to clipboard
Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
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
The name of the resource group. The name is case insensitive.
Link copied to clipboard
The name of the Application Insights component resource.