-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify view conflicts #2462
Clarify view conflicts #2462
Conversation
The other thing we discussed in this week's spec meeting was the option for SDK's to fail fast when it is known a view will cause conflicts. There's a section right above that says:
Could some additional more generic wording be added to this like
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-stating my approval.
"applied" means this is saying that measurements should be aggregated for all Views even if they conflict? Assuming that is the meaning, and not that "apply" is referring to "applying configuration" and replacing the previous View in the state of Views, I don't see the purpose/benefit mentioned? But now that I realize it also says a warning is emitted when the View is "applied" it must be that applying refers to updating the state and not applying the View against a measurement (since that would be a lot of warnings)? In that case I'd just suggest using a different word and clarifying if it is a full replacement or a merge. Re-reading and the context is, deciding what to do with a measurement. I think that implies "apply" would mean actually applying the View to the measurement and emitting a warning for every measurement seems excessive -- an additional concern to my other about why we'd want conflicting metrics. |
Ok, now I realize there might even be another case this is meaning to cover, which can't be handled at configuration time -- a no name View with use of wildcards ( I'd argue the spec should define that the Views are kept in the order they are registered and matching is either first or last wins in the case there is a conflict in the resulting name. On slack it sounds like all implementations require up front View creation, but the spec reads as Views are matched to Instruments each time a measurement is taken. I wouldn't have considered this an issue -- since the end result is the same -- but now I think the spec could be written more easily and clearly by defining Instrument and View matching this way as well. |
@tsloughter this PR doesn't introduce the language to "apply the View" or to log a warning if there's a conflict. That language has already been there and I think it's implied that logging doesn't refer to handling each individual measurement.
Yes. Additionally, a view which changes the name might match exactly one instrument, but the view's name might conflict with another instrument which has no matching views. This PR is all about clarifying to ensure that SDKs behave similarly in these types of situations. It resulted from discovering that the dot net and java implementations had different interpretations.
That's roughly the position that's expressed in this comment. |
@jack-berg ok, yea, I see "apply" was already used. But the main change appears to be, "the implementation SHOULD apply the View and emit a warning". Ignoring whether "apply" should be used here or not, I'm still not sure what I should do when implementing this to get consistent results? |
We spoke about this issue at the 4/5 Spec SIG. @jmacd brought up the point that in instruments "MUST create a valid Instrument in every case." Suppose we were to take the position that we should ignore views that produce conflicts, and a view is registered that renames an instrument from The lack of ability to know that a view will produce a conflict, and the requirement that instruments must always create valid instruments that export data suggests that the most correct / consistent behavior is for the SDK to produce all views regardless of whether they produce conflicts. There seemed to be some consensus on this thought at the SIG meeting, and this PR currently reflects that position. |
Jack reached out on slack and explained everything. I get now that this simply means conflicting metrics will be reported and that the user must intervene to resolve this error. +1 to this solution. As was noted, the fact that a conflict could result from instrument being created at runtime that conflicts with the name of a view but Instrument API requires a valid Instrument always be returned makes it really the only viable solution. My only concern is that at least one form of overriding views is useful: Setting up a view that drops everything and a view that doesn't and matches certain instruments only. This would work fine with this PR as is, I just wonder if it could be confusing to give the appearance that view overriding works, when it is not an override at all. May just need some docs by implementations for SDK users. |
…ication into view-conflict
@jack-berg CI is failing, would you look into it? |
…ication into view-conflict
Related to #2443.