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 optional Opentracing #111

Closed
wants to merge 2 commits into from
Closed

Add optional Opentracing #111

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 3, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
Add optional opentracing with:

  • set optional opentarcing
  • set traces (span) for reconciler

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #130

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

@ghost ghost changed the title WIP: Opentracing: Add optional Opentracing Oct 3, 2022
@ghost ghost requested a review from outscale-hmi October 3, 2022 08:37
Copy link
Contributor

@outscale-hmi outscale-hmi left a comment

Choose a reason for hiding this comment

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

Good job,

@ghost ghost requested review from outscale-hmi and outscale-mdr October 5, 2022 12:33
@ghost
Copy link
Author

ghost commented Oct 5, 2022

Close

cloud/services/security/securitygroup.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
// Return tracer
func Tracer() trace.Tracer {
return tracer{
Tracer: otel.Tracer("capz"),
Copy link
Contributor

Choose a reason for hiding this comment

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

"capz" ?

controllers/oscmachine_controller.go Outdated Show resolved Hide resolved
if err != nil {
return err
}
fmt.Printf("Begin registering opentelemetry\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Println

cloud/opentracing/traces.go Outdated Show resolved Hide resolved
@@ -7,6 +7,7 @@
- [Troubleshooting](./topics/troubleshooting.md)
- [Cluster-Autoscaler](./topics/cluster-autoscaler.md)
- [How to config](./topics/config.md)
- [How to enable tracing](./topics/tracing.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the doc

Copy link
Author

Choose a reason for hiding this comment

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

Ok i change it

@ghost ghost requested a review from outscale-mdr October 12, 2022 14:08
Copy link
Contributor

@outscale-mdr outscale-mdr left a comment

Choose a reason for hiding this comment

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

Good job.

I'm still thinking that this feature is too early to integrate. Right now, we do not use this tool to diagnostic performance.

Could we stall this PR and wait when we need to optimize ? (CC @jerome-jutteau)

@@ -0,0 +1,10 @@
# Add tracing

You can use jaeger or Zipkin as backend for opentelemetry.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "Jaeger"
  • "OpenTelemetry"

Comment on lines 343 to 339
ctx, _, publicIpDone := tele.StartSpanWithLogger(ctx, "controllers.OscClusterControllers.publicIpReconcile")

publicIpSvc := r.getPublicIpSvc(ctx, *clusterScope)
reconcilePublicIp, err := reconcilePublicIp(ctx, clusterScope, publicIpSvc)
if err != nil {
clusterScope.Error(err, "failed to reconcile publicIp")
conditions.MarkFalse(osccluster, infrastructurev1beta1.PublicIpsReadyCondition, infrastructurev1beta1.PublicIpsFailedReason, clusterv1.ConditionSeverityWarning, err.Error())
publicIpDone()
return reconcilePublicIp, err
}
publicIpDone()
conditions.MarkTrue(osccluster, infrastructurev1beta1.PublicIpsReadyCondition)
Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a step back mae me realize that the suitable place to these functions would be directly in each function (for example in this case at the beginning of the reconcilePublicIp)

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think ?

Copy link
Author

Choose a reason for hiding this comment

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

Maybye keep here so that it is simple to add new ones in the futur ?
What do you think ?

Copy link
Author

Choose a reason for hiding this comment

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

@outscale-mdr Are you ok with the changes ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is easier to put the code for tracing at the beginning of the function rather than in the middle of another

@ghost ghost requested a review from outscale-mdr October 26, 2022 16:35
@ghost
Copy link
Author

ghost commented Nov 3, 2022

To be freeze

@ghost ghost closed this Nov 3, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add opentracing
3 participants