Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: opamp persist health message #1398

Merged
merged 14 commits into from
Jul 30, 2024

Conversation

blumamir
Copy link
Collaborator

No description provided.

Copy link


// AgentHealthStatusUnsupportedRuntimeVersion represents that the agent is running on an unsupported runtime version
// For example: Otel sdk supports node.js >= 14 and workload is running with node.js 12
AgentHealthStatusUnsupportedRuntimeVersion = "UnsupportedRuntimeVersion"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why in some of the cases you mention that it is AgentHealthStatus (which is string) and sometimes set it explicitly to a string?

return c
})
}
type fnOpt func(odigosv1.InstrumentationInstanceStatus) odigosv1.InstrumentationInstanceStatus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this fnOpt means?
I need you to elaborate me about updateInstrumentationInstanceStatus proc in general

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to updateInstrumentationInstanceStatusOpt

}

return nil
}

func (c *ConnectionHandlers) PersistInstrumentationDeviceStatus(ctx context.Context, message *protobufs.AgentToServer, connectionInfo *connection.ConnectionInfo) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually this function update the instrumentation instance right?
WDYT about calling it UpdateInstrumentationInstanceStatus?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, renamed the function 👍

dynamicOptions = append(dynamicOptions, instrumentation_instance.WithAttributes(identifyingAttributes, []odigosv1.Attribute{}))
}

isAgentDisconnect := message.AgentDisconnect != nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better to check at the beginning of this func?
so it will return errors before creating the dynamicOptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to the top 👍

@tamirdavid1 tamirdavid1 self-requested a review July 30, 2024 09:40
@blumamir blumamir merged commit 5be18e0 into odigos-io:main Jul 30, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants