Class DatadogGlobalConfiguration

    • Constructor Detail

      • DatadogGlobalConfiguration

        @DataBoundConstructor
        public DatadogGlobalConfiguration()
    • Method Detail

      • loadEnvVariables

        public void loadEnvVariables()
      • doTestFilteringConfig

        public FormValidation doTestFilteringConfig​(@QueryParameter("emitSecurityEvents")
                                                    boolean emitSecurityEvents,
                                                    @QueryParameter("emitSystemEvents")
                                                    boolean emitSystemEvents,
                                                    @QueryParameter("includeEvents")
                                                    String includeEvents,
                                                    @QueryParameter("excludeEvents")
                                                    String excludeEvents)
        Checks filtering config for comma-separated list, overlapping include/exclude lists, unrecognizable event names, and redundant inclusion/exclusion.
        Parameters:
        emitSecurityEvents - toggle to send security events
        emitSystemEvents - toggle to send system events
        includeEvents - string of included events list (comma-separated)
        excludeEvents - string of excluded events list (comma-separated)
        Returns:
        FormValidation.error() if not formatted correctly or overlapping lists, FormValidation.warning() for redundant config, and FormValidation.ok() for all else
      • doTestHostname

        public FormValidation doTestHostname​(@QueryParameter("hostname")
                                             String hostname)
        Tests the hostname field from the configuration screen, to determine if the hostname is of a valid format, according to the RFC 1123. It is used in the config.jelly resource file. See method="testHostname"
        Parameters:
        hostname - - A String containing the hostname submitted from the form on the configuration screen, which will be used to authenticate a request to the Datadog API.
        Returns:
        a FormValidation object used to display a message to the user on the configuration screen.
      • doCheckCiInstanceName

        public FormValidation doCheckCiInstanceName​(@QueryParameter("ciInstanceName")
                                                    String ciInstanceName)
      • doCheckIncluded

        public FormValidation doCheckIncluded​(@QueryParameter("included")
                                              String included)
      • doCheckExcluded

        public FormValidation doCheckExcluded​(@QueryParameter("excluded")
                                              String excluded)
      • isApplicable

        public boolean isApplicable​(Class<? extends AbstractProject> aClass)
        Indicates if this builder can be used with all kinds of project types.
        Parameters:
        aClass - - An extension of the AbstractProject class representing a specific type of project.
        Returns:
        a boolean signifying whether or not a builder can be used with a specific type of project.
      • getDisplayName

        @NonNull
        public String getDisplayName()
        Getter function for a human-readable plugin name, used in the configuration screen.
        Overrides:
        getDisplayName in class Descriptor<GlobalConfiguration>
        Returns:
        a String containing the human-readable display name for this plugin.
      • configure

        public boolean configure​(org.kohsuke.stapler.StaplerRequest req,
                                 net.sf.json.JSONObject formData)
                          throws Descriptor.FormException
        Indicates if this builder can be used with all kinds of project types.
        Overrides:
        configure in class GlobalConfiguration
        Parameters:
        req - - A StaplerRequest object
        formData - - A JSONObject containing the submitted form data from the configuration screen.
        Returns:
        a boolean signifying the success or failure of configuration.
        Throws:
        Descriptor.FormException - if the formData is invalid.
      • setDatadogClientConfiguration

        public void setDatadogClientConfiguration​(DatadogClientConfiguration datadogClientConfiguration)
      • getCiInstanceName

        public String getCiInstanceName()
        Getter function for the ciInstanceName global configuration.
        Returns:
        a String containing the ciInstanceName global configuration.
      • setCiInstanceName

        public void setCiInstanceName​(String ciInstanceName)
        Setter function for the ciInstanceName global configuration.
        Parameters:
        ciInstanceName - = A string containing the CI Instance Name
      • getHostname

        public String getHostname()
        Getter function for the hostname global configuration.
        Returns:
        a String containing the hostname global configuration.
      • setHostname

        public void setHostname​(String hostname)
        Setter function for the hostname global configuration.
        Parameters:
        hostname - - A String containing the hostname of the Jenkins host.
      • getDatadogAppHostname

        public String getDatadogAppHostname()
      • setDatadogAppHostname

        public void setDatadogAppHostname​(String datadogAppHostname)
      • isJobExcluded

        public boolean isJobExcluded​(@Nonnull
                                     String jobName)
      • getExcluded

        public String getExcluded()
        Getter function for the excluded global configuration, containing a comma-separated list of jobs to exclude from monitoring.
        Returns:
        a String array containing the excluded global configuration.
      • setExcluded

        public void setExcluded​(String jobs)
        Setter function for the excluded jobs global configuration, accepting a comma-separated string of jobs.
        Parameters:
        jobs - - a comma-separated list of jobs to exclude from monitoring.
      • isJobIncluded

        public boolean isJobIncluded​(@Nonnull
                                     String jobName)
      • getIncluded

        public String getIncluded()
        Getter function for the included global configuration, containing a comma-separated list of jobs to include for monitoring.
        Returns:
        a String array containing the included global configuration.
      • setIncluded

        public void setIncluded​(String jobs)
        Setter function for the includedd global configuration, accepting a comma-separated string of jobs.
        Parameters:
        jobs - - a comma-separated list of jobs to include for monitoring.
      • getGlobalTagFile

        public String getGlobalTagFile()
        Gets the globalTagFile set in the job configuration.
        Returns:
        a String representing the relative path to a globalTagFile
      • setGlobalTagFile

        public void setGlobalTagFile​(String globalTagFile)
        Setter function for the globalFile global configuration, accepting a comma-separated string of tags.
        Parameters:
        globalTagFile - - a comma-separated list of tags.
      • getGlobalTags

        public String getGlobalTags()
        Getter function for the globalTags global configuration, containing a comma-separated list of tags that should be applied everywhere.
        Returns:
        a String array containing the globalTags global configuration
      • setGlobalTags

        public void setGlobalTags​(String globalTags)
        Setter function for the globalTags global configuration, accepting a comma-separated string of tags.
        Parameters:
        globalTags - - a comma-separated list of tags.
      • getGlobalJobTags

        public String getGlobalJobTags()
        Getter function for the globalJobTags global configuration, containing a comma-separated list of jobs and tags that should be applied to them
        Returns:
        a String array containing the globalJobTags global configuration.
      • setGlobalJobTags

        public void setGlobalJobTags​(String globalJobTags)
        Setter function for the globalJobTags global configuration, accepting a comma-separated string of jobs and tags.
        Parameters:
        globalJobTags - - a comma-separated list of jobs to include from monitoring.
      • isRetryLogs

        @Deprecated
        public boolean isRetryLogs()
        Deprecated.
        This method is here to ensure backward compatibility
      • setRetryLogs

        @Deprecated
        @DataBoundSetter
        public void setRetryLogs​(boolean retryLogs)
        Deprecated.
        This method is here to ensure backward compatibility
      • isRefreshDogstatsdClient

        public boolean isRefreshDogstatsdClient()
        Returns:
        - A Boolean indicating if the user has configured Datadog to refresh the dogstatsd client
      • setRefreshDogstatsdClient

        public void setRefreshDogstatsdClient​(boolean refreshDogstatsdClient)
        Set the checkbox in the UI, used for Jenkins data binding
        Parameters:
        refreshDogstatsdClient - - The checkbox status (checked/unchecked)
      • isCacheBuildRuns

        public boolean isCacheBuildRuns()
        Returns:
        - A Boolean indicating if the user has configured Datadog to cache build runs
      • setCacheBuildRuns

        public void setCacheBuildRuns​(boolean cacheBuildRuns)
        Set the checkbox in the UI, used for Jenkins data binding
        Parameters:
        cacheBuildRuns - - The checkbox status (checked/unchecked)
      • isUseAwsInstanceHostname

        public boolean isUseAwsInstanceHostname()
        Returns:
        - A Boolean indicating if the user has configured Datadog to use AWS instance as hostname
      • setUseAwsInstanceHostname

        public void setUseAwsInstanceHostname​(boolean useAwsInstanceHostname)
        Set the checkbox in the UI, used for Jenkins data binding
        Parameters:
        useAwsInstanceHostname - - The checkbox status (checked/unchecked)
      • isShowDatadogLinks

        public boolean isShowDatadogLinks()
      • setShowDatadogLinks

        public void setShowDatadogLinks​(boolean showDatadogLinks)
      • isEmitSecurityEvents

        public boolean isEmitSecurityEvents()
        Returns:
        - A Boolean indicating if the user has configured Datadog to emit Security related events.
      • setEmitSecurityEvents

        public void setEmitSecurityEvents​(boolean emitSecurityEvents)
        Set the checkbox in the UI, used for Jenkins data binding
        Parameters:
        emitSecurityEvents - - The checkbox status (checked/unchecked)
      • isEmitSystemEvents

        public boolean isEmitSystemEvents()
        Returns:
        - A Boolean indicating if the user has configured Datadog to emit System related events.
      • setEmitSystemEvents

        public void setEmitSystemEvents​(boolean emitSystemEvents)
        Set the checkbox in the UI, used for Jenkins data binding
        Parameters:
        emitSystemEvents - - The checkbox status (checked/unchecked)
      • setIncludeEvents

        public void setIncludeEvents​(String events)
        Setter function for the included global configuration, accepting a comma-separated string of events.
        Parameters:
        events - - a comma-separated list of events to include for sending to agent.
      • getIncludeEvents

        public String getIncludeEvents()
        Getter function for the included global configuration, containing a comma-separated list of events to send to agent.
        Returns:
        a String array containing the events included global configuration.
      • setExcludeEvents

        public void setExcludeEvents​(String events)
        Setter function for the included global configuration, accepting a comma-separated string of events.
        Parameters:
        events - - a comma-separated list of events to exclude for sending to agent.
      • getExcludeEvents

        public String getExcludeEvents()
        Getter function for the included global configuration, containing a comma-separated list of events not to send.
        Returns:
        a String array containing the events included global configuration.
      • isCollectBuildLogs

        public boolean isCollectBuildLogs()
        Returns:
        - A Boolean indicating if the user has configured Datadog to collect logs.
      • setCollectBuildLogs

        public void setCollectBuildLogs​(boolean collectBuildLogs)
        Set the checkbox in the UI, used for Jenkins data binding
        Parameters:
        collectBuildLogs - - The checkbox status (checked/unchecked)
      • getEnableCiVisibility

        public boolean getEnableCiVisibility()
        Returns:
        - A Boolean indicating if the user has configured Datadog to enable CI Visibility.
      • setEnableCiVisibility

        public void setEnableCiVisibility​(boolean enableCiVisibility)
        Set the checkbox in the UI, used for Jenkins data binding to enable CI Visibility
        Parameters:
        enableCiVisibility - - The checkbox status (checked/unchecked)
      • setEmitConfigChangeEvents

        public void setEmitConfigChangeEvents​(boolean ignored)
        Deprecated.
        this configuration property has been removed
      • getEmitConfigChangeEvents

        @Deprecated
        public boolean getEmitConfigChangeEvents()
        Deprecated.
        this configuration property has been removed
      • readResolve

        protected Object readResolve()
        Maintains backwards compatibility. Invoked by XStream when this object is deserialized.