Skip to content

NoTelemetry flag doesn't stop telemetry #1652

@noot

Description

@noot

Describe the bug

  • the --no-telemetry flag doesn't stop telemetry
  • the only place the NoTelemetry flag is checked is dot/node.go
	if cfg.Global.NoTelemetry {
		return node, nil
	}

this prevents telemetry.GetInstance() from being called in dot/node.go. however in packages that use telemetry, NoTelemetry is not persisted and they end up calling telemetry.GetInstance() thus creating the telemetry instance, for example dot/network/service.go publishNetworkTelemetry.

Possible Solution

  • I would recommend adding the NoTelemetry option to the telemetry package and creating a Instance interface that includes the functions the current *telemetry.Handler has. If NoTelemetry == true, then a *NoopHandler, which does nothing, can be created when GetInstance() is called. otherwise, the usual *Handler can be used.

To Reproduce

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions