Skip to content

Add opentelemetry tracing instrumentation #1125

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sallyom
Copy link

@sallyom sallyom commented Jul 9, 2025

No description provided.

Copy link

netlify bot commented Jul 9, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit d4c238b
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/686dcd110bd0350008b850aa
😎 Deploy Preview https://deploy-preview-1125--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 9, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sallyom
Once this PR has been reviewed and has the lgtm label, please assign danehans for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from danehans and liu-cong July 9, 2025 01:59
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 9, 2025
@sallyom sallyom marked this pull request as draft July 9, 2025 02:00
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 10, 2025
res, err := resource.New(ctx,
resource.WithAttributes(
semconv.ServiceNameKey.String(config.ServiceName),
semconv.ServiceVersionKey.String("1.0.0"),
Copy link

Choose a reason for hiding this comment

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

Does it make sense to use debug/buildinfo here?

Comment on lines +150 to +155

func StartGatewaySpan(ctx context.Context, operation string) (context.Context, trace.Span) {
ctx, span := StartSpan(ctx, operation, operation)
// TODO: Add common gateway attributes here
return ctx, span
}
Copy link

Choose a reason for hiding this comment

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

Maybe we want to replace them with something like:

func SetGatewayAttributes(span trace.Span, gateway Gateway) {
	if gateway == nil {
		return
	}

	span.SetAttributes(
		AttrGatewaySomething.String(gateway.Something()),
	)
}

Allowing a user to set attributes without the need to know the specific Keys?

conn, err := grpc.DialContext(ctx, config.ExporterEndpoint,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithBlock(),
grpc.WithTimeout(5*time.Second),
Copy link

Choose a reason for hiding this comment

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

Does this need to be configurable?

}

if samplingRate := os.Getenv(envOTELSamplingRate); samplingRate != "" {
if rate, err := strconv.ParseFloat(samplingRate, 64); err == nil {
Copy link

Choose a reason for hiding this comment

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

Does it make sense to inform the user e.g. by failing during the creation whenever a value is not recognized?

@nirrozenbaum
Copy link
Contributor

hi @sallyom, this draft PR seems out of sync.
can you please share - what are the plans for this PR? are you planning on rebasing and solving conflicts? other directions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants