Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Add settings attributes to trace spans. #2181

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ehsannas
Copy link
Contributor

@ehsannas ehsannas commented Sep 4, 2024

This PR adds settings attributes to spans. This information could be useful when debugging performance issues.

@ehsannas ehsannas requested review from a team as code owners September 4, 2024 22:26
@ehsannas ehsannas self-assigned this Sep 4, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: firestore Issues related to the googleapis/nodejs-firestore API. labels Sep 4, 2024
@ehsannas ehsannas force-pushed the ehsann/add-trace-attributes-2 branch from 347f9a5 to 000432f Compare September 4, 2024 22:26
@ehsannas ehsannas assigned milaGGL and unassigned ehsannas Sep 5, 2024
// Re-use the existing EnabledTraceUtil if one has been created.
if (this._traceUtil && this._traceUtil instanceof EnabledTraceUtil) {
return this._traceUtil;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we are now capturing settings as part of the trace attributes, if the settings change we need to also change the traceUtil instance. So we should not re-use the existing one.

this.settingsAttributes[`${ATTRIBUTE_SETTINGS_PREFIX}.max_idle_channels`] =
settings.maxIdleChannels ?? DEFAULT_MAX_IDLE_CHANNELS;

const defaultRetrySettings = serviceConfig.retry_params.default;
Copy link
Contributor

Choose a reason for hiding this comment

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

why there are retry and timeout configuration? how this is related to otel tracing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this code is adding trace attributes to the spans. The purpose is that if a user has misconfigured their SDK, their configurations will surface in the trace and may provide insights into the issues they're running into. This is similar to the Java impl. Although not all java configurations exist in the node.js SDK.

Copy link
Contributor

@milaGGL milaGGL left a comment

Choose a reason for hiding this comment

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

LGTM

@milaGGL milaGGL assigned ehsannas and unassigned milaGGL Sep 17, 2024
Copy link
Contributor

@milaGGL milaGGL left a comment

Choose a reason for hiding this comment

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

LGTM

@ehsannas ehsannas added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 20, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants