Copilot commented on code in PR #13867:
URL: https://github.com/apache/skywalking/pull/13867#discussion_r3213160507


##########
oap-server/oal-rt/src/main/resources/code-templates-v2/metrics/appendDebugFields.ftl:
##########
@@ -0,0 +1,18 @@
+protected void appendDebugFields(com.google.gson.JsonObject obj) {
+super.appendDebugFields(obj);
+<#list fieldsFromSource as field>
+    <#if field.typeName == "long">
+        obj.addProperty("${field.columnName}", 
java.lang.Long.valueOf(${field.fieldGetter}()));

Review Comment:
   New behavior is introduced via the generated appendDebugFields(JsonObject) 
override, but there is no unit test in oal-rt asserting that a generated 
*Metrics class’s toJson() output includes the `@ScopeDefaultColumn-derived` 
fields (e.g., entity_id / attr0..attr5). Existing generator tests only verify 
class loading and public method presence, so this regression could recur 
without failing tests. Please add a test that generates a Service-based metric, 
sets entityId/attr fields on the generated metrics instance, calls toJson(), 
and asserts the resulting JSON contains these columns (and still includes the 
family’s value fields via super.appendDebugFields).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to