1. Packages
  2. Dynatrace
  3. API Docs
  4. UserSessionMetrics
Dynatrace v0.27.0 published on Friday, Mar 21, 2025 by Pulumiverse

dynatrace.UserSessionMetrics

Explore with Pulumi AI

Create UserSessionMetrics Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new UserSessionMetrics(name: string, args: UserSessionMetricsArgs, opts?: CustomResourceOptions);
@overload
def UserSessionMetrics(resource_name: str,
                       args: UserSessionMetricsArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def UserSessionMetrics(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       enabled: Optional[bool] = None,
                       metric_key: Optional[str] = None,
                       value: Optional[UserSessionMetricsValueArgs] = None,
                       dimensions: Optional[Sequence[str]] = None,
                       filters: Optional[UserSessionMetricsFiltersArgs] = None)
func NewUserSessionMetrics(ctx *Context, name string, args UserSessionMetricsArgs, opts ...ResourceOption) (*UserSessionMetrics, error)
public UserSessionMetrics(string name, UserSessionMetricsArgs args, CustomResourceOptions? opts = null)
public UserSessionMetrics(String name, UserSessionMetricsArgs args)
public UserSessionMetrics(String name, UserSessionMetricsArgs args, CustomResourceOptions options)
type: dynatrace:UserSessionMetrics
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserSessionMetricsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. UserSessionMetricsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. UserSessionMetricsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserSessionMetricsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. UserSessionMetricsArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var userSessionMetricsResource = new Dynatrace.UserSessionMetrics("userSessionMetricsResource", new()
{
    Enabled = false,
    MetricKey = "string",
    Value = new Dynatrace.Inputs.UserSessionMetricsValueArgs
    {
        Type = "string",
        FieldName = "string",
    },
    Dimensions = new[]
    {
        "string",
    },
    Filters = new Dynatrace.Inputs.UserSessionMetricsFiltersArgs
    {
        Filters = new[]
        {
            new Dynatrace.Inputs.UserSessionMetricsFiltersFilterArgs
            {
                FieldName = "string",
                Operator = "string",
                Value = "string",
                ValueIns = new[]
                {
                    "string",
                },
            },
        },
    },
});
Copy
example, err := dynatrace.NewUserSessionMetrics(ctx, "userSessionMetricsResource", &dynatrace.UserSessionMetricsArgs{
	Enabled:   pulumi.Bool(false),
	MetricKey: pulumi.String("string"),
	Value: &dynatrace.UserSessionMetricsValueArgs{
		Type:      pulumi.String("string"),
		FieldName: pulumi.String("string"),
	},
	Dimensions: pulumi.StringArray{
		pulumi.String("string"),
	},
	Filters: &dynatrace.UserSessionMetricsFiltersArgs{
		Filters: dynatrace.UserSessionMetricsFiltersFilterArray{
			&dynatrace.UserSessionMetricsFiltersFilterArgs{
				FieldName: pulumi.String("string"),
				Operator:  pulumi.String("string"),
				Value:     pulumi.String("string"),
				ValueIns: pulumi.StringArray{
					pulumi.String("string"),
				},
			},
		},
	},
})
Copy
var userSessionMetricsResource = new UserSessionMetrics("userSessionMetricsResource", UserSessionMetricsArgs.builder()
    .enabled(false)
    .metricKey("string")
    .value(UserSessionMetricsValueArgs.builder()
        .type("string")
        .fieldName("string")
        .build())
    .dimensions("string")
    .filters(UserSessionMetricsFiltersArgs.builder()
        .filters(UserSessionMetricsFiltersFilterArgs.builder()
            .fieldName("string")
            .operator("string")
            .value("string")
            .valueIns("string")
            .build())
        .build())
    .build());
Copy
user_session_metrics_resource = dynatrace.UserSessionMetrics("userSessionMetricsResource",
    enabled=False,
    metric_key="string",
    value={
        "type": "string",
        "field_name": "string",
    },
    dimensions=["string"],
    filters={
        "filters": [{
            "field_name": "string",
            "operator": "string",
            "value": "string",
            "value_ins": ["string"],
        }],
    })
Copy
const userSessionMetricsResource = new dynatrace.UserSessionMetrics("userSessionMetricsResource", {
    enabled: false,
    metricKey: "string",
    value: {
        type: "string",
        fieldName: "string",
    },
    dimensions: ["string"],
    filters: {
        filters: [{
            fieldName: "string",
            operator: "string",
            value: "string",
            valueIns: ["string"],
        }],
    },
});
Copy
type: dynatrace:UserSessionMetrics
properties:
    dimensions:
        - string
    enabled: false
    filters:
        filters:
            - fieldName: string
              operator: string
              value: string
              valueIns:
                - string
    metricKey: string
    value:
        fieldName: string
        type: string
Copy

UserSessionMetrics Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The UserSessionMetrics resource accepts the following input properties:

Enabled This property is required. bool
This setting is enabled (true) or disabled (false)
MetricKey This property is required. string
Metric key
Value This property is required. Pulumiverse.Dynatrace.Inputs.UserSessionMetricsValue
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
Dimensions List<string>
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
Filters Pulumiverse.Dynatrace.Inputs.UserSessionMetricsFilters
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
Enabled This property is required. bool
This setting is enabled (true) or disabled (false)
MetricKey This property is required. string
Metric key
Value This property is required. UserSessionMetricsValueArgs
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
Dimensions []string
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
Filters UserSessionMetricsFiltersArgs
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
enabled This property is required. Boolean
This setting is enabled (true) or disabled (false)
metricKey This property is required. String
Metric key
value This property is required. UserSessionMetricsValue
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions List<String>
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
filters UserSessionMetricsFilters
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
enabled This property is required. boolean
This setting is enabled (true) or disabled (false)
metricKey This property is required. string
Metric key
value This property is required. UserSessionMetricsValue
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions string[]
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
filters UserSessionMetricsFilters
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
enabled This property is required. bool
This setting is enabled (true) or disabled (false)
metric_key This property is required. str
Metric key
value This property is required. UserSessionMetricsValueArgs
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions Sequence[str]
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
filters UserSessionMetricsFiltersArgs
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
enabled This property is required. Boolean
This setting is enabled (true) or disabled (false)
metricKey This property is required. String
Metric key
value This property is required. Property Map
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions List<String>
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
filters Property Map
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.

Outputs

All input properties are implicitly available as output properties. Additionally, the UserSessionMetrics resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing UserSessionMetrics Resource

Get an existing UserSessionMetrics resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: UserSessionMetricsState, opts?: CustomResourceOptions): UserSessionMetrics
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dimensions: Optional[Sequence[str]] = None,
        enabled: Optional[bool] = None,
        filters: Optional[UserSessionMetricsFiltersArgs] = None,
        metric_key: Optional[str] = None,
        value: Optional[UserSessionMetricsValueArgs] = None) -> UserSessionMetrics
func GetUserSessionMetrics(ctx *Context, name string, id IDInput, state *UserSessionMetricsState, opts ...ResourceOption) (*UserSessionMetrics, error)
public static UserSessionMetrics Get(string name, Input<string> id, UserSessionMetricsState? state, CustomResourceOptions? opts = null)
public static UserSessionMetrics get(String name, Output<String> id, UserSessionMetricsState state, CustomResourceOptions options)
resources:  _:    type: dynatrace:UserSessionMetrics    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Dimensions List<string>
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
Enabled bool
This setting is enabled (true) or disabled (false)
Filters Pulumiverse.Dynatrace.Inputs.UserSessionMetricsFilters
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
MetricKey string
Metric key
Value Pulumiverse.Dynatrace.Inputs.UserSessionMetricsValue
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
Dimensions []string
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
Enabled bool
This setting is enabled (true) or disabled (false)
Filters UserSessionMetricsFiltersArgs
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
MetricKey string
Metric key
Value UserSessionMetricsValueArgs
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions List<String>
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
enabled Boolean
This setting is enabled (true) or disabled (false)
filters UserSessionMetricsFilters
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
metricKey String
Metric key
value UserSessionMetricsValue
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions string[]
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
enabled boolean
This setting is enabled (true) or disabled (false)
filters UserSessionMetricsFilters
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
metricKey string
Metric key
value UserSessionMetricsValue
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions Sequence[str]
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
enabled bool
This setting is enabled (true) or disabled (false)
filters UserSessionMetricsFiltersArgs
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
metric_key str
Metric key
value UserSessionMetricsValueArgs
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.
dimensions List<String>
Defines the fields that are used as dimensions. A dimension is a collection of reference information about a metric data point that is of interest to your business. Dimensions are parameters like "browserFamily", "userType", "country". For example, using "userType" as a dimension allows you to split chart data based on user types.
enabled Boolean
This setting is enabled (true) or disabled (false)
filters Property Map
Defines the filters for the user session. Filters apply at the moment of extracting the data and only sessions that satisfy the filtering criteria will be used to extract the custom metrics. You will not be able to modify these filters in the metric data explorer. For example, using "userType equals REAL_USER" will give you only data from real users, while forcing the synthetic sessions to be ignored.
metricKey String
Metric key
value Property Map
Defines the type of value to be extracted from the user session. When using User session counter, the number of user sessions is counted (similar to count(*) when using USQL). When using User session field value, the value of a user session field is extracted.

Supporting Types

UserSessionMetricsFilters
, UserSessionMetricsFiltersArgs

Filters This property is required. []UserSessionMetricsFiltersFilter
filters This property is required. UserSessionMetricsFiltersFilter[]
filters This property is required. List<Property Map>

UserSessionMetricsFiltersFilter
, UserSessionMetricsFiltersFilterArgs

FieldName This property is required. string
Field name
Operator This property is required. string
Possible Values: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, IN, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUAL_TO, LIKE, NOT_EQUAL, NOT_LIKE, STARTS_WITH
Value string
no documentation available
ValueIns List<string>
Values
FieldName This property is required. string
Field name
Operator This property is required. string
Possible Values: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, IN, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUAL_TO, LIKE, NOT_EQUAL, NOT_LIKE, STARTS_WITH
Value string
no documentation available
ValueIns []string
Values
fieldName This property is required. String
Field name
operator This property is required. String
Possible Values: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, IN, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUAL_TO, LIKE, NOT_EQUAL, NOT_LIKE, STARTS_WITH
value String
no documentation available
valueIns List<String>
Values
fieldName This property is required. string
Field name
operator This property is required. string
Possible Values: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, IN, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUAL_TO, LIKE, NOT_EQUAL, NOT_LIKE, STARTS_WITH
value string
no documentation available
valueIns string[]
Values
field_name This property is required. str
Field name
operator This property is required. str
Possible Values: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, IN, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUAL_TO, LIKE, NOT_EQUAL, NOT_LIKE, STARTS_WITH
value str
no documentation available
value_ins Sequence[str]
Values
fieldName This property is required. String
Field name
operator This property is required. String
Possible Values: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, IN, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUAL_TO, LIKE, NOT_EQUAL, NOT_LIKE, STARTS_WITH
value String
no documentation available
valueIns List<String>
Values

UserSessionMetricsValue
, UserSessionMetricsValueArgs

Type This property is required. string
Possible Values: COUNTER, FIELD
FieldName string
Field name
Type This property is required. string
Possible Values: COUNTER, FIELD
FieldName string
Field name
type This property is required. String
Possible Values: COUNTER, FIELD
fieldName String
Field name
type This property is required. string
Possible Values: COUNTER, FIELD
fieldName string
Field name
type This property is required. str
Possible Values: COUNTER, FIELD
field_name str
Field name
type This property is required. String
Possible Values: COUNTER, FIELD
fieldName String
Field name

Package Details

Repository
dynatrace pulumiverse/pulumi-dynatrace
License
Apache-2.0
Notes
This Pulumi package is based on the dynatrace Terraform Provider.