Skip to content

fix: enforced max limit on metrics transmission config#2511

Merged
abhilash-sivan merged 3 commits intomainfrom
fix-limit-poll-rate
Apr 23, 2026
Merged

fix: enforced max limit on metrics transmission config#2511
abhilash-sivan merged 3 commits intomainfrom
fix-limit-poll-rate

Conversation

@abhilash-sivan
Copy link
Copy Markdown
Contributor

@abhilash-sivan abhilash-sivan commented Apr 22, 2026

  • added max limit of 5000
  • max value is applied if config > 5000

Comment thread packages/core/src/config/index.js Outdated
* @returns {*}
*/
function normalizeSingleValue(configValue, defaultValue, configPath, envVarKey) {
function normalizeSingleValue(configValue, defaultValue, configPath, envVarKey, minValue, maxValue) {
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.

Since INSTANA_METRICS_TRANSMISSION_DELAY normalization uses the shared normalizeSingleValue function, the min/max validation logic has been added.

Even though the minimum value isn’t currently enforced or used, it’s included for consistency with the common normalisation approach.

@abhilash-sivan abhilash-sivan marked this pull request as ready for review April 22, 2026 11:08
@abhilash-sivan abhilash-sivan requested a review from a team as a code owner April 22, 2026 11:08
Comment thread packages/core/src/config/index.js Outdated
'config.metrics.transmissionDelay',
'INSTANA_METRICS_TRANSMISSION_DELAY'
'INSTANA_METRICS_TRANSMISSION_DELAY',
null,
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.

qs: why null passed as min value? what if customer configure 500ms? It still works?

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.

yes

Comment thread packages/core/src/config/index.js Outdated
* @returns {*}
*/
function normalizeSingleValue(configValue, defaultValue, configPath, envVarKey) {
function normalizeSingleValue(configValue, defaultValue, configPath, envVarKey, minValue, maxValue) {
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 revert this and handle the check only in the normalizeMetricsConfig fn

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.

done

Comment thread packages/core/src/config/index.js Outdated
logger.warn(
`The value of config.metrics.transmissionDelay (or INSTANA_METRICS_TRANSMISSION_DELAY) (${config.metrics.transmissionDelay}) exceeds the maximum allowed value of 5000. Assuming the default value ${defaults.metrics.transmissionDelay}.`
);
config.metrics.transmissionDelay = defaults.metrics.transmissionDelay;
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 should be 5000, right?

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.

The default is still 1000 as per the discussions

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.

But if a customer sets already >5s, we should set the MAX limit?

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.

In this case, it should be 5000ms, that is the max allowed limit.

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.

ah that makes sense

Copy link
Copy Markdown
Contributor

@kirrg001 kirrg001 left a comment

Choose a reason for hiding this comment

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

Please merge as fix

@abhilash-sivan abhilash-sivan changed the title chore: enforced max limit on metrics transmission config fix: enforced max limit on metrics transmission config Apr 23, 2026
@abhilash-sivan abhilash-sivan enabled auto-merge (squash) April 23, 2026 11:20
@abhilash-sivan abhilash-sivan merged commit ebcfebd into main Apr 23, 2026
1 check passed
@sonarqubecloud
Copy link
Copy Markdown

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