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

Add Basic OTEL Tracing to TFBuddy #26

Merged
merged 3 commits into from
Aug 16, 2023
Merged

Conversation

mplachter
Copy link
Collaborator

@mplachter mplachter commented May 1, 2023

Add Tracing to TFBuddy

image

Currently waiting on this sl1pm4t/gongs#3 to be merged than I'll update and sign DCO

@mplachter mplachter marked this pull request as ready for review May 1, 2023 20:48
@mplachter mplachter changed the title wip commit for tracing Add Basic OTEL Tracing to TFBuddy May 1, 2023
@mplachter
Copy link
Collaborator Author

@sl1pm4t @davidwin93 if i fix this merge request is this good to merge?

cmd/root.go Outdated
Version: pkg.GitTag,
CommitSHA: pkg.GitCommit,
}
fmt.Printf("enabled: %v\thost: %s\tport: %s\n", enableOtel, otelHost, otelPort)
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of fmt could these use log

@davidwin93
Copy link
Collaborator

If you resolve the merge conflicts I think this would be good to merge. Solid work!

Signed-off-by: Matt Plachter <[email protected]>
Signed-off-by: Matt Plachter <[email protected]>
@@ -39,14 +40,17 @@ func NewGitlabEventWorker(h *GitlabHooksHandler, js nats.JetStreamContext) *Gitl
}

func (w *GitlabEventWorker) processNoteEventStreamMsg(msg *NoteEventMsg) error {
ctx, span := otel.Tracer("hooks").Start(msg.Context, "CheckForMergeConflicts")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is CheckForMergeConflicts correct?

// This is a NoOp on GitHub
return nil
}

func (c *Client) AddMergeRequestDiscussionReply(prID int, fullName, discussionID, comment string) (vcs.MRNote, error) {
func (c *Client) AddMergeRequestDiscussionReply(ctx context.Context, prID int, fullName, discussionID, comment string) (vcs.MRNote, error) {
ctx, span := otel.Tracer("TFC").Start(ctx, "ApplyMergeRequestDiscussionReply")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this meant to be AddMergeRequestDiscussionReply ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah we might have renamed the method good catch

Signed-off-by: Matt Plachter <[email protected]>
@mplachter mplachter merged commit f55683f into main Aug 16, 2023
5 checks passed
@davidwin93 davidwin93 deleted the add-opentelemetry-tracing branch August 16, 2023 18:42
ahinh43 pushed a commit to ahinh43/tfbuddy that referenced this pull request Sep 18, 2023
* add otel tracing to tfbuddy

Signed-off-by: Matt Plachter <[email protected]>

* change over from fmt to log

Signed-off-by: Matt Plachter <[email protected]>

* fix trace names

Signed-off-by: Matt Plachter <[email protected]>

---------

Signed-off-by: Matt Plachter <[email protected]>
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