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 implementation for nodejs agent #1287

Merged
merged 49 commits into from
Jul 1, 2024

Conversation

blumamir
Copy link
Collaborator

No description provided.

@edeNFed
Copy link
Contributor

edeNFed commented Jun 23, 2024

nit: maybe we should put the files in /agents/nodejs instead of /agent-nodejs?
We will probably have a similar OpAMP implementation for Java, NodeJS, Python, so having nested directories will be prettier.

agent-nodejs/package.json Outdated Show resolved Hide resolved
odiglet/Dockerfile Show resolved Hide resolved
opampserver/pkg/server/server.go Outdated Show resolved Hide resolved
opampserver/pkg/server/server.go Outdated Show resolved Hide resolved
opampserver/pkg/deviceid/k8sattributes.go Outdated Show resolved Hide resolved
}
}

func (k *K8sPodInfoResolver) getServiceNameFromAnnotation(ctx context.Context, name string, kind string, namespace string) (string, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these functions should idealy be under k8sutils and not opampserver

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will handle in a followup PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these generated with protoc, if so maybe worth adding in the README how to generate them,
Are we using the proto defined in opAmp, or are we having some custom types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The instructions can be found here: https://github.com/odigos-io/opamp-spec

opampserver/pkg/server/server.go Show resolved Hide resolved
// unfortunately, I did not find a way to get just one device id from the kubelet, we need
// to list and iterate over all the devices to get a current snapshot of allocations on this node
// and then look for the ones we are interested in.
func (c *KubeletClient) DeviceIdsToContainerDetails() (map[string]*ContainerDetails, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This also does not look like it relates specifically to opamp server, maybe worth moving to k8sutils

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I suggest doing it later on

});
}

private async sendHeartBeatToServer() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the heartbeat to keep the connection alive or is it part of OpAMP spec? Maybe we can drop it if we are not doing anything on the heartbeat

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OpAMP server uses it to figure out if the process (or the connection) is down

@blumamir blumamir merged commit be4f2cb into odigos-io:main Jul 1, 2024
12 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.

3 participants