Skip to content

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

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

sydney-tung
Copy link

@sydney-tung sydney-tung commented Jul 3, 2025

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:

Screenshot 2025-07-03 at 10 39 35 AM

See Injection Metadata for more details.

Motivation

Adding addition information for telemetry forwarder during injection.

Additional Notes

Contributor Checklist

Jira ticket: INPLAT-614

Copy link
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a 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

@sydney-tung sydney-tung marked this pull request as ready for review July 8, 2025 17:47
@sydney-tung sydney-tung requested a review from a team as a code owner July 8, 2025 17:47
Copy link
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a 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.

Copy link
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a 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.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added type: enhancement Enhancements and improvements comp: core Tracer core labels Jul 9, 2025
@sydney-tung sydney-tung requested a review from dougqh July 10, 2025 15:57
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a 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
Copy link
Contributor

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) {
Copy link
Contributor

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:

Suggested change
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")
Copy link
Contributor

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

Copy link
Contributor

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)}}"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: core Tracer core type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants