Skip to content

Conversation

@kirrg001
Copy link
Contributor

@kirrg001 kirrg001 commented Sep 17, 2025

See comments.

refs #2002

}
}

// TODO: This is not used anymore. Investigate any usages. Potentially remove/deprecate in the next major release.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its super nice that we might be able to remove activateImmediately functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this configuration option isn’t documented, but we can look into it later. It’s really nice to discover such untouched or unknown parts of our codebase.


// Activate immediately, otherwise we miss the first message event and the instana
// headers would not get removed from the message.
exports.activate();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of activating everything, we just activate what we need. The config even says it

activateBullProcessInstrumentation

// this is not compatible. Our codebase does not support this.
const parentProcessAgentUuid = process.env.INSTANA_AGENT_UUID;
// CASE: This process is a forked child process of a bull worker.
const currentProcessIsBullChildProcess = process.env.INSTANA_IS_BULL_CHILD_PROCESS === 'true';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed from INSTANA_AGENT_UUID to exact env INSTANA_IS_BULL_CHILD_PROCESS.

This env is not documented INSTANA_AGENT_UUID.

// @ts-ignore - Type 'string' is not assignable to type 'undefined'
// Probably because exports.agentUuid is set to undefined and export values were not supposed to be changed
// TODO: This has no effect. Remove! See comment above.
agentOpts.agentUuid = parentProcessAgentUuid;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finally getting rid of this dirty code. It was not working anyway

@kirrg001 kirrg001 marked this pull request as ready for review September 17, 2025 12:54
@kirrg001 kirrg001 requested a review from a team as a code owner September 17, 2025 12:54
@kirrg001 kirrg001 merged commit 36205e9 into main Sep 17, 2025
1 check passed
@instanacd instanacd deleted the refactor-bull-env branch November 17, 2025 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants