---
# AWS/PrivateLinkEndpoints endpoint-level grain. AWS publishes a separate
# endpoint+subnet grain; that higher-cardinality view is the opt-in
# privatelink_endpoint_subnet profile.
version: v1
display_name: AWS PrivateLink Endpoint
namespace: AWS/PrivateLinkEndpoints
query:
  period: 5m
  lookback: 5m
  publication_delay: 5m
instance:
  dimensions:
    - name: Endpoint Type
      label: endpoint_type
    - name: Service Name
      label: service_name
    - name: VPC Endpoint Id
      label: vpc_endpoint_id
    - name: VPC Id
      label: vpc_id
metrics:
  - id: active_connections
    metric_name: ActiveConnections
    statistics: [average]
  - id: bytes_processed
    metric_name: BytesProcessed
    statistics: [average, sum]
    rate: true
  - id: new_connections
    metric_name: NewConnections
    statistics: [average, sum]
    rate: true
  - id: packets_dropped
    metric_name: PacketsDropped
    statistics: [sum]
    rate: true
  - id: rst_packets_received
    metric_name: RstPacketsReceived
    statistics: [sum]
    rate: true
template:
  family: PrivateLink
  context_namespace: privatelink_endpoint
  chart_defaults:
    instances:
      by_labels: [account_id, region, endpoint_type, service_name, vpc_endpoint_id, vpc_id]
  charts:
    - id: aws_cloudwatch_privatelink_endpoint_active_connections
      context: active_connections
      title: PrivateLink Active Connections
      family: Connections
      units: connections
      algorithm: absolute
      dimensions:
        - selector: active_connections_average
          name: active
    - id: aws_cloudwatch_privatelink_endpoint_average_processed_bytes
      context: average_processed_bytes
      title: PrivateLink Average Processed Bytes
      family: Traffic
      units: bytes
      algorithm: absolute
      dimensions:
        - selector: bytes_processed_average
          name: average
    - id: aws_cloudwatch_privatelink_endpoint_processed_bytes
      context: processed_bytes
      title: PrivateLink Processed Bytes
      family: Traffic
      units: bytes/s
      algorithm: absolute
      dimensions:
        - selector: bytes_processed_sum
          name: processed
    - id: aws_cloudwatch_privatelink_endpoint_average_new_connections
      context: average_new_connections
      title: PrivateLink Average New Connections
      family: Connections
      units: connections
      algorithm: absolute
      dimensions:
        - selector: new_connections_average
          name: average
    - id: aws_cloudwatch_privatelink_endpoint_new_connections
      context: new_connections
      title: PrivateLink New Connections
      family: Connections
      units: connections/s
      algorithm: absolute
      dimensions:
        - selector: new_connections_sum
          name: new
    - id: aws_cloudwatch_privatelink_endpoint_packet_problems
      context: packet_problems
      title: PrivateLink Packet Problems
      family: Packets
      units: packets/s
      algorithm: absolute
      dimensions:
        - selector: packets_dropped_sum
          name: dropped
        - selector: rst_packets_received_sum
          name: reset_received
