-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add embed
concept for attributes reuse (in addition to ref
)
#240
Comments
@open-telemetry/specs-semconv-approvers @open-telemetry/specs-semconv-maintainers would love your thoughts on the above! |
Most probably I cannot think of any particular pitfall here (maybe others can spot sth) but in general I like this proposal +1. |
Bumping up this issue and add more information. I propose to add following keywords: 1. includesThis one will make the whole namespace re-usable and adds it to the current group on the same level - without adding a prefix to the group. It should allow to add multiple namespaces Example: in the current schema we do have
using new keyword it will be written as following:
where in md file we could either unpack namespace into specific fields or just give a link to the registry for the whole namespace:
2. embedsThis one will make the whole namespace re-usable and adds it to the current group UNDER the group using its prefix. It should allow to add multiple namespaces Example: we would like to add whole
using new keyword it will be written as following:
which resolves into following construction in the md file:
3. embedThis one will make possible to re-use only specific attributes of the namespace, similar to the Example: we don't want to add the whole namespace to the client but only a few attributes.
which resolves into following construction in the md file:
To summarise we would have following representation of all different types (I have changed real browser example to artificial one for similarity with others):
Please let me know what do you think about this idea, I would like to start to work on it soon. |
A new proposal for embedded namespaces. In most cases we do have the same name resolution as namespace, i.e. I propose following concept:
is resolved to
2a. We introduce a new type for id declaration, i.e. in addition to string, enum, etc we will add a namespace
2b. We introduce a new keyword for attributes
@lquerel I think from the implementation POW the second option 2b looks better, WDYT? |
Option 2b is cleaner than 2a in my opinion. 2a is very misleading as indicates that it's a single attribute but actually is resolved to a sub-namespace of multiple attributes. How about the original proposal with a small extension to make the above-mentioned scenario work?.
That would avoid the confusion that we would define an entire structure of attributes in the |
that makes sense @AlexanderWert, I like the clear splitting between usual attributes and namespaces |
Another thing we have discussed today is that due to similarity in
Those will be resolved into
Do you have any comments for this approach? |
This issue describes a concrete proposal on how to realise attributes reuse through yaml syntax and tooling.
Related issues / PRs:
Proposal
I'm proposing to introduce a new, additional type of attribute reference called
embed
(alternatively:nest
) in the syntax that would behave similarly toref
property BUT with the following difference: Whenembed
is used the referenced attribute will be nested under thenamespace
of the attribute group in which the attribute is being referenced.Example
See the following example that illustrates the idea and the difference to
ref
:We would define geo attributes in a
geo.yaml
file:In client and server files we would
embed
the attributes.! Note: Here I consciously
embed
thegeo.location.lon
attribute BUTref
thegeo.location.lat
attribute to demonstrate the difference:When rendering (or code generating) the above it will result in the following attributes:
client.geo.location.lon
geo.location.lat
Note the difference that
geo.location.lon
is now nested under theclient
namespace because it was embedded (embed
) whilegeo.location.lat
keeps it's original full name because it was referenced (ref
).Extended proposal
We could even think about an
embed_namespaces
property on theattribute_group
level to simplify embeddings of entire namespaces into other namespace. For example forgeo
we could do something like the following to embed ALL of thegeo.*
fields into the client:The text was updated successfully, but these errors were encountered: