-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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") |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ明示的にやらなくても、ライブラリ内部でうまーくやってくれます!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMです!
OpenTelemetry対応を行います。全部の関数をトレースはせずに画像取得や変換処理の部分にspanを入れていきます。