Class EKSPlugin

  • All Implemented Interfaces:
    Plugin

    public class EKSPlugin
    extends java.lang.Object
    implements Plugin
    A plugin, for use with the AWSXRayRecorderBuilder class, which will add Kubernetes metadata to segments. If the cluster uses ContainerInsights this plugin will extract log configuration information.
    See Also:
    AWSXRayRecorderBuilder.withPlugin(Plugin)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ORIGIN  
    • Constructor Summary

      Constructors 
      Constructor Description
      EKSPlugin()
      Constructs an empty EKS plugin.
      EKSPlugin​(@Nullable java.lang.String clusterName)
      Constructs an EKS plugin with a given cluster name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(@Nullable java.lang.Object o)
      Determine equality of plugins using origin to uniquely identify them
      java.util.Set<AWSLogReference> getLogReferences()  
      java.lang.String getOrigin()
      Returns the name of the origin associated with this plugin.
      java.util.Map<java.lang.String,​@Nullable java.lang.Object> getRuntimeContext()  
      java.lang.String getServiceName()  
      int hashCode()
      Hash plugin object using origin to uniquely identify them
      boolean isEnabled()  
      void populateRuntimeContext()
      Generate runtime context with pod metadata from K8s.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EKSPlugin

        public EKSPlugin()
        Constructs an empty EKS plugin. The cluster name, along with other metadata, will be retrieved from the Container Insights endpoint automatically.
      • EKSPlugin

        public EKSPlugin​(@Nullable java.lang.String clusterName)
        Constructs an EKS plugin with a given cluster name.
        Parameters:
        clusterName - the EKS cluster name
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface Plugin
        Returns:
        true if an environment inspection determines X-Ray is operating in the correct environment for this plugin OR if X-Ray cannot accurately determine if it's in this plugin's environment
      • getServiceName

        public java.lang.String getServiceName()
        Specified by:
        getServiceName in interface Plugin
      • getRuntimeContext

        public java.util.Map<java.lang.String,​@Nullable java.lang.Object> getRuntimeContext()
        Specified by:
        getRuntimeContext in interface Plugin
      • populateRuntimeContext

        public void populateRuntimeContext()
        Generate runtime context with pod metadata from K8s.
      • getOrigin

        public java.lang.String getOrigin()
        Description copied from interface: Plugin
        Returns the name of the origin associated with this plugin. The AWSXRayRecorder contains a prioritized list of origins from least to most specific.
        Specified by:
        getOrigin in interface Plugin
        Returns:
        the name of the origin associated with this plugin.
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Determine equality of plugins using origin to uniquely identify them
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Hash plugin object using origin to uniquely identify them
        Overrides:
        hashCode in class java.lang.Object