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

OpenTelemetry対応をする #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

OpenTelemetry対応をする #17

wants to merge 4 commits into from

Conversation

ryuichi1208
Copy link

@ryuichi1208 ryuichi1208 commented Mar 18, 2024

OpenTelemetry対応を行います。全部の関数をトレースはせずに画像取得や変換処理の部分にspanを入れていきます。

Copy link

@Drumato Drumato left a comment

Choose a reason for hiding this comment

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

いくつかコメントしたので、そちら確認したうえで現状で良さそうならLGTMです!

convert.go Outdated
func convert(src io.Reader, q int) (*bytes.Buffer, error) {
func convert(ctx context.Context, src io.Reader, q int) (*bytes.Buffer, error) {
var span trace.Span
ctx, span = tracer.Start(ctx, "convert")
Copy link

Choose a reason for hiding this comment

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

https://go.dev/play/p/tmjSLkmiih4
Goはここらへんのシャドウイングをうまくやってくれる(片方が宣言済みで片方が新しくても、 := 演算子を使える)ので、それでもいいかもです!重箱なので無視でもOKです 🙋‍♀️

trace.go Outdated
)
handleErr(err, "failed to create resource")

otelAgentAddr, ok := os.LookupEnv("OTEL_EXPORTER_OTLP_ENDPOINT")
Copy link

Choose a reason for hiding this comment

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

Copy link

@Drumato Drumato Mar 19, 2024

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

なるほど!

Copy link

@Drumato Drumato left a comment

Choose a reason for hiding this comment

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

LGTMです!

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