Skip to content

feat: add opentelemetry tracer to record the sync trace #697

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

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

Conversation

yafeiaa
Copy link

@yafeiaa yafeiaa commented Mar 10, 2025

PR Description

Purpose

This submission aims to integrate OpenTelemetry tracing functionality into the GitOps engine's synchronization process, enhancing the observability and debugging capabilities of synchronization operations.

Major Changes

  • Modified Tracer Interface: Updated the Tracer and Span interfaces to support tracing operations.
  • Implemented OpenTelemetryTracer: Integrated OpenTelemetry to support starting spans from parent trace contexts and recording tracing information for synchronization tasks.
  • Modified syncContext: Updated the syncContext structure to include tracing-related fields and created spans during the execution of create tasks, hook tasks, and prune tasks to record the duration of each task execution in Kubernetes.

Impact

These changes will enhance the observability of the GitOps engine when handling synchronization tasks, making it easier for developers to perform performance analysis and troubleshoot issues.

This functionality has been thoroughly validated in our company's internal fork of the ArgoCD and GitOps engine projects. It helps us analyze the synchronization process in depth, improving synchronization speed and allowing all collaborators in our team to better understand the order in which ArgoCD applies resources to Kubernetes. This improvement not only enhances our observability but also fosters collaboration and communication within the team.

Effect Diagram

Below is an effect diagram showcasing the tracing information of synchronization tasks as used within our company:

企业微信截图_f1fec5de-232f-416d-a027-59d6ec9ad505 企业微信截图_5a0d92fc-2354-415b-a82e-5a8d6a83c76a

If this commit can be merged, I will submit the corresponding changes to the argoproj/argo-cd project to enable this functionality in ArgoCD. Of course, I am more than willing to provide further explanations regarding the necessity of this feature if needed.

@yafeiaa yafeiaa requested a review from a team as a code owner March 10, 2025 07:37
@yafeiaa yafeiaa closed this Mar 10, 2025
@yafeiaa yafeiaa reopened this Mar 10, 2025
yafeiaa added 2 commits March 10, 2025 15:47
Signed-off-by: yafeiaa <[email protected]>
Signed-off-by: yafeiaa <[email protected]>
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 36.23188% with 44 lines in your changes missing coverage. Please review.

Project coverage is 53.24%. Comparing base (8849c3f) to head (691acf8).
Report is 33 commits behind head on master.

Files with missing lines Patch % Lines
pkg/utils/tracing/opentelemetry.go 0.00% 26 Missing ⚠️
pkg/utils/tracing/logging.go 0.00% 6 Missing ⚠️
pkg/utils/tracing/nop.go 0.00% 6 Missing ⚠️
pkg/sync/sync_context.go 83.33% 5 Missing ⚠️
pkg/engine/engine.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #697      +/-   ##
==========================================
- Coverage   54.26%   53.24%   -1.03%     
==========================================
  Files          64       65       +1     
  Lines        6164     6485     +321     
==========================================
+ Hits         3345     3453     +108     
- Misses       2549     2756     +207     
- Partials      270      276       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yafeiaa yafeiaa changed the title feat: add opentelemetry trace to record the sync trace feat: add opentelemetry tracer to record the sync trace Mar 10, 2025
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.

1 participant