@Extension public class DatadogGlobalConfiguration extends GlobalConfiguration
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static String |
DD_AGENT_HOST |
static String |
DD_AGENT_PORT |
static String |
DD_CI_HOSTNAME |
static String |
DD_TRACE_AGENT_PORT |
static String |
DD_TRACE_AGENT_URL |
static String |
TARGET_HOST_PROPERTY |
static String |
TARGET_PORT_PROPERTY |
static String |
TARGET_TRACE_COLLECTION_PORT_PROPERTY |
clazz
Constructor and Description |
---|
DatadogGlobalConfiguration() |
Modifier and Type | Method and Description |
---|---|
boolean |
configure(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject formData)
Indicates if this builder can be used with all kinds of project types.
|
FormValidation |
doCheckAgentConnectivityLogs(String targetHost,
String targetLogCollectionPort)
Test the connection to the Logs Collection port in the Datadog Agent.
|
FormValidation |
doCheckAgentConnectivityTraces(String targetHost,
String targetTraceCollectionPort)
Test the connection to the Traces Collection port in the Datadog Agent.
|
FormValidation |
doCheckTargetApiURL(String targetApiURL) |
FormValidation |
doCheckTargetCredentialsApiKey(Item item,
String targetCredentialsApiKey)
Tests the targetCredentialsApiKey field from the configuration screen, to check its' validity.
|
FormValidation |
doCheckTargetHost(String targetHost) |
FormValidation |
doCheckTargetLogCollectionPort(String targetLogCollectionPort) |
FormValidation |
doCheckTargetLogIntakeURL(String targetLogIntakeURL) |
FormValidation |
doCheckTargetPort(String targetPort) |
FormValidation |
doCheckTargetTraceCollectionPort(String targetTraceCollectionPort) |
FormValidation |
doCheckTargetWebhookIntakeURL(String targetWebhookIntakeURL) |
FormValidation |
doCheckTraceServiceName(String traceServiceName) |
ListBoxModel |
doFillTargetCredentialsApiKeyItems(Item item,
String targetCredentialsApiKey)
Populates the targetCredentialsApiKey field from the configuration screen with all of the valid credentials
|
FormValidation |
doTestConnection(String targetApiKey,
String targetCredentialsApiKey,
String targetApiURL)
Tests the apiKey field from the configuration screen, to check its' validity.
|
FormValidation |
doTestHostname(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.
|
Secret |
findSecret(String apiKey,
String credentialsApiKey)
Gets the correct Secret object representing the API key used for authentication to Datadog
If a Credential is provided, then use the credential, if not, default to the text submission
|
String |
getBlacklist()
Deprecated.
replaced by
getExcluded() |
String |
getCiInstanceName()
Getter function for the traceServiceName global configuration.
|
org.jenkinsci.plugins.plaincredentials.StringCredentials |
getCredentialFromId(String credentialId)
Gets the StringCredentials object for the given credential ID
|
String |
getDisplayName()
Getter function for a human readable plugin name, used in the configuration screen.
|
boolean |
getEnableCiVisibility() |
String |
getExcluded()
Getter function for the excluded global configuration, containing
a comma-separated list of jobs to exclude from monitoring.
|
String |
getGlobalJobTags()
Getter function for the globalJobTags global configuration, containing
a comma-separated list of jobs and tags that should be applied to them
|
String |
getGlobalTagFile()
Gets the globalTagFile set in the job configuration.
|
String |
getGlobalTags()
Getter function for the globalTags global configuration, containing
a comma-separated list of tags that should be applied everywhere.
|
String |
getHostname()
Getter function for the hostname global configuration.
|
String |
getIncluded()
Getter function for the included global configuration, containing
a comma-separated list of jobs to include for monitoring.
|
String |
getReportWith()
Getter function for the reportWith global configuration.
|
Secret |
getTargetApiKey()
Getter function for the targetApiKey global configuration.
|
String |
getTargetApiURL()
Getter function for the targetApiURL global configuration.
|
String |
getTargetCredentialsApiKey()
Getter function for the targetCredentialsApiKey global configuration.
|
String |
getTargetHost()
Getter function for the targetHost global configuration.
|
Integer |
getTargetLogCollectionPort()
Getter function for the targetLogCollectionPort global configuration.
|
String |
getTargetLogIntakeURL()
Getter function for the targetLogIntakeURL global configuration.
|
Integer |
getTargetPort()
Getter function for the targetPort global configuration.
|
Integer |
getTargetTraceCollectionPort()
Getter function for the targetTraceCollectionPort global configuration.
|
String |
getTargetWebhookIntakeURL()
Getter function for the targetWebhookIntakeURL global configuration.
|
String |
getTraceServiceName()
Deprecated.
use getCiInstanceName.
|
Secret |
getUsedApiKey()
Getter function for the API key global configuration.
|
String |
getWhitelist()
Deprecated.
replaced by
getIncluded() |
boolean |
isApplicable(Class<? extends AbstractProject> aClass)
Indicates if this builder can be used with all kinds of project types.
|
boolean |
isCacheBuildRuns() |
boolean |
isCollectBuildLogs() |
boolean |
isCollectBuildTraces()
Deprecated.
Use isEnabledCiVisibility
|
boolean |
isEmitConfigChangeEvents() |
boolean |
isEmitSecurityEvents() |
boolean |
isEmitSystemEvents() |
boolean |
isRefreshDogstatsdClient() |
boolean |
isRetryLogs() |
boolean |
reportWithEquals(String value) |
void |
setBlacklist(String jobs)
Deprecated.
replaced by
setExcluded(String) |
void |
setCacheBuildRuns(boolean cacheBuildRuns)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setCiInstanceName(String ciInstanceName)
Setter function for the traceServiceName global configuration.
|
void |
setCollectBuildLogs(boolean collectBuildLogs)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setCollectBuildTraces(boolean collectBuildTraces)
Deprecated.
Use setEnableCiVisibility
|
void |
setEmitConfigChangeEvents(boolean emitConfigChangeEvents)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setEmitSecurityEvents(boolean emitSecurityEvents)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setEmitSystemEvents(boolean emitSystemEvents)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setEnableCiVisibility(boolean enableCiVisibility)
Set the checkbox in the UI, used for Jenkins data binding to enable CI Visibility
|
void |
setExcluded(String jobs)
Setter function for the excluded jobs global configuration,
accepting a comma-separated string of jobs.
|
void |
setGlobalJobTags(String globalJobTags)
Setter function for the globalJobTags global configuration,
accepting a comma-separated string of jobs and tags.
|
void |
setGlobalTagFile(String globalTagFile)
Setter function for the globalFile global configuration,
accepting a comma-separated string of tags.
|
void |
setGlobalTags(String globalTags)
Setter function for the globalTags global configuration,
accepting a comma-separated string of tags.
|
void |
setHostname(String hostname)
Setter function for the hostname global configuration.
|
void |
setIncluded(String jobs)
Setter function for the includedd global configuration,
accepting a comma-separated string of jobs.
|
void |
setRefreshDogstatsdClient(boolean refreshDogstatsdClient)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setReportWith(String reportWith)
Setter function for the reportWith global configuration.
|
void |
setRetryLogs(boolean retryLogs)
Set the checkbox in the UI, used for Jenkins data binding
|
void |
setTargetApiKey(String targetApiKey)
Setter function for the apiKey global configuration.
|
void |
setTargetApiURL(String targetApiURL)
Setter function for the targetApiURL global configuration.
|
void |
setTargetCredentialsApiKey(String targetCredentialsApiKey)
Setter function for the credentials apiKey global configuration.
|
void |
setTargetHost(String targetHost)
Setter function for the targetHost global configuration.
|
void |
setTargetLogCollectionPort(Integer targetLogCollectionPort)
Setter function for the targetLogCollectionPort global configuration.
|
void |
setTargetLogIntakeURL(String targetLogIntakeURL)
Setter function for the targetLogIntakeURL global configuration.
|
void |
setTargetPort(Integer targetPort)
Setter function for the targetPort global configuration.
|
void |
setTargetTraceCollectionPort(Integer targetTraceCollectionPort)
Setter function for the targetLogCollectionPort global configuration.
|
void |
setTargetWebhookIntakeURL(String targetWebhookIntakeURL)
Setter function for the targetWebhookIntakeURL global configuration.
|
void |
setTraceServiceName(String traceServiceName)
Deprecated.
Use setCiInstanceName.
|
void |
setUsedApiKey(Secret usedApiKey)
Setter function for the API key global configuration..
|
void |
setWhitelist(String jobs)
Deprecated.
replaced by
setIncluded(String) |
static boolean |
validatePort(String targetPort) |
static boolean |
validateURL(String targetURL) |
all, getDescriptor, getGlobalConfigPage
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
public static final String DD_AGENT_HOST
public static final String DD_AGENT_PORT
public static final String DD_TRACE_AGENT_PORT
public static final String DD_TRACE_AGENT_URL
public static final String DD_CI_HOSTNAME
public static final String TARGET_HOST_PROPERTY
public static final String TARGET_PORT_PROPERTY
public static final String TARGET_TRACE_COLLECTION_PORT_PROPERTY
@DataBoundConstructor public DatadogGlobalConfiguration()
public FormValidation doCheckAgentConnectivityLogs(@QueryParameter(value="targetHost") String targetHost, @QueryParameter(value="targetLogCollectionPort") String targetLogCollectionPort)
targetHost
- - The Datadog Agent hosttargetLogCollectionPort
- - The Logs Collection port used to report logs in the Datadog Agentpublic FormValidation doCheckAgentConnectivityTraces(@QueryParameter(value="targetHost") String targetHost, @QueryParameter(value="targetTraceCollectionPort") String targetTraceCollectionPort)
targetHost
- - The Datadog Agent hosttargetTraceCollectionPort
- - The Traces Collection port used to report logs in the Datadog Agentpublic org.jenkinsci.plugins.plaincredentials.StringCredentials getCredentialFromId(String credentialId)
credentialId
- - The Id of the credential to getpublic Secret findSecret(String apiKey, String credentialsApiKey)
apiKey
- - The text API key the user submittedcredentialsApiKey
- - The Id of the credential the user submittedpublic FormValidation doTestConnection(@QueryParameter(value="targetApiKey") String targetApiKey, @QueryParameter(value="targetCredentialsApiKey") String targetCredentialsApiKey, @QueryParameter(value="targetApiURL") String targetApiURL) throws IOException, javax.servlet.ServletException
targetApiURL
- - The API Url to validate the apikey.targetApiKey
- - A String containing the apiKey submitted from the form on the
configuration screen, which will be used to authenticate a request to the
Datadog API.targetCredentialsApiKey
- - A String containing the API key as a credential, if it is not specified,
try the connection with the targetApiKeyIOException
- if there is an input/output exception.javax.servlet.ServletException
- if there is a servlet exception.public ListBoxModel doFillTargetCredentialsApiKeyItems(@AncestorInPath Item item, @QueryParameter(value="targetCredentialsApiKey") String targetCredentialsApiKey)
item
- - The context within which to list available credentialstargetCredentialsApiKey
- - A String containing the API key as a credentialpublic FormValidation doCheckTargetCredentialsApiKey(@AncestorInPath Item item, @QueryParameter(value="targetCredentialsApiKey") String targetCredentialsApiKey)
item
- - The context within which to list available credentials.targetCredentialsApiKey
- - A String containing the API key as a credentialpublic FormValidation doTestHostname(@QueryParameter(value="hostname") String hostname)
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.public FormValidation doCheckTargetApiURL(@QueryParameter(value="targetApiURL") String targetApiURL)
targetApiURL
- - The API URL which the plugin will report to.public FormValidation doCheckTargetLogIntakeURL(@QueryParameter(value="targetLogIntakeURL") String targetLogIntakeURL)
targetLogIntakeURL
- - The Log Intake URL which the plugin will report to.public FormValidation doCheckTargetWebhookIntakeURL(@QueryParameter(value="targetWebhookIntakeURL") String targetWebhookIntakeURL)
targetWebhookIntakeURL
- - The Webhook Intake URL which the plugin will report to.public static boolean validateURL(String targetURL)
public FormValidation doCheckTargetHost(@QueryParameter(value="targetHost") String targetHost)
targetHost
- - The dogStatsD Host which the plugin will report to.public static boolean validatePort(String targetPort)
public FormValidation doCheckTargetPort(@QueryParameter(value="targetPort") String targetPort)
targetPort
- - The dogStatsD Port which the plugin will report to.public FormValidation doCheckTargetLogCollectionPort(@QueryParameter(value="targetLogCollectionPort") String targetLogCollectionPort)
targetLogCollectionPort
- - The Log Collection Port which the plugin will report to.public FormValidation doCheckTargetTraceCollectionPort(@QueryParameter(value="targetTraceCollectionPort") String targetTraceCollectionPort)
targetTraceCollectionPort
- - The Trace Collection Port which the plugin will report to.public FormValidation doCheckTraceServiceName(@QueryParameter(value="traceServiceName") String traceServiceName)
public boolean isApplicable(Class<? extends AbstractProject> aClass)
aClass
- - An extension of the AbstractProject class representing a specific type of
project.public String getDisplayName()
getDisplayName
in class Descriptor<GlobalConfiguration>
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) throws Descriptor.FormException
configure
in class GlobalConfiguration
req
- - A StaplerRequest objectformData
- - A JSONObject containing the submitted form data from the configuration
screen.FormException
- if the formData is invalid.Descriptor.FormException
public boolean reportWithEquals(String value)
public String getReportWith()
@DataBoundSetter public void setReportWith(String reportWith)
reportWith
- = A string containing the reportWith global configuration.public String getTargetApiURL()
@DataBoundSetter public void setTargetApiURL(String targetApiURL)
targetApiURL
- = A string containing the DataDog API URL@DataBoundSetter public void setTargetLogIntakeURL(String targetLogIntakeURL)
targetLogIntakeURL
- = A string containing the DataDog Log Intake URLpublic String getTargetLogIntakeURL()
@DataBoundSetter public void setTargetWebhookIntakeURL(String targetWebhookIntakeURL)
targetWebhookIntakeURL
- = A string containing the DataDog Webhook Intake URLpublic String getTargetWebhookIntakeURL()
public Secret getTargetApiKey()
@DataBoundSetter public void setTargetApiKey(String targetApiKey)
targetApiKey
- = A string containing the plaintext representation of a
DataDog API Keypublic Secret getUsedApiKey()
@DataBoundSetter public void setUsedApiKey(Secret usedApiKey)
usedApiKey
- = A Secret containing the DataDog API Keypublic String getTargetCredentialsApiKey()
@DataBoundSetter public void setTargetCredentialsApiKey(String targetCredentialsApiKey)
targetCredentialsApiKey
- = A string containing the plaintext representation of a
DataDog API Keypublic String getTargetHost()
@DataBoundSetter public void setTargetHost(String targetHost)
targetHost
- = A string containing the DogStatsD Hostpublic Integer getTargetPort()
@DataBoundSetter public void setTargetPort(Integer targetPort)
targetPort
- = A string containing the DogStatsD Portpublic Integer getTargetLogCollectionPort()
@DataBoundSetter public void setTargetLogCollectionPort(Integer targetLogCollectionPort)
targetLogCollectionPort
- = A string containing the Log Collection Portpublic Integer getTargetTraceCollectionPort()
@DataBoundSetter public void setTargetTraceCollectionPort(Integer targetTraceCollectionPort)
targetTraceCollectionPort
- = A string containing the Trace Collection Port@Deprecated public String getTraceServiceName()
@Deprecated @DataBoundSetter public void setTraceServiceName(String traceServiceName)
traceServiceName
- = A string containing the Trace Service Namepublic String getCiInstanceName()
public void setCiInstanceName(String ciInstanceName)
ciInstanceName
- = A string containing the CI Instance Namepublic String getHostname()
@DataBoundSetter public void setHostname(String hostname)
hostname
- - A String containing the hostname of the Jenkins host.@Deprecated public String getBlacklist()
getExcluded()
public String getExcluded()
@Deprecated @DataBoundSetter public void setBlacklist(String jobs)
setExcluded(String)
jobs
- - a comma-separated list of jobs to exclude from monitoring.@DataBoundSetter public void setExcluded(String jobs)
jobs
- - a comma-separated list of jobs to exclude from monitoring.@Deprecated public String getWhitelist()
getIncluded()
public String getIncluded()
@Deprecated @DataBoundSetter public void setWhitelist(String jobs)
setIncluded(String)
jobs
- - a comma-separated list of jobs to include for monitoring.@DataBoundSetter public void setIncluded(String jobs)
jobs
- - a comma-separated list of jobs to include for monitoring.public String getGlobalTagFile()
@DataBoundSetter public void setGlobalTagFile(String globalTagFile)
globalTagFile
- - a comma-separated list of tags.public String getGlobalTags()
@DataBoundSetter public void setGlobalTags(String globalTags)
globalTags
- - a comma-separated list of tags.public String getGlobalJobTags()
@DataBoundSetter public void setGlobalJobTags(String globalJobTags)
globalJobTags
- - a comma-separated list of jobs to include from monitoring.public boolean isEmitSecurityEvents()
Boolean
indicating if the user has configured Datadog to emit Security related events.@DataBoundSetter public void setEmitSecurityEvents(boolean emitSecurityEvents)
emitSecurityEvents
- - The checkbox status (checked/unchecked)public boolean isRetryLogs()
Boolean
indicating if the user has configured Datadog to retry sending logs.@DataBoundSetter public void setRetryLogs(boolean retryLogs)
retryLogs
- - The checkbox status (checked/unchecked)public boolean isRefreshDogstatsdClient()
Boolean
indicating if the user has configured Datadog to refresh the dogstatsd client@DataBoundSetter public void setRefreshDogstatsdClient(boolean refreshDogstatsdClient)
refreshDogstatsdClient
- - The checkbox status (checked/unchecked)public boolean isCacheBuildRuns()
Boolean
indicating if the user has configured Datadog to cache build runs@DataBoundSetter public void setCacheBuildRuns(boolean cacheBuildRuns)
cacheBuildRuns
- - The checkbox status (checked/unchecked)public boolean isEmitSystemEvents()
Boolean
indicating if the user has configured Datadog to emit System related events.@DataBoundSetter public void setEmitSystemEvents(boolean emitSystemEvents)
emitSystemEvents
- - The checkbox status (checked/unchecked)public boolean isEmitConfigChangeEvents()
Boolean
indicating if the user has configured Datadog to emit Config Change events.@DataBoundSetter public void setEmitConfigChangeEvents(boolean emitConfigChangeEvents)
emitConfigChangeEvents
- - The checkbox status (checked/unchecked)public boolean isCollectBuildLogs()
Boolean
indicating if the user has configured Datadog to collect logs.@DataBoundSetter public void setCollectBuildLogs(boolean collectBuildLogs)
collectBuildLogs
- - The checkbox status (checked/unchecked)@Deprecated public boolean isCollectBuildTraces()
Boolean
indicating if the user has configured Datadog to collect traces.@DataBoundSetter @Deprecated public void setCollectBuildTraces(boolean collectBuildTraces)
collectBuildTraces
- - The checkbox status (checked/unchecked)public boolean getEnableCiVisibility()
Boolean
indicating if the user has configured Datadog to enable CI Visibility.@DataBoundSetter public void setEnableCiVisibility(boolean enableCiVisibility)
enableCiVisibility
- - The checkbox status (checked/unchecked)Copyright © 2016–2023. All rights reserved.