Skip to content

Attribute Group usage v2 aka Bundles #857

@thompson-tomo

Description

@thompson-tomo

Current Scenario

When we are defining semantic conventions, all attributes must be a member of an attribute group. This attribute group can either reference pre-existing attributes, create new attributes or even extend existing groups.

Example of current solution

Defining signals

  • span.db.client
  • trace.db.common.full
  • trace.db.common.query_and_collection
  • attributes.db.client.with_query_and_collection
  • attributes.db.client.with_query
  • attributes.db.client.minimal

Each level can add/update the attributes, hence resulting in difficult to mantain defintiions especially if you don't want an attribute provided by a lower group ie attributes.db.client.with_query which then fractures the definition resulting in many more groups

Defining log attributes

Another use case is defining a bundle of attributes which can be added to other signals ie Cloud Events which is what we currently do.

Proposed Solutions

Introduce Attribute Bundles

Attribute bundles are a way in which to group attributes together so that they can be reused.

bundle:
  - name: cloudevents
     brief: Adds cloud event details to logs, traces &/or events
     note:
     attributes
       - ref: xyz

The difference to current attribute groups is the removal of the extends functionality but replacement available via new soution.

Usage of bundles

span:
  - name: example.span.client
     brief: Adds cloud event details to logs, traces &/or events
     note:
     attributes
       - ref: xyz
     uses:
      - server
      - cloudevents
          conditional:
            brief: Only applies when using cloud events

By specifiying the bundle as being conditional these attributes are only applicable based on the conditions. In effect this becomes a replacement for the conditionally required requirement but is out of scope of this issue.

Advantages

With this new solution we can define bundles for items such as Cloud Events, Servers and add this to the applicable signals. This way if the bundle is extended at a later point only the bundle needs to be updated and all the cases benefit.

Additional Context

Without the grouping v2 will be a regression of functionality and resulting in an increased maintaince effort due to the duplication/repeatition of atttributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    modelModifies the model for signals and attributes used by Weaver.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions