Skip to content

Add ID metadata to gRPC calls, and use it in logs #248

@carlosms

Description

@carlosms

Currently the logs for actions started by a gRPC call initialized by an analyzer do not contain any information to link it to a specific event or PR. Maybe we can include some metadata to the NotifyReviewEvent call and have the analyzers send it back when they call GetChanges.

Context in #245 and #181:

The service/git methods now get the log from the context, but the problem here is that the gRPC requests come from the analyzer, and we don't have the event-id or any other field.
I didn't look much into it, so I don't know if there is a way to pass some ID fields to the analyzer and get them back when they call GetFiles/GetChanges without modifying the proto messages.

Grpc allows to send metadata in header or trailer. There are some helpers in go-grpc-middleware for that.
We can include it in our sdk later to pass event-id to an analyzer and send it back.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions