Giter VIP home page Giter VIP logo

Comments (3)

trisch-me avatar trisch-me commented on June 10, 2024 1

Bumping up this issue and add more information.

I propose to add following keywords:


1. includes

This 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 browser.yaml inside models

groups:
  - id: browser
    prefix: browser
    type: resource
    brief: >
        The web browser in which the application represented by the resource is running.
        The `browser.*` attributes MUST be used only for resources that represent applications
        running in a web browser (regardless of whether running on a mobile or desktop device).
    attributes:
      - ref: browser.brands
      - ref: browser.platform
      - ref: browser.mobile
      - ref: browser.language
      - ref: user_agent.original        

using new keyword it will be written as following:

groups:
  - id: browser
    prefix: browser
    type: resource
    includes: [browser] <--- NEW keyword
    brief: >
        The web browser in which the application represented by the resource is running.
        The `browser.*` attributes MUST be used only for resources that represent applications
        running in a web browser (regardless of whether running on a mobile or desktop device).
    attributes:
      - ref: user_agent.original

where in md file we could either unpack namespace into specific fields or just give a link to the registry for the whole namespace:

| [`browser.*`](../attributes-registry/browser.md) | Namespace | Browser namespace | | Opt-In | <---- includes

2. embeds

This 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 geo.* namespace to the client and server to make it possible to attach additional attributes to the both client and server.

groups:
  - id: client
    prefix: client
    type: attribute_group
    brief: >
      These attributes may be used to describe the client in a connection-based network interaction
      .......
    attributes:
      - id: address
        stability: stable
        type: string

using new keyword it will be written as following:

groups:
  - id: client
    prefix: client
    type: attribute_group
    embeds: [geo] <---- **NEW**
    brief: >
      These attributes may be used to describe the client in a connection-based network...
    attributes:
      - id: address
      - .....

which resolves into following construction in the md file:

| [`client.geo.*`](../attributes-registry/geo.md) | Namespace | Geo namespace | | Opt-In | <---- embeds

3. embed

This one will make possible to re-use only specific attributes of the namespace, similar to the ref but with a prefix

Example: we don't want to add the whole namespace to the client but only a few attributes.

groups:
  - id: client
    prefix: client
    type: attribute_group
    brief: >
      These attributes may be used to describe the client in a connection-based network...
    attributes:
      - ref: client.geo.location.lon
      - ...
      - embed: geo.location.lat

which resolves into following construction in the md file:

| [`geo.location.lon`](../attributes-registry/geo.md) | type | Description | | Opt-In | <---- ref
| [`client.geo.location.lat`](../attributes-registry/geo.md) | type | Description | | Opt-In | <---- embed

To summarise we would have following representation of all different types (I have changed real browser example to artificial one for similarity with others):

| [`geo.*`](../attributes-registry/geo.md) | Namespace | Geo namespace | | Opt-In | <---- includes whole namespace
| [`client.geo.*`](../attributes-registry/geo.md) | Namespace | Geo namespace | | Opt-In | <---- embeds whole namespace under client
| [`geo.location.lon`](../attributes-registry/geo.md) | type | Description | | Opt-In | <---- referenced attribute
| [`client.geo.location.lat`](../attributes-registry/geo.md) | type | Description | | Opt-In | <---- embedded attribute under client

Please let me know what do you think about this idea, I would like to start to work on it soon.

from build-tools.

AlexanderWert avatar AlexanderWert commented on June 10, 2024

@open-telemetry/specs-semconv-approvers @open-telemetry/specs-semconv-maintainers would love your thoughts on the above!

from build-tools.

ChrsMark avatar ChrsMark commented on June 10, 2024

Most probably embed_namespaces is more handy because it would save us time from having to embed all of the attributes one by one. However I would like to have support for both so as to have the flexibility to embed only specific attributes if needed.

I cannot think of any particular pitfall here (maybe others can spot sth) but in general I like this proposal +1.

from build-tools.

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.