Browse Source

Dropping spans which should be sampled (#3485)

Stefan McShane 2 years ago
parent
commit
bae4394426
2 changed files with 3 additions and 3 deletions
  1. 1 1
      internal/helm/agent.go
  2. 2 2
      internal/kubernetes/config.go

+ 1 - 1
internal/helm/agent.go

@@ -111,7 +111,7 @@ func (a *Agent) GetRelease(
 	getDeps bool,
 ) (*release.Release, error) {
 	ctx, span := telemetry.NewSpan(ctx, "helm-get-release")
-	defer span.End()
+	// defer span.End() // This span is one of most frequent spans. We need to sample this. For now, this span will not send
 
 	telemetry.WithAttributes(span,
 		telemetry.AttributeKV{Key: "name", Value: name},

+ 2 - 2
internal/kubernetes/config.go

@@ -108,7 +108,7 @@ func GetAgentOutOfClusterConfig(ctx context.Context, conf *OutOfClusterConfig) (
 // restConfigForCAPICluster gets the kubernetes rest API client for a CAPI cluster
 func restConfigForCAPICluster(ctx context.Context, mgmtClusterConnection porterv1connect.ClusterControlPlaneServiceClient, cluster models.Cluster) (*rest.Config, error) {
 	ctx, span := telemetry.NewSpan(ctx, "rest-config-for-capi-cluster")
-	defer span.End()
+	// defer span.End() // This span is one of most frequent spans. We need to sample this. For now, this span will not send
 
 	kc, err := kubeConfigForCAPICluster(ctx, mgmtClusterConnection, cluster)
 	if err != nil {
@@ -331,7 +331,7 @@ func (conf *OutOfClusterConfig) ToRESTMapper() (meta.RESTMapper, error) {
 // the configuration saved within a Cluster model
 func (conf *OutOfClusterConfig) GetClientConfigFromCluster(ctx context.Context) (clientcmd.ClientConfig, error) {
 	ctx, span := telemetry.NewSpan(ctx, "ooc-get-client-config-from-cluster")
-	defer span.End()
+	// defer span.End() // This span is one of most frequent spans. We need to sample this. For now, this span will not send
 
 	if conf.Cluster == nil {
 		return nil, telemetry.Error(ctx, span, nil, "cluster cannot be nil")