-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable CI Visibility UI #221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed README
Co-authored-by: Fernando Mayo <fermayo@gmail.com>
Co-authored-by: Fernando Mayo <fermayo@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found some mistake on logging otherwise looks good.
It'd be good to have some tests for the logic in the form.
if(!enableCiVisibility || DatadogClient.ClientType.DSD.name().equals(this.reportWith)) { | ||
this.collectBuildTraces = enableCiVisibility; | ||
} else { | ||
logger.warning("CI Visibility can only be enabled using Datadog Agent mode."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this would warn if users set the env var DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY
to False
? Is that a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hummm, no... The warning is shown when:
enableCiVisibility == true && DatadogClient.ClientType.HTTP.name().equals(this.reportWith)
I'm going to change the condition to be clearer.
// NOTE: Change this when APM Traces was released as public feature. | ||
this.setTraceServiceName(DEFAULT_TRACES_SERVICE_NAME); | ||
this.setEnableCiVisibility(ciVisibilityData != null && !ciVisibilityData.isNullObject()); | ||
} catch (Exception ex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this log a severe error when you raise throw new FormException("CI Visibility can only be enabled using Datadog Agent mode.", "collectBuildTraces")
? that seems like a mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we cannot parse the configuration, it's an error and we should log it as an error IMHO. If we cannot parse the configuration is not an expected behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but you're also throwing a validation exception in this block and that's not an error in parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're totally right. Good catch.
src/main/java/org/datadog/jenkins/plugins/datadog/DatadogGlobalConfiguration.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Adrián López Calvo <adrianlopezcalvo@gmail.com>
Co-authored-by: Fernando Mayo <fermayo@gmail.com>
Co-authored-by: Fernando Mayo <fermayo@gmail.com>
Yeah, I agree. However, I think we cannot execute unit tests with this logic, but integration tests. We'd need to take a deeper look at how to do it because this configuration does not have any tests yet (even before CI Visibility). I've tested these changes in real Jenkins instances, so I think we can go forward, unblock the UI, and then we can invest some time into automatize these integration tests. |
Co-authored-by: Fernando Mayo <fermayo@gmail.com>
| Global tag file | The path to a workspace file containing a comma separated list of tags (not compatible with pipeline jobs). | `DATADOG_JENKINS_PLUGIN_GLOBAL_TAG_FILE` | | ||
| Global tags | A comma-separated list of tags to apply to all metrics, events, and service checks. Tags can include environment variables that are defined in the master jenkins instance. | `DATADOG_JENKINS_PLUGIN_GLOBAL_TAGS` | | ||
| Global job tags | A comma separated list of regex to match a job and a list of tags to apply to that job. Tags can include environment variables that are defined in the master jenkins instance. **Note**: Tags can reference match groups in the regex using the `$` symbol, for example: `(.*?)_job_(*?)_release, owner:$1, release_env:$2, optional:Tag3` | `DATADOG_JENKINS_PLUGIN_GLOBAL_JOB_TAGS` | | ||
| Send security audit events | Submits the `Security Events Type` of events and metrics (enabled by default). | `DATADOG_JENKINS_PLUGIN_EMIT_SECURITY_EVENTS` | | ||
| Send system events | Submits the `System Events Type` of events and metrics (enabled by default). | `DATADOG_JENKINS_PLUGIN_EMIT_SYSTEM_EVENTS` | | ||
| Enable Log Collection | Collect and Submit build logs (disabled by default). | `DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you removing this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not removing this, but moving to another place in the README. These envvars are related to the Advanced
tab, where the "Enable Log Collection" is not there anymore.
Requirements for Contributing to this repository
What does this PR do?
This PR enables the configuration for
CI Visibility
via UI and environment variables:DATADOG_JENKINS_PLUGIN_TARGET_TRACE_COLLECTION_PORT
DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY
DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME
.Additionally, the PR adds some changes to the current UI to accommodate the CI Visibility feature in a coherent way for the user.
Datadog Agent
instead ofDogStatsD
in the applicable context.Finally, this PR modifies the
README.md
document to include the new configuration setup forCI Visibility
.Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/
label attached. If applicable it should have thebackward-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.