Giter Site home page Giter Site logo

Comments (5)

jmacd avatar jmacd commented on July 22, 2024

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.

yurishkuro avatar yurishkuro commented on July 22, 2024

@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.

jmacd avatar jmacd commented on July 22, 2024

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.

VineethReddy02 avatar VineethReddy02 commented on July 22, 2024

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.

Screenshot from 2019-10-14 11-49-12

So the scope of this issue is to remove it from all the places?

from opentelemetry-go.

jmacd avatar jmacd commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.