-
Notifications
You must be signed in to change notification settings - Fork 308
feat: add injection metadata fields to telemetry forwarder #9094
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
base: master
Are you sure you want to change the base?
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.
Looks like you accidentally committed bunch of binaries
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java6/datadog/trace/bootstrap/AgentPreCheck.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java6/datadog/trace/bootstrap/AgentPreCheck.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
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.
Almost LGTM, just some tests polishing left.
...va-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy
Outdated
Show resolved
Hide resolved
...va-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy
Outdated
Show resolved
Hide resolved
...va-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy
Outdated
Show resolved
Hide resolved
...va-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy
Outdated
Show resolved
Hide resolved
...va-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy
Outdated
Show resolved
Hide resolved
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.
LGTM, but minor cleanup required.
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Show resolved
Hide resolved
...va-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/BootstrapInitializationTelemetry.java
Show resolved
Hide resolved
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.
Left a bunch of comments.
The request for change is only for the .gitignore
to avoid the PR to be merged without the fix for 🙏
@@ -60,6 +60,7 @@ replay_pid* | |||
.bsp/ | |||
**/src/*/generated/* | |||
!dd-java-agent/benchmark/releases/*.jar | |||
*.jar |
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 do want jar, like maven and gradle wrappers. Can you revert this part please?
setMetadata("error", mapResultClass(reasonCode), reasonCode); | ||
} | ||
|
||
private void setMetadata(String result, String resultClass, String resultReason) { |
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 would rename the result helper method and use overloading for clarity. Something like:
private void setMetadata(String result, String resultClass, String resultReason) { | |
private void setMetaResult(String result, String resultCode) { | |
setMetaResult(result, mapResultClass(reasonCode), reasonCode); | |
} | |
private void setMetaResult(String result, String resultClass, String resultReason) { | |
} |
WDYT?
@@ -26,19 +26,47 @@ class BootstrapInitializationTelemetryTest extends Specification { | |||
initTelemetryProxy.setAdaptee(initTelemetry) | |||
|
|||
this.initTelemetry = initTelemetryProxy | |||
this.initTelemetry.initMetaInfo("runtime_name", "java") | |||
this.initTelemetry.initMetaInfo("runtime_version", "1.8.0_382") |
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 this version is coming from you current setup or the current CI JDK version, you can rely on it for testing
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.
This is 100% synthetic test, no need in real data.
@@ -76,6 +106,10 @@ class BootstrapInitializationTelemetryTest extends Specification { | |||
!capture.json().contains("library_entrypoint.complete") | |||
} | |||
|
|||
private String json(String result, String resultClass, String resultReason, List points) { | |||
return """{"metadata":{"runtime_name":"java","runtime_version":"1.8.0_382","result":"${result}","result_class":"${resultClass}","result_reason":"${resultReason}"},"points":${new groovy.json.JsonBuilder(points)}}""" |
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.
Same here
What Does This Do
This change adds additional fields to the telemetry forwarder used during injection. These fields will be used to add additional context that will be surfaced to the end user in the following Figma:
See Injection Metadata for more details.
Motivation
Adding addition information for telemetry forwarder during injection.
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: INPLAT-614