@@ -56,12 +56,12 @@ type opampAgent struct {
5656 cfg * Config
5757 logger * zap.Logger
5858
59- agentType string
60- agentVersion string
61- agentInstanceID string
62- resourceAttrs map [string ]string
59+ serviceName string
60+ serviceVersion string
61+ serviceInstanceID string
62+ resourceAttrs map [string ]string
6363
64- instanceID uuid.UUID
64+ instanceUID uuid.UUID
6565
6666 eclk sync.RWMutex
6767 effectiveConfig * confmap.Conf
@@ -134,7 +134,7 @@ func (o *opampAgent) Start(ctx context.Context, host component.Host) error {
134134 HeaderFunc : headerFunc ,
135135 TLSConfig : tls ,
136136 OpAMPServerURL : o .cfg .Server .GetEndpoint (),
137- InstanceUid : types .InstanceUid (o .instanceID ),
137+ InstanceUid : types .InstanceUid (o .instanceUID ),
138138 Callbacks : types.Callbacks {
139139 OnConnect : func (_ context.Context ) {
140140 o .logger .Debug ("Connected to the OpAMP server" )
@@ -283,24 +283,24 @@ func (o *opampAgent) updateEffectiveConfig(conf *confmap.Conf) {
283283}
284284
285285func newOpampAgent (cfg * Config , set extension.Settings ) (* opampAgent , error ) {
286- agentType := set .BuildInfo .Command
286+ serviceName := set .BuildInfo .Command
287287
288288 sn , ok := set .Resource .Attributes ().Get (string (conventions .ServiceNameKey ))
289289 if ok {
290- agentType = sn .AsString ()
290+ serviceName = sn .AsString ()
291291 }
292292
293- agentVersion := set .BuildInfo .Version
293+ serviceVersion := set .BuildInfo .Version
294294
295295 sv , ok := set .Resource .Attributes ().Get (string (conventions .ServiceVersionKey ))
296296 if ok {
297- agentVersion = sv .AsString ()
297+ serviceVersion = sv .AsString ()
298298 }
299299
300- agentInstanceID := ""
300+ serviceInstanceID := ""
301301
302302 if sid , ok := set .Resource .Attributes ().Get (string (conventions .ServiceInstanceIDKey )); ok {
303- agentInstanceID = sid .Str ()
303+ serviceInstanceID = sid .Str ()
304304 }
305305
306306 var uid uuid.UUID
@@ -328,10 +328,10 @@ func newOpampAgent(cfg *Config, set extension.Settings) (*opampAgent, error) {
328328 agent := & opampAgent {
329329 cfg : cfg ,
330330 logger : set .Logger ,
331- agentType : agentType ,
332- agentVersion : agentVersion ,
333- agentInstanceID : agentInstanceID ,
334- instanceID : uid ,
331+ serviceName : serviceName ,
332+ serviceVersion : serviceVersion ,
333+ serviceInstanceID : serviceInstanceID ,
334+ instanceUID : uid ,
335335 capabilities : cfg .Capabilities ,
336336 opampClient : opampClient ,
337337 resourceAttrs : resourceAttrs ,
@@ -381,9 +381,9 @@ func (o *opampAgent) createAgentDescription() error {
381381 description := getOSDescription (o .logger )
382382
383383 ident := []* protobufs.KeyValue {
384- stringKeyValue (string (conventions .ServiceInstanceIDKey ), o .agentInstanceID ),
385- stringKeyValue (string (conventions .ServiceNameKey ), o .agentType ),
386- stringKeyValue (string (conventions .ServiceVersionKey ), o .agentVersion ),
384+ stringKeyValue (string (conventions .ServiceInstanceIDKey ), o .serviceInstanceID ),
385+ stringKeyValue (string (conventions .ServiceNameKey ), o .serviceName ),
386+ stringKeyValue (string (conventions .ServiceVersionKey ), o .serviceVersion ),
387387 }
388388
389389 // Initially construct using a map to properly deduplicate any keys that
@@ -425,9 +425,9 @@ func (o *opampAgent) createAgentDescription() error {
425425
426426func (o * opampAgent ) updateAgentIdentity (instanceID uuid.UUID ) {
427427 o .logger .Debug ("OpAMP agent identity is being changed" ,
428- zap .String ("old_id" , o .instanceID .String ()),
428+ zap .String ("old_id" , o .instanceUID .String ()),
429429 zap .String ("new_id" , instanceID .String ()))
430- o .instanceID = instanceID
430+ o .instanceUID = instanceID
431431}
432432
433433func (o * opampAgent ) composeEffectiveConfig () * protobufs.EffectiveConfig {
0 commit comments