agent icon indicating copy to clipboard operation
agent copied to clipboard

Breaking changes to component.InstanceID

Open mwear opened this issue 7 months ago • 2 comments

There is an in-progress PR to make component.InstanceID immutable in collector core. It is currently a struct with all fields exported. The fields will only be accessible by getter methods going forward. Here are the occurrences of component.InstanceID in this repo: https://github.com/search?q=repo%3Agrafana%2Fagent%20component.InstanceID&type=code.

I believe the only thing that will have to change is:https://github.com/grafana/agent/blob/3eb7f7e314bbd3084770e8ed214ddedf3062bf66/internal/converter/internal/otelcolconvert/utils.go#L14-L16

The change that will need to be made is below:

func StringifyInstanceID(id component.InstanceID) string {
	return fmt.Sprintf("%s/%s", StringifyKind(id.Kind()), id.ComponentID())
}

mwear avatar Jul 17 '24 17:07 mwear