Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions src/zatt_converter/zcl_att_conv_zipkin.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
CLASS zcl_att_conv_zipkin DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.

INTERFACES zif_att_trace_converter.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.



CLASS zcl_att_conv_zipkin IMPLEMENTATION.



METHOD zif_att_trace_converter~convert.

DATA(trace_id) = trace->get_trace_id( ).

DATA(zipkin_json) = |[\{| &&
|"id": "dummy",| &&
|"traceId": "{ trace_id }",| &&
|\}]|.

converted_trace-trace_id = trace_id.
converted_trace-json = zipkin_json.

* [{
* "id": "11123456",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's with all that json? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's the reminder that it's not finished. Not good, but maybe better to have some progress.

* "": "0123456789abcdef",
* "timestamp": 1608239395286533,
* "duration": 100000,
* "name": "span from ABAPTAG1!",
* "description": "description",
* "tags": {
* "http.method": "GET",
* "http.path": "/dummy",
* "tag1": "tag1",
* "tag2": "tag2"
* },
* "localEndpoint": {
* "serviceName": "shell script"
* }
*},
*{
* "id": "111234567",
* "traceId": "0123456789abcdef",
* "timestamp": 1608239495287533,
* "duration": 100000,
* "name": "span from ABAPTAG2!",
* "kind": "SERVER",
* "tags": {
* "http.method": "GET",
* "http.path": "/dummy",
* "tag1": "tag1",
* "tag2": "tag2"
* },
* "localEndpoint": {
* "serviceName": "shell script"
* }
*},
*{
* "id": "352bff9a74ca9ad2",
* "traceId": "0123456789abcdef",
* "parentId": "111234567",
* "name": "get /api",
* "timestamp": 1556604172355737,
* "duration": 1431,
* "kind": "SERVER",
* "localEndpoint": {
* "serviceName": "backend",
* "ipv4": "192.168.99.1",
* "port": 3306
* },
* "remoteEndpoint": {
* "ipv4": "172.19.0.2",
* "port": 58648
* },
* "tags": {
* "http.method": "GET",
* "http.path": "/api"
* }
* }]

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/zatt_converter/zcl_att_conv_zipkin.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_ATT_CONV_ZIPKIN</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>att converter zipkin</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
11 changes: 10 additions & 1 deletion src/zcl_att_trace_transaction.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ CLASS zcl_att_trace_transaction DEFINITION
CREATE PUBLIC .

PUBLIC SECTION.

TYPES ty_trace_id TYPE sysuuid_c32.

METHODS constructor.
METHODS get_trace_id RETURNING VALUE(trace_id) TYPE ty_trace_id.

PROTECTED SECTION.
PRIVATE SECTION.

DATA root_span TYPE REF TO zcl_att_span.
DATA trace_id TYPE sysuuid_c32.
DATA trace_id TYPE ty_trace_id.

ENDCLASS.

Expand All @@ -29,4 +34,8 @@ CLASS zcl_att_trace_transaction IMPLEMENTATION.

ENDMETHOD.

METHOD get_trace_id.
trace_id = me->trace_id.
ENDMETHOD.

ENDCLASS.