Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

refactor: Add settings attributes to trace spans.#2181

Merged
ehsannas merged 3 commits intomainfrom
ehsann/add-trace-attributes-2
Sep 23, 2024
Merged

refactor: Add settings attributes to trace spans.#2181
ehsannas merged 3 commits intomainfrom
ehsann/add-trace-attributes-2

Conversation

@ehsannas
Copy link
Copy Markdown
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 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
@ehsannas ehsannas requested a review from milaGGL September 5, 2024 13:22
Comment thread dev/src/index.ts
// Re-use the existing EnabledTraceUtil if one has been created.
if (this._traceUtil && this._traceUtil instanceof EnabledTraceUtil) {
return this._traceUtil;
}
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 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
Copy Markdown
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
Copy Markdown
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.

@ehsannas ehsannas requested a review from milaGGL September 11, 2024 20:44
Copy link
Copy Markdown
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
Copy Markdown
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
@ehsannas ehsannas added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 23, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 23, 2024
@ehsannas ehsannas merged commit 1775ce6 into main Sep 23, 2024
@ehsannas ehsannas deleted the ehsann/add-trace-attributes-2 branch September 23, 2024 18:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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