Skip to content

[cmd/mdatagen] Support template datatype #12891

Open
@odubajDT

Description

@odubajDT

Component(s)

cmd/mdatagen

Describe the issue you're reporting

In the last days, new semantic conventions for k8s workloads will be established and the trend will continue for other k8s workloads as well.

These newly introduced conventions will be used in components, which are using mdatagen for generating Go code (for example kubeletstatsreceiver), but in the current state, such templating datatype is not supported (supported types here)

My suggestion would be to add template type to the list of supported types and implement the templating function in the way, that it will generate the following code:

func (rb *ResourceBuilder) SetAttrName(key, value string) {
	if rb.config.AttrName.Enabled {
		rb.res.Attributes().PutStr(AttrName+"."+key, val)
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions