-
Notifications
You must be signed in to change notification settings - Fork 173
[traces] init the trace sdk #1638
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi @Frapschen. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
10dfec1
to
65892cf
Compare
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.
Just a nit for typo in logs to replace MeterProvider
with TracerProvider
and other LGTM. Will let @liu-cong @nirrozenbaum @ahg-g to take another review.
/ok-to-test |
8bf120f
to
bb94492
Compare
The error is:
The |
/retest |
bb94492
to
d6b5ed6
Compare
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.
@JeffLuoo If the telemetry.go looks good to you, can you lgtm on that? I can lgtm on the flag and helm changes.
enabled: false | ||
trace: | ||
enabled: false | ||
otelExporterEndpoint: "http://localhost:4317" |
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.
Do we think it's "rare" for users to configre the endpoint and sampling params? If so, I suggest not including them here, and just let those rare, advanced users to configure via the env var section directly.
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.
@liu-cong Most of the time, users should set a real OTel collector address, so I think it's a very useful setting.
And for sampling, it is also a common setting for tracing configuration.
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.
+1 that the endpoint and the sampling rate are commonly configured fields.
b3d90eb
to
b81d83e
Compare
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
pkg/common/telemetry.go
Outdated
traceExporter, err := initTraceExporter(ctx, logger) | ||
if err != nil { | ||
loggerWrap.Handle(fmt.Errorf("%s: %v", "init trace exporter fail", err)) | ||
return nil |
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.
should this return an error?
/lgtm cancel I have a question on the error return, left a comment |
7cb9b3c
to
81e1af7
Compare
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.
Just a few nits from my side. Other than that it LGTM. @liu-cong please give it another look.
var traceExporter sdktrace.SpanExporter | ||
traceExporter, err := stdouttrace.New(stdouttrace.WithPrettyPrint()) | ||
if err != nil { | ||
return nil, fmt.Errorf("fail to create stdouttrace exporter: %w", err) |
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.
fail -> failed to align with other error messages in the same file.
if exporterType == "otlp" { | ||
traceExporter, err = otlptracegrpc.New(ctx, otlptracegrpc.WithInsecure()) | ||
if err != nil { | ||
return nil, fmt.Errorf("fail to create otlp-grcp exporter: %w", err) |
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.
ditto: use failed
loggerWrap.Handle(fmt.Errorf("%s: %v", "failed to shutdown TraceProvider", err)) | ||
} | ||
|
||
logger.Info("trace provider shutting down") |
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.
Can you also use logging.DEFAULT
for the info message?
|
||
traceExporter, err := initTraceExporter(ctx, logger) | ||
if err != nil { | ||
loggerWrap.Handle(fmt.Errorf("%s: %v", "init trace exporter fail", err)) |
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.
nit: init trace exporter failed
|
||
sampler = sdktrace.ParentBased(sdktrace.TraceIDRatioBased(fraction)) | ||
} else { | ||
loggerWrap.Handle(fmt.Errorf("un supported sampler type: %s, fallback to parentbased_traceidratio with 0.1 Ratio", samplerType)) |
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.
nit: Unsupported without space.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Frapschen, JeffLuoo The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Set up the trace instrument, and update the manifest of inferencepool chart.
This is the initial PR for tracing, which simply sets up a global TracerProvider via an init function. Subsequent tracing-related PRs can then focus solely on adding spans:
Which issue(s) this PR fixes:
issue: #1520
Does this PR introduce a user-facing change?: