Skip to content

feat: Conditionally emit metrics based on enablement#19903

Merged
alexanderbez merged 17 commits into
mainfrom
lucas/telemetry_emit_enablement
Apr 11, 2024
Merged

feat: Conditionally emit metrics based on enablement#19903
alexanderbez merged 17 commits into
mainfrom
lucas/telemetry_emit_enablement

Conversation

@lucaslopezf

@lucaslopezf lucaslopezf commented Mar 29, 2024

Copy link
Copy Markdown
Contributor

Description

Closes: #10245

  • Introduction of Now Function: A new function called Now has been added to the telemetry package. This function returns the current system time if telemetry is enabled, or a zero time if telemetry is not enabled.
  • Atomic Global Variable: We introduced an atomic global variable to manage the state of telemetry's enablement.
  • Conditional Telemetry Emission: All telemetry functions have been updated to include a check that determines whether telemetry is enabled. If telemetry is disabled, these functions return early, avoiding unnecessary operations and overhead.

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced a new Now function in the telemetry module to conditionally emit metrics, enhancing performance by reducing unnecessary operations.
    • Implemented thread-safe management of telemetry's enablement state using a global variable.
    • Adjusted telemetry measurement timing across various modules (BaseApp, circuit, crisis, distribution, evidence, gov, mint, slashing, staking, upgrade) for more accurate tracking of query processing and module execution times.
  • Refactor

    • Replaced usage of the time package with the custom telemetry package for time-related operations in several modules, ensuring consistent and accurate performance metrics.
  • Tests

    • Added a test suite TelemetrySuite to validate the functionality of telemetry-related functions, ensuring correct behavior when telemetry is enabled and disabled.

@coderabbitai

coderabbitai Bot commented Mar 29, 2024

Copy link
Copy Markdown
Contributor
Walkthrough

Walkthrough

The changes focus on optimizing the telemetry system in the cosmos-sdk by ensuring telemetry operations are executed only when telemetry is enabled. This involves introducing a global atomic variable to manage telemetry's enablement state, implementing conditional execution of telemetry functions, and adjusting timing measurements in various modules for improved accuracy and efficiency.

Changes

File(s) Change Summary
telemetry/metrics.go, telemetry/wrapper.go, telemetry/wrapper_test.go Introduced a global atomic variable for telemetry enablement, added conditional checks for telemetry operations, and implemented tests for new telemetry functionality.
baseapp/abci.go, x/.../abci.go (multiple modules) Adjusted telemetry timing measurements by using telemetry.Now() and storing start time before defer statements for accurate timing.
x/circuit/module.go, x/crisis/module.go, x/crisis/abci.go, x/mint/keeper/abci.go, x/upgrade/keeper/abci.go Replaced usage of time package with custom telemetry package for time-related operations to ensure consistency and accuracy in telemetry metrics.

Assessment against linked issues

Objective Addressed Explanation
Only do telemetry computation if telemetry is enabled in the node (#10245)
Reduce costs for nodes not using telemetry by avoiding unnecessary operations (#10245)
Enhance accuracy of telemetry metrics across various modules (#10245)

Recent Review Details

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 9897209 and e2642b6.
Files selected for processing (1)
  • telemetry/wrapper_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • telemetry/wrapper_test.go

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lucaslopezf lucaslopezf marked this pull request as ready for review March 29, 2024 15:07
@lucaslopezf lucaslopezf requested a review from a team March 29, 2024 15:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Review Status

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between cb5d34e and a76e4f8.
Files selected for processing (15)
  • CHANGELOG.md (1 hunks)
  • baseapp/abci.go (1 hunks)
  • telemetry/metrics.go (3 hunks)
  • telemetry/wrapper.go (3 hunks)
  • telemetry/wrapper_test.go (1 hunks)
  • x/circuit/module.go (2 hunks)
  • x/crisis/abci.go (2 hunks)
  • x/crisis/module.go (2 hunks)
  • x/distribution/keeper/abci.go (2 hunks)
  • x/evidence/keeper/abci.go (2 hunks)
  • x/gov/keeper/abci.go (1 hunks)
  • x/mint/keeper/abci.go (2 hunks)
  • x/slashing/abci.go (2 hunks)
  • x/staking/keeper/abci.go (2 hunks)
  • x/upgrade/keeper/abci.go (2 hunks)
Additional Context Used
Path-based Instructions (15)
x/crisis/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/staking/keeper/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/slashing/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/evidence/keeper/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/distribution/keeper/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

telemetry/wrapper_test.go (2)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


**/*_test.go:
Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request

x/mint/keeper/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

telemetry/wrapper.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/circuit/module.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/upgrade/keeper/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/crisis/module.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

telemetry/metrics.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/gov/keeper/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

baseapp/abci.go (1)

**/*.go:
Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

CHANGELOG.md (1)

**/*.md:
Assess the documentation for misspellings, grammatical errors, missing documentation and correctness

Additional comments not posted (16)
x/crisis/abci.go (1)

14-14: The replacement of time.Now() with telemetry.Now() in the EndBlocker function aligns with the PR's objective to conditionally measure time based on telemetry enablement. This change ensures that time is only measured when telemetry is active, optimizing performance.

x/staking/keeper/abci.go (2)

15-15: The use of telemetry.Now() at the beginning of the BeginBlocker function is a good practice for conditionally measuring execution time based on telemetry enablement, contributing to the PR's efficiency improvements.


22-22: Similarly, in the EndBlocker function, replacing time.Now() with telemetry.Now() ensures that time measurements are only taken when telemetry is enabled, aligning with the PR's objectives for performance optimization.

x/slashing/abci.go (1)

16-16: Replacing time.Now() with telemetry.Now() in the BeginBlocker function is a strategic change that ensures time measurements are only performed when telemetry is enabled, which is in line with the PR's goal to enhance telemetry efficiency.

x/evidence/keeper/abci.go (1)

17-17: Utilizing telemetry.Now() in the BeginBlocker function to measure execution time only when telemetry is enabled is a thoughtful approach that aligns with the PR's objectives of optimizing telemetry operations.

x/distribution/keeper/abci.go (1)

14-14: The introduction of telemetry.Now() in the BeginBlocker function to conditionally measure time based on telemetry enablement is a positive change that supports the PR's goal of reducing unnecessary performance costs.

telemetry/wrapper_test.go (2)

25-36: The unit test for the Now function correctly tests both scenarios: when telemetry is enabled and when it is disabled. This ensures that the Now function behaves as expected under both conditions.


39-48: The unit test for isTelemetryEnabled function accurately checks the function's return value based on the global telemetry enablement state, ensuring the function's correctness.

x/mint/keeper/abci.go (1)

15-15: In the BeginBlocker function, replacing time.Now() with telemetry.Now() is a strategic change that ensures time measurements are only performed when telemetry is enabled, aligning with the PR's objectives for optimizing telemetry operations.

telemetry/wrapper.go (2)

27-29: Adding conditional checks for telemetry enablement in ModuleMeasureSince and other telemetry functions is a crucial improvement that ensures telemetry operations are only performed when necessary, aligning with the PR's efficiency goals.


103-109: The implementation of the Now function, which returns the current time if telemetry is enabled or a zero time otherwise, is a key addition that supports conditional time measurements across the SDK, in line with the PR's objectives.

telemetry/metrics.go (2)

18-31: The introduction of the globalTelemetryEnabled variable and the initTelemetry and isTelemetryEnabled functions are well-implemented for managing telemetry enablement state in a thread-safe manner.


114-114: The call to initTelemetry within the New function correctly initializes the telemetry enablement state, ensuring subsequent telemetry operations behave as expected.

baseapp/abci.go (1)

180-181: The adjustment to measure the query processing time by storing the start time before the defer statement is a good practice for accurate timing measurements. This change ensures that the time measurement includes the entire scope of the Query method execution.

CHANGELOG.md (2)

62-65: The summary of changes related to the telemetry module is clear and accurately reflects the PR objectives. It provides a concise overview of the enhancements made, including the introduction of the Now function, the implementation of an atomic global variable, and the conditional emission of telemetry metrics. Well done.


65-65: The entries regarding unrelated changes to the types and server modules are also well-documented. They provide clear information about the changes made, contributing to the overall completeness of the changelog. Good job on maintaining clarity and relevance in documenting these changes.

Comment thread x/circuit/module.go
// InitGenesis performs genesis initialization for the circuit module.
func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) error {
start := time.Now()
start := telemetry.Now()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from using time.Now() to telemetry.Now() in the InitGenesis function aligns with the PR's objective to optimize telemetry operations. However, it would be beneficial to add a comment explaining the reason for this change, enhancing code maintainability.

+	// Using telemetry.Now() to optimize performance when telemetry is disabled
	start := telemetry.Now()

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
start := telemetry.Now()
// Using telemetry.Now() to optimize performance when telemetry is disabled
start := telemetry.Now()

Comment thread x/upgrade/keeper/abci.go Outdated
// skipUpgradeHeightArray is a set of block heights for which the upgrade must be skipped
func (k Keeper) PreBlocker(ctx context.Context) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker)
start := telemetry.Now()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update to use telemetry.Now() instead of time.Now() in the PreBlocker function is a good optimization when telemetry is disabled. Consider adding a comment to explain this choice for future code maintainers.

+	// Using telemetry.Now() to optimize performance when telemetry is disabled
	start := telemetry.Now()

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
start := telemetry.Now()
// Using telemetry.Now() to optimize performance when telemetry is disabled
start := telemetry.Now()

Comment thread x/crisis/module.go Outdated
// InitGenesis performs genesis initialization for the crisis module.
func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) error {
start := time.Now()
start := telemetry.Now()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing time.Now() with telemetry.Now() in the InitGenesis function aligns with the PR's goal of optimizing telemetry operations. Adding a comment to explain this choice would enhance code maintainability.

+	// Using telemetry.Now() to optimize performance when telemetry is disabled
	start := telemetry.Now()

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
start := telemetry.Now()
// Using telemetry.Now() to optimize performance when telemetry is disabled
start := telemetry.Now()

Comment thread x/gov/keeper/abci.go Outdated
// EndBlocker is called every block.
func (k Keeper) EndBlocker(ctx context.Context) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
start := telemetry.Now()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The adjustment to use telemetry.Now() at the start of the EndBlocker function is a good optimization for telemetry performance. Adding a comment to explain this choice would be helpful for future code maintainers.

+	// Using telemetry.Now() to optimize performance when telemetry is disabled
	start := telemetry.Now()

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
start := telemetry.Now()
// Using telemetry.Now() to optimize performance when telemetry is disabled
start := telemetry.Now()

Comment thread x/crisis/abci.go Outdated
// check all registered invariants
func EndBlocker(ctx context.Context, k keeper.Keeper) {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
start := telemetry.Now()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would take the time here and pass it into the defer later on, is that expected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the comment! if time.Now() is called within the defer statement, it takes the timestamp at the point where the defer is declared, not when the function exits. This leads to an inaccurate duration measurement because it doesn't reflect the actual time span of the operations we're interested in measuring, I realized that from @alexanderbez comment (here). By assigning time.Now() to start outside of defer, we ensure that we're measuring the duration of the function's operations accurately

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement is not correct. The parameters are evaluated when the function is deferred already and not on execution. See demo or stackoverflow
Inlined or not is personal preference.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 the parameters are evaluated and closed over when the function is deferred, not executed, I prefer the prior syntax (not using a local var) since it's fewer LoC.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you both! So I'll use the prior syntax!

@lucaslopezf lucaslopezf requested a review from alexanderbez April 1, 2024 09:33

@alpe alpe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on the telemetry problem. Especially avoiding downstream calls to `metrics.* when deactivated.
I was wondering if the atomic Bool can be avoided. Other than this, no blockers but minor notes or nits.

Comment thread telemetry/metrics.go Outdated

// globalTelemetryEnabled is a private variable that stores the telemetry enabled state.
// It is set on initialization and does not change for the lifetime of the program.
var globalTelemetryEnabled atomic.Bool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of global var but why do you use an atomic bool when it is not modified after init? Could be a simple bool.

Comment thread telemetry/metrics.go Outdated

// initTelemetry sets the global variable based on the configuration.
// It is called only once, at startup, to set the telemetry enabled state.
func initTelemetry(enabled bool) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is called only once (beside tests). No need for a function IMHO

Comment thread telemetry/metrics.go Outdated

// New creates a new instance of Metrics
func New(cfg Config) (_ *Metrics, rerr error) {
initTelemetry(cfg.Enabled)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inline the function

Comment thread telemetry/metrics.go Outdated
}

// isTelemetryEnabled provides controlled access to check if telemetry is enabled.
func isTelemetryEnabled() bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personal preference: with a standard bool, this method can be inlined. If you want to provide the information to other packages or modules, it can make sense to make this public though.

Comment thread telemetry/wrapper_test.go Outdated
// It includes a mutex to ensure that tests that depend on the global state
// do not run in parallel, which can cause race conditions and unpredictable results.
type TelemetrySuite struct {
suite.Suite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personal preference: the suite type adds a lot of complexity and boiler plate code to the test cases compared to vanilla go + testify asserts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I share this preference.

Comment thread x/crisis/abci.go Outdated
// check all registered invariants
func EndBlocker(ctx context.Context, k keeper.Keeper) {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
start := telemetry.Now()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement is not correct. The parameters are evaluated when the function is deferred already and not on execution. See demo or stackoverflow
Inlined or not is personal preference.

Comment thread telemetry/metrics.go Outdated

// New creates a new instance of Metrics
func New(cfg Config) (_ *Metrics, rerr error) {
initTelemetry(cfg.Enabled)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note: the constructor is called by the server/start.go only when cfg.Telemetry is enabled. Any solution must work without this constructor being called or the file must be edited.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Actionable comments outside the diff hunks (1)
server/start.go (1)

Line range hint 1000-1000: Removing the conditional check for telemetry enablement in startTelemetry function may lead to telemetry being initialized even when it is disabled in the configuration. This could result in unnecessary resource usage and potential privacy concerns if telemetry data is collected without explicit enablement.

- if cfg.Telemetry.Enabled {
+ if true {

Comment thread telemetry/metrics.go
Comment on lines +17 to +24
// globalTelemetryEnabled is a private variable that stores the telemetry enabled state.
// It is set on initialization and does not change for the lifetime of the program.
var globalTelemetryEnabled bool

// IsTelemetryEnabled provides controlled access to check if telemetry is enabled.
func IsTelemetryEnabled() bool {
return globalTelemetryEnabled
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The introduction of globalTelemetryEnabled and the IsTelemetryEnabled() function are well-implemented. However, consider changing globalTelemetryEnabled from an atomic type to a regular boolean since it is not modified after initialization.

- var globalTelemetryEnabled bool
+ var globalTelemetryEnabled atomic.Bool

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
// globalTelemetryEnabled is a private variable that stores the telemetry enabled state.
// It is set on initialization and does not change for the lifetime of the program.
var globalTelemetryEnabled bool
// IsTelemetryEnabled provides controlled access to check if telemetry is enabled.
func IsTelemetryEnabled() bool {
return globalTelemetryEnabled
}
// globalTelemetryEnabled is a private variable that stores the telemetry enabled state.
// It is set on initialization and does not change for the lifetime of the program.
var globalTelemetryEnabled atomic.Bool
// IsTelemetryEnabled provides controlled access to check if telemetry is enabled.
func IsTelemetryEnabled() bool {
return globalTelemetryEnabled
}

@lucaslopezf lucaslopezf requested review from alpe and kocubinski April 10, 2024 15:11

@alexanderbez alexanderbez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops I meant to approve this a while ago 😆

@alexanderbez alexanderbez enabled auto-merge April 11, 2024 17:14
@alexanderbez alexanderbez added this pull request to the merge queue Apr 11, 2024
Merged via the queue into main with commit 2496cfd Apr 11, 2024
@alexanderbez alexanderbez deleted the lucas/telemetry_emit_enablement branch April 11, 2024 20:36
@julienrbrt julienrbrt mentioned this pull request Apr 12, 2024
12 tasks
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only do telemetry computation if telemetry is enabled in the node

5 participants