Skip to content

Commit dd9ca83

Browse files
committed
remove newly added telemetry events
we will split this part of the pr into its own pr a telemetry event was added back which was previously removed undo this pr to add those telemetry statements back
1 parent 519c293 commit dd9ca83

File tree

8 files changed

+3
-18
lines changed

8 files changed

+3
-18
lines changed

cni/network/invoker_cns.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro
142142
}
143143
}
144144

145-
telemetry.SendEvent(fmt.Sprintf("Received from cns: %+v", response.PodIPInfo))
146-
147145
addResult := IPAMAddResult{interfaceInfo: make(map[string]network.InterfaceInfo)}
148146
numInterfacesWithDefaultRoutes := 0
149147

cni/network/multitenancy.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ func (m *Multitenancy) getNetworkContainersInternal(
267267
}
268268

269269
logger.Info("Network config received from cns", zap.Any("nconfig", ncConfigs))
270-
telemetry.SendEvent(fmt.Sprintf("Network config received from cns: %+v", ncConfigs))
271270

272271
subnetPrefixes := []net.IPNet{}
273272
for i := 0; i < len(ncConfigs); i++ {

cni/network/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
11201120
for _, epInfo := range epInfos {
11211121
logger.Info("Deleting endpoint",
11221122
zap.String("endpointID", epInfo.EndpointID))
1123+
telemetry.SendEvent("Deleting endpoint: " + epInfo.EndpointID)
11231124

11241125
if !nwCfg.MultiTenancy && (epInfo.NICType == cns.InfraNIC || epInfo.NICType == "") {
11251126
// Delegated/secondary nic ips are statically allocated so we don't need to release
@@ -1135,7 +1136,6 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
11351136
} else if epInfo.EnableInfraVnet { // remove in future PR
11361137
nwCfg.IPAM.Subnet = nwInfo.Subnets[0].Prefix.String()
11371138
nwCfg.IPAM.Address = epInfo.InfraVnetIP.IP.String()
1138-
telemetry.SendEvent(fmt.Sprintf("Deleting infra vnet endpoint: container id: %s endpoint id: %s subnet: %s address: %s", args.ContainerID, epInfo.EndpointID, nwCfg.IPAM.Subnet, nwCfg.IPAM.Address))
11391139
err = plugin.ipamInvoker.Delete(nil, nwCfg, args, nwInfo.Options)
11401140
if err != nil {
11411141
return plugin.RetriableError(fmt.Errorf("failed to release address: %w", err))

network/endpoint.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"strings"
1111

1212
"github.com/Azure/azure-container-networking/cni/log"
13-
telemetryclient "github.com/Azure/azure-container-networking/cni/telemetry/client"
1413
"github.com/Azure/azure-container-networking/cns"
1514
"github.com/Azure/azure-container-networking/netio"
1615
"github.com/Azure/azure-container-networking/netlink"
@@ -24,10 +23,7 @@ const (
2423
InfraVnet = 0
2524
)
2625

27-
var (
28-
logger = log.CNILogger.With(zap.String("component", "net"))
29-
telemetry = telemetryclient.Telemetry
30-
)
26+
var logger = log.CNILogger.With(zap.String("component", "net"))
3127

3228
type AzureHNSEndpoint struct{}
3329

network/endpoint_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ func (nw *network) newEndpointImplHnsV2(cli apipaClient, epInfo *EndpointInfo) (
429429

430430
// Create the HCN endpoint.
431431
logger.Info("Creating hcn endpoint", zap.Any("hcnEndpoint", hcnEndpoint), zap.String("computenetwork", hcnEndpoint.HostComputeNetwork))
432-
telemetry.SendEvent(fmt.Sprintf("Creating HCN endpoint: %+v", hcnEndpoint))
433432
hnsResponse, err := Hnsv2.CreateEndpoint(hcnEndpoint)
434433
if err != nil {
435434
return nil, fmt.Errorf("Failed to create endpoint: %s due to error: %v", hcnEndpoint.Name, err)
@@ -580,7 +579,6 @@ func (nw *network) deleteEndpointImplHnsV2(ep *endpoint) error {
580579
}
581580

582581
logger.Info("Deleting hcn endpoint with id", zap.String("HnsId", ep.HnsId))
583-
telemetry.SendEvent("Deleting HCN endpoint: " + ep.HnsId)
584582

585583
hcnEndpoint, err = Hnsv2.GetEndpointByID(ep.HnsId)
586584
if err != nil {

network/manager.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package network
55

66
import (
77
"context"
8-
"fmt"
98
"net"
109
"sync"
1110
"time"
@@ -431,7 +430,7 @@ func (nm *networkManager) UpdateEndpointState(eps []*endpoint) error {
431430
}
432431
// we assume all endpoints have the same container id
433432
cnsEndpointID := eps[0].ContainerID
434-
telemetry.SendEvent(fmt.Sprintf("Stateless CNI update endpoint state for %s with: %+v ", cnsEndpointID, ifNameToIPInfoCopy))
433+
435434
if err := validateUpdateEndpointState(cnsEndpointID, ifnameToIPInfoMap); err != nil {
436435
return errors.Wrap(err, "failed to validate update endpoint state that will be sent to cns")
437436
}

network/network_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ func (nm *networkManager) newNetworkImplHnsV2(nwInfo *EndpointInfo, extIf *exter
378378
// if network not found, create the HNS network.
379379
if errors.As(err, &hcn.NetworkNotFoundError{}) {
380380
logger.Info("Creating hcn network", zap.Any("hcnNetwork", hcnNetwork))
381-
telemetry.SendEvent(fmt.Sprintf("Creating HCN network: %+v", hcnNetwork))
382381
hnsResponse, err = Hnsv2.CreateNetwork(hcnNetwork)
383382
if err != nil {
384383
return nil, fmt.Errorf("Failed to create hcn network: %s due to error: %v", hcnNetwork.Name, err)
@@ -476,7 +475,6 @@ func (nm *networkManager) deleteNetworkImplHnsV2(nw *network) error {
476475
var hcnNetwork *hcn.HostComputeNetwork
477476
var err error
478477
logger.Info("Deleting hcn network with id", zap.String("id", nw.HnsId))
479-
telemetry.SendEvent("Deleting HCN network: " + nw.HnsId)
480478

481479
if hcnNetwork, err = Hnsv2.GetNetworkByID(nw.HnsId); err != nil {
482480
return fmt.Errorf("Failed to get hcn network with id: %s due to err: %v", nw.HnsId, err)

network/transparent_vlan_endpointclient_linux.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ func (client *TransparentVlanEndpointClient) ensureCleanPopulateVM() error {
144144
if vlanIfErr != nil {
145145
// Assume any error is the vlan interface not found
146146
logger.Info("vlan interface doesn't exist even though network namespace exists, deleting network namespace...", zap.String("message", vlanIfErr.Error()))
147-
telemetry.SendEvent(fmt.Sprintf("vlan interface %s doesn't exist even though network namespace exists, deleting", client.vlanIfName))
148147
delErr := client.netnsClient.DeleteNamed(client.vnetNSName)
149148
if delErr != nil {
150149
return errors.Wrap(delErr, "failed to cleanup/delete ns after noticing vlan veth does not exist")
@@ -156,7 +155,6 @@ func (client *TransparentVlanEndpointClient) ensureCleanPopulateVM() error {
156155
if vlanIfInVMErr == nil {
157156
// The vlan interface exists in the VM ns because it failed to move into the network ns previously and needs to be cleaned up
158157
logger.Info("vlan interface exists on the VM namespace, deleting", zap.String("vlanIfName", client.vlanIfName))
159-
telemetry.SendEvent(fmt.Sprintf("vlan interface %s exists on the VM namespace, deleting", client.vlanIfName))
160158
if delErr := client.netlink.DeleteLink(client.vlanIfName); delErr != nil {
161159
return errors.Wrap(delErr, "failed to clean up vlan interface")
162160
}
@@ -302,7 +300,6 @@ func (client *TransparentVlanEndpointClient) PopulateVM(epInfo *EndpointInfo) er
302300
return errors.Wrap(deleteNSIfNotNilErr, "failed to move or detect vlan veth inside vnet namespace")
303301
}
304302
logger.Info("Moving vlan veth into namespace confirmed")
305-
telemetry.SendEvent(fmt.Sprintf("Moving vlan veth %s into namespace %s (id: %d) confirmed", client.vlanIfName, client.vnetNSName, client.vnetNSFileDescriptor))
306303
} else {
307304
logger.Info("Existing NS detected. vlan interface should exist or namespace would've been deleted.", zap.String("vnetNSName", client.vnetNSName), zap.String("vlanIfName", client.vlanIfName))
308305
}

0 commit comments

Comments
 (0)