- 
                Notifications
    You must be signed in to change notification settings 
- Fork 554
perf: Tracing observability tool integration #2782
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
Conversation
| 
 | 
| GitGuardian id | Secret | Commit | Filename | |
|---|---|---|---|---|
| 141558 | Generic High Entropy Secret | b8fe162 | scripts/devtron-reference-helm-charts/deployment-chart_1-0-0/env-values.yaml | View secret | 
| 2763127 | Generic High Entropy Secret | b8fe162 | scripts/devtron-reference-helm-charts/deployment-chart_1-0-0/secrets-test-values.yaml | View secret | 
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
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.
- we need to develop convention for TracerName and context name
- is there any way we can decorate all methods with tracer automatically ? does this even makes sense ?
        
          
                App.go
              
                Outdated
          
        
      | tp := otel.Init(serviceName) | ||
| defer func() { | ||
| if err := tp.Shutdown(context.Background()); err != nil { | ||
| log.Printf("Error shutting down tracer provider: %v", 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.
use Logger.Infow/debugw
| } | ||
| if err == nil && len(clusterIds) > 0 { | ||
| // get helm apps which are created using cd_pipelines | ||
| newCtx, span := otel.Tracer("pipelineRepository").Start(ctx, "GetAppAndEnvDetailsForDeploymentAppTypePipeline") | 
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.
this method might be called from diff places Tracer("pipelineRepository").Start(ctx, "GetAppAndEnvDetailsForDeploymentAppTypePipeline") will change accordingly
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.
same for all Tracer impl
        
          
                internal/util/K8sUtil.go
              
                Outdated
          
        
      | } | ||
| } | ||
|  | ||
| func OverrideK8sHttpClient(restConfig *rest.Config) (*http.Client, error) { | 
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.
name me contextually
        
          
                otel/OtelConfig.go
              
                Outdated
          
        
      |  | ||
| // Init configures an OpenTelemetry exporter and trace provider | ||
| func Init(serviceName string) *sdktrace.TracerProvider { | ||
| var collectorURL = "otel-collector.observability: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.
get it from env
        
          
                otel/OtelConfig.go
              
                Outdated
          
        
      | ), | ||
| ) | ||
| if err != nil { | ||
| log.Fatal(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.
return error instead of log.Fatal
| Kudos, SonarCloud Quality Gate passed!     
 
 | 








Description
This PR adds support for Otel Integration for Devtron Service. It will send Trace data to Otel Collector.
Fixes #2874
How Has This Been Tested?
Checklist:
Does this PR introduce a user-facing change?