Skip to content

Support span attached event concept#9916

Merged
wu-sheng merged 10 commits intoapache:masterfrom
mrproliu:span-attached-event
Nov 9, 2022
Merged

Support span attached event concept#9916
wu-sheng merged 10 commits intoapache:masterfrom
mrproliu:span-attached-event

Conversation

@mrproliu
Copy link
Contributor

@mrproliu mrproliu commented Nov 7, 2022

Support receiving, storing, and querying the span attached event in tracing.

@mrproliu mrproliu added protocol agent->collector or UI->collector protocols related. enhancement Enhancement on performance or codes labels Nov 7, 2022
@mrproliu mrproliu added this to the 9.3.0 milestone Nov 7, 2022
@mrproliu mrproliu requested a review from wu-sheng November 7, 2022 12:31
private org.apache.skywalking.oap.server.core.query.type.SpanAttachedEvent parseEvent(SpanAttachedEvent event) {
final org.apache.skywalking.oap.server.core.query.type.SpanAttachedEvent result =
new org.apache.skywalking.oap.server.core.query.type.SpanAttachedEvent();
result.getStartTime().setSeconds(event.getStartTime().getSeconds());
Copy link

Choose a reason for hiding this comment

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

NULL_DEREFERENCE: object returned by getStartTime(result) could be null and is dereferenced at line 315.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@Getter
@ScopeDeclaration(id = SPAN_ATTACHED_EVENT, name = "SpanAttachedEvent")
@Stream(name = SpanAttachedEventRecord.INDEX_NAME, scopeId = SPAN_ATTACHED_EVENT, builder = SpanAttachedEventRecord.Builder.class, processor = RecordStreamProcessor.class)
public class SpanAttachedEventRecord extends Record {
Copy link
Member

Choose a reason for hiding this comment

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

Are you going to use 100% sampling? This means sampling all events matching the trace header. If so, consider @SuperDataset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated it as super data set.

log.debug("receive span attached event is streaming");
}

final SpanAttachedEventRecord record = new SpanAttachedEventRecord();
Copy link
Member

Choose a reason for hiding this comment

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

Should we consider HTTP endpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because there is no need now, so ignore it.

@Column(columnName = END_TIME_NANOS)
private int endTimeNanos;
@Column(columnName = TRACE_REF_TYPE)
private int traceRefType;
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a SpanReferenceType type field(not a column` in the Record?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated it as an enum.

}

// find matches span
final int eventSpanId = Integer.parseInt(record.getTraceSpanId());
Copy link
Member

Choose a reason for hiding this comment

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

I think we should check SpanReferenceType first, then do casting. Otherwise, we may face NPE or cast error, if trace ID actually exists on both sides. Such as Lua agent uses UUID as well.

Copy link
Member

Choose a reason for hiding this comment

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

According to this, apache/skywalking-query-protocol#101, we should update the Zipkin query as well. And verify whether we could put this in tags or some places for lens UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. I have filtered the skywalking events in the query and checked the parent span ID is numeric or not.

* Optimize MQ Topology analysis. Use entry span's peer from the consumer side as source service when no producer instrumentation(no cross-process reference).
* Refactor JDBC storage implementations to reuse logics.
* Fix `ClassCastException` in `LoggingConfigWatcher`.
* Support span attached event concept.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Support span attached event concept.
* Support span attached event concept in Zipkin and SkyWalking trace query.
* Support span attached events on Zipkin lens UI.

This doc should be updated as well, https://skywalking.apache.org/docs/main/next/en/setup/backend/zipkin-trace/

Also, we should consider adding a menu here to introduce ebpf besides tracing/logging/metrics.
image

Copy link
Member

Choose a reason for hiding this comment

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

Let's update the docs for profiling in the next PR.

wu-sheng
wu-sheng previously approved these changes Nov 9, 2022
@wu-sheng wu-sheng merged commit 3122697 into apache:master Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement on performance or codes protocol agent->collector or UI->collector protocols related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants