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

SNOW-1480779 Support Method Chain in the Telemetry #121

Merged
merged 20 commits into from
Jul 22, 2024
Merged

Conversation

sfc-gh-bli
Copy link
Collaborator

@sfc-gh-bli sfc-gh-bli commented Jul 19, 2024

Implement Method Chain in the Open Telemetry

@sfc-gh-bli sfc-gh-bli requested a review from sfc-gh-yuwang July 19, 2024 00:32
@@ -14,39 +14,39 @@ public class JavaOpenTelemetrySuite extends JavaOpenTelemetryEnabled {
public void cacheResult() {
DataFrame df = getSession().sql("select * from values(1),(2),(3) as t(num)");
df.cacheResult();
checkSpan("snow.snowpark.DataFrame", "cacheResult", null);
checkSpan("snow.snowpark.DataFrame", "cacheResult");
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we not check method chain in this situation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I improved this checker function.

  private void checkSpan(String className, String funcName) {
    StackTraceElement[] stack = Thread.currentThread().getStackTrace();
    StackTraceElement file = stack[2];
    checkSpan(
        className,
        funcName,
        "JavaOpenTelemetrySuite.java",
        file.getLineNumber() - 1,
        "DataFrame." + funcName);
  }

if no methodChain input, the default one is "DataFrame." + funcName.

@sfc-gh-bli sfc-gh-bli merged commit 3c03b99 into main Jul 22, 2024
15 checks passed
@sfc-gh-bli sfc-gh-bli deleted the snow-1480779 branch July 22, 2024 16:48
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.

2 participants