Class EnhancedMetricsConfig

java.lang.Object
software.amazon.awssdk.services.appsync.model.EnhancedMetricsConfig
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<EnhancedMetricsConfig.Builder,EnhancedMetricsConfig>

@Generated("software.amazon.awssdk:codegen") public final class EnhancedMetricsConfig extends Object implements SdkPojo, Serializable, ToCopyableBuilder<EnhancedMetricsConfig.Builder,EnhancedMetricsConfig>

Enables and controls the enhanced metrics feature. Enhanced metrics emit granular data on API usage and performance such as AppSync request and error counts, latency, and cache hits/misses. All enhanced metric data is sent to your CloudWatch account, and you can configure the types of data that will be sent.

Enhanced metrics can be configured at the resolver, data source, and operation levels. EnhancedMetricsConfig contains three required parameters, each controlling one of these categories:

  1. resolverLevelMetricsBehavior: Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

    • GraphQL errors: The number of GraphQL errors that occurred.

    • Requests: The number of invocations that occurred during a request.

    • Latency: The time to complete a resolver invocation.

    • Cache hits: The number of cache hits during a request.

    • Cache misses: The number of cache misses during a request.

    These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

    • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

    • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

  2. dataSourceLevelMetricsBehavior: Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

    • Requests: The number of invocations that occured during a request.

    • Latency: The time to complete a data source invocation.

    • Errors: The number of errors that occurred during a data source invocation.

    These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

    • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

    • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

  3. operationLevelMetricsConfig: Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

    • Requests: The number of times a specified GraphQL operation was called.

    • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

    Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

See Also:
  • Method Details

    • resolverLevelMetricsBehavior

      public final ResolverLevelMetricsBehavior resolverLevelMetricsBehavior()

      Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

      • GraphQL errors: The number of GraphQL errors that occurred.

      • Requests: The number of invocations that occurred during a request.

      • Latency: The time to complete a resolver invocation.

      • Cache hits: The number of cache hits during a request.

      • Cache misses: The number of cache misses during a request.

      These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

      • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

      If the service returns an enum value that is not available in the current SDK version, resolverLevelMetricsBehavior will return ResolverLevelMetricsBehavior.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from resolverLevelMetricsBehaviorAsString().

      Returns:
      Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

      • GraphQL errors: The number of GraphQL errors that occurred.

      • Requests: The number of invocations that occurred during a request.

      • Latency: The time to complete a resolver invocation.

      • Cache hits: The number of cache hits during a request.

      • Cache misses: The number of cache misses during a request.

      These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

      • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

      See Also:
    • resolverLevelMetricsBehaviorAsString

      public final String resolverLevelMetricsBehaviorAsString()

      Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

      • GraphQL errors: The number of GraphQL errors that occurred.

      • Requests: The number of invocations that occurred during a request.

      • Latency: The time to complete a resolver invocation.

      • Cache hits: The number of cache hits during a request.

      • Cache misses: The number of cache misses during a request.

      These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

      • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

      If the service returns an enum value that is not available in the current SDK version, resolverLevelMetricsBehavior will return ResolverLevelMetricsBehavior.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from resolverLevelMetricsBehaviorAsString().

      Returns:
      Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

      • GraphQL errors: The number of GraphQL errors that occurred.

      • Requests: The number of invocations that occurred during a request.

      • Latency: The time to complete a resolver invocation.

      • Cache hits: The number of cache hits during a request.

      • Cache misses: The number of cache misses during a request.

      These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

      • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

      See Also:
    • dataSourceLevelMetricsBehavior

      public final DataSourceLevelMetricsBehavior dataSourceLevelMetricsBehavior()

      Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

      • Requests: The number of invocations that occured during a request.

      • Latency: The time to complete a data source invocation.

      • Errors: The number of errors that occurred during a data source invocation.

      These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

      • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

      If the service returns an enum value that is not available in the current SDK version, dataSourceLevelMetricsBehavior will return DataSourceLevelMetricsBehavior.UNKNOWN_TO_SDK_VERSION . The raw value returned by the service is available from dataSourceLevelMetricsBehaviorAsString().

      Returns:
      Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

      • Requests: The number of invocations that occured during a request.

      • Latency: The time to complete a data source invocation.

      • Errors: The number of errors that occurred during a data source invocation.

      These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

      • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

      See Also:
    • dataSourceLevelMetricsBehaviorAsString

      public final String dataSourceLevelMetricsBehaviorAsString()

      Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

      • Requests: The number of invocations that occured during a request.

      • Latency: The time to complete a data source invocation.

      • Errors: The number of errors that occurred during a data source invocation.

      These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

      • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

      If the service returns an enum value that is not available in the current SDK version, dataSourceLevelMetricsBehavior will return DataSourceLevelMetricsBehavior.UNKNOWN_TO_SDK_VERSION . The raw value returned by the service is available from dataSourceLevelMetricsBehaviorAsString().

      Returns:
      Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

      • Requests: The number of invocations that occured during a request.

      • Latency: The time to complete a data source invocation.

      • Errors: The number of errors that occurred during a data source invocation.

      These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

      • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

      • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

      See Also:
    • operationLevelMetricsConfig

      public final OperationLevelMetricsConfig operationLevelMetricsConfig()

      Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

      • Requests: The number of times a specified GraphQL operation was called.

      • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

      Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

      If the service returns an enum value that is not available in the current SDK version, operationLevelMetricsConfig will return OperationLevelMetricsConfig.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from operationLevelMetricsConfigAsString().

      Returns:
      Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

      • Requests: The number of times a specified GraphQL operation was called.

      • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

      Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

      See Also:
    • operationLevelMetricsConfigAsString

      public final String operationLevelMetricsConfigAsString()

      Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

      • Requests: The number of times a specified GraphQL operation was called.

      • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

      Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

      If the service returns an enum value that is not available in the current SDK version, operationLevelMetricsConfig will return OperationLevelMetricsConfig.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from operationLevelMetricsConfigAsString().

      Returns:
      Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

      • Requests: The number of times a specified GraphQL operation was called.

      • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

      Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

      See Also:
    • toBuilder

      public EnhancedMetricsConfig.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<EnhancedMetricsConfig.Builder,EnhancedMetricsConfig>
      Returns:
      a builder for type T
    • builder

      public static EnhancedMetricsConfig.Builder builder()
    • serializableBuilderClass

      public static Class<? extends EnhancedMetricsConfig.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.