Comments (2)
Would you be able to provide some code and the current outcome, along with the expected outcome?
from specification.
The code in question is a bit too lengthy and complicated to post here. Consider simple parent-child pair with callback being called inside the child:
class Parent {
Child child = new Child();
Parent() {
// subscribe to events in child
}
}
class Child {
void someCallback() {
Span span = GlobalTracer.get().buildSpan("Child.someCallback").start();
try (Scope scope = GlobalTracer.get().activateSpan(span)) {
// possibly propagate the event to parent via some listener
}
}
}
If the child callback doesn't propagate the event to parent, information about the parent will be completely omitted from the trace.
As a workaround, I have a helper class OwnerTrace
that is used like this:
class Parent {
Child child = OwnerTrace.of(new Child())
.parent(this)
.tag("key1", "value")
.target();
Parent() {
OwnerTrace.of(this).tag("key2", "value");
// subscribe to events in child
}
}
class Child {
Child() {
OwnerTrace.of(this).tag("key3", "value");
}
void someCallback() {
Span span = GlobalTracer.get().buildSpan("Child.someCallback").start();
OwnerTrace.of(this).fill(span); // fills in key1, key2, key3
try (Scope scope = GlobalTracer.get().activateSpan(span)) {
// possibly propagate the event to parent via some listener
}
}
}
The key point is that OwnerTrace.parent()
creates ownership hierarchy and OwnerTrace.fill()
pulls tags from all ancestors.
There are many issues with this solution. The most basic one is that this is effectively a non-standard extension to opentracing that is not supported by anything and limits code sharing.
The above example is trivial and as such allows for many workarounds, but in practice I get ownership chains that are 5 levels deep, spanning several internal libraries, and child objects usually don't know anything about their current parent.
from specification.
Related Issues (20)
- Typed support for semantic conventions
- Add structured message support to Semantic Conventions HOT 17
- Inject tracid and spanid HOT 5
- Finish time of child Span (ChildOf reference) HOT 4
- Proposal: Add more semantics for message HOT 1
- Trace time message spent in Kafka HOT 5
- Mark the specification as obsolete since the effort moved to OpenTelemetry HOT 1
- Add discrete events HOT 1
- Script to generate a PDF doc from Markdown HOT 1
- How to meet criteria of log structured timestamp? HOT 1
- Tracing TCP HOT 3
- The Carrier Formats are not in sync
- How to add baggage items to Mongo DB operations using jaeger-cloud-starter in java HOT 2
- Opentracing information in a message HOT 2
- windows HOT 1
- Clarify if null values are considered valid tag values? HOT 1
- me HOT 2
- Invalid link to data_conventions.md HOT 1
- 🛑 Deprecating OpenTracing HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from specification.