Comments (5)
I created the prototype using OpenCensus for inspiration, so that's where this came from, and the initial prototype in this repository was a streaming implementation. These Modify
operations are definitely compatible with a streaming model.
The reader of the stream is responsible for reconstructing Span attributes at each point in the stream. Modify operations are simply applied by the reader to update the attribute state at subsequent points in the stream.
This raises questions, like how is a user to un-set an attribute? How is a user to delete an attribute? How will the OpenCensus libraries handle this transition? @bogdandrutu ^^^ more of a spec question than a Golang question.
from opentelemetry-go.
@jmacd what is the use case for deleting / unsetting an attribute? Such functionality did not exist in OpenTracing, and nobody asked for it, iirc.
from opentelemetry-go.
The tag.Map
code is shared by context tags, which do support deleting entries. Exposing the mutators via ModifyAttribute
was speculative.
I feel that OpenTracing didn't specify this well enough. I imagine we could find uses of Set("error", false)
following Set("error", true)
, made with the intention of unsetting an error attribute. For string-valued attributes, I wouldn't be surprised to see an empty string used to unset an attribute. Why wouldn't the program compute the value it intends and set it once? It doesn't feel too exotic to me: e.g., you call Set("error", true)
on the fly as errors happen, but in a context handler somewhere near the top of your request you decide that canceled requests are never errors, so you unset it in that case.
I don't think this is a big deal, and I'm more than happy to remove ModifyAttribute
from the Span API, as well as Upsert
from the tag.Map
.
from opentelemetry-go.
Hey @jmacd I would like to work on this, I am new to tracing and would like to contribute to
open-telemetry,
So I notice
In span package and
func (sp *span) ModifyAttributes(mutators ...distributedcontext.Mutator) {
sp.sdk.exporter.Record(exporter.Event{
Type: exporter.MODIFY_ATTR,
Scope: sp.ScopeID(),
Mutators: mutators,
})
}
In trace package
// ModifyAttributes does nothing.
func (s *span) ModifyAttributes(mutators ...apidctx.Mutator) {
}
but I don't see any method definition in trace package it's an empty function. I see this in multiple places.
So the scope of this issue is to remove it from all the places?
from opentelemetry-go.
Yes. In the prototype, this pattern of supporting Mutators was carried over from the OpenCensus code base. We'll remove it, which means any Mutator should disappear. All ModifyAttributes
disappear, only SetAttribute
functionality remains in this respect. The MapUpdate
type should have only two fields, supporting an update for multiple Set operations or a single Set operation.
from opentelemetry-go.
Related Issues (20)
- Upgrade all use of go.opentelemetry.io/otel/semconv to use v1.24.0 HOT 2
- EOF errors on traces export HOT 3
- How to observe a dead loop. HOT 6
- Generate v1.24.0 semconv
- baggage: Member.String should escape only the characters that MUST be escaped
- Opentelemetry Document confusion HOT 1
- Prometheus exporter doesn't implement go.opentelemetry.io/otel/sdk/metric.Exporter HOT 2
- bridge/opentracing: propagated baggage item key is canonicalized
- otel/metric: godoc describing differences between Gauge and other metric types HOT 3
- `exporters/otlp/otlptrace/otlptrace{grpc,http}` defaults to localhost insecure port but without insecure option HOT 3
- Allow unit-testing of metric generation HOT 1
- auto instrumentation not working in eks 1.27 HOT 2
- Unclear usage of semconv MessagingSystemKey HOT 5
- Replace ensureAttributesCapacity with slices.Grow HOT 3
- I cannot Get Max/Min Value In Histogram type HOT 2
- Add slog.Handler log bridge HOT 4
- add method (t *tracer).Enable(ctx context)bool HOT 3
- The default endpoint should use HTTP, not HTTPS HOT 6
- Question about correctness of metric.Meter implementation and use HOT 16
- Document use of NewSchemaless vs NewWithAttributes HOT 7
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 opentelemetry-go.