ApplicationTraceMetadata is created twice

Description

When instrumenting a projects constructorExecution and operationExecution at the same time, two ApplicationTraceMetadata are created.

This can be reproduced using the example project for integration testing: https://github.com/DaGeRe/kieker/tree/Kieker-1817/kieker-monitoring/test-resources/example-projects-aspectj/example-beforeafterconstructorevent

The aop.xml contains

<aspectj>
<weaver options="">
<include within="net.example.Instrumentable"/>
</weaver>
<aspects>
<aspect name="kieker.monitoring.probe.aspectj.flow.constructorExecution.FullInstrumentation"/>
<aspect name="kieker.monitoring.probe.aspectj.flow.operationExecution.FullInstrumentation"/>
</aspects>
</aspectj>

and after runing `gradle test --tests TestSimpleOperationExecution`, the result looks like this:

$0;1614204650459556213;1.15-SNAPSHOT;KIEKER-SINGLETON;reichelt-desktop;1;false;0;NANOSECONDS;0
$1;1614204650464042763;-3049439557687705600;13;<no-session-id>;reichelt-desktop;-3049439557687705600;-1;
$2;1614204650465465427;1614204650465448947;-3049439557687705600;0;public net.example.Instrumentable.<init>();net.example.Instrumentable
$3;1614204650465999421;1614204650465989151;-3049439557687705600;1;public net.example.Instrumentable.<init>();net.example.Instrumentable
$1;1614204650466234868;-3049439557687705599;13;<no-session-id>;reichelt-desktop;-3049439557687705599;-1;
$4;1614204650466263318;1614204650466257748;-3049439557687705599;0;public void net.example.Instrumentable.callee();net.example.Instrumentable
$4;1614204650466313507;1614204650466311277;-3049439557687705599;1;public void net.example.Instrumentable.callee2(java.lang.String);net.example.Instrumentable
$5;1614204650466327887;1614204650466324507;-3049439557687705599;2;public void net.example.Instrumentable.callee2(java.lang.String);net.example.Instrumentable
$5;1614204650466334577;1614204650466332757;-3049439557687705599;3;public void net.example.Instrumentable.callee();net.example.Instrumentable

with the following mapping:

$0=kieker.common.record.misc.KiekerMetadataRecord
$1=kieker.common.record.flow.trace.ApplicationTraceMetadata
$2=kieker.common.record.flow.trace.operation.constructor.BeforeConstructorEvent
$3=kieker.common.record.flow.trace.operation.constructor.AfterConstructorEvent
$4=kieker.common.record.flow.trace.operation.BeforeOperationEvent
$5=kieker.common.record.flow.trace.operation.AfterOperationEvent

which indicates that ApplicationTraceMetadata is created twice.

Assignee

Reiner Jung

Reporter

David Georg Reichelt

Labels

None

External issue ID

None

Components

Affects versions

Priority

Medium