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