AnalyticsItemArgs

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,
});
});
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

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
val content: Output<String>? = null

The content of this item

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

Internally assigned unique id of the item definition.

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

The user-defined name of the item.

Link copied to clipboard
val overrideItem: Output<Boolean>? = null

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
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val resourceName: Output<String>? = null

The name of the Application Insights component resource.

Link copied to clipboard
val scope: Output<Either<String, ItemScope>>? = null

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 scopePath: Output<String>? = null

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 type: Output<Either<String, ItemType>>? = null

Enum indicating the type of the Analytics item.

Functions

Link copied to clipboard
open override fun toJava(): AnalyticsItemArgs