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-1490100 Create Implement OpenTelemetry API and Span Function #113

Merged
merged 8 commits into from
Jun 20, 2024

Conversation

sfc-gh-bli
Copy link
Collaborator

  1. Import OpenTelemetry libs
  2. Create new utils class OpenTelemetry
  3. Create new test trait for OpenTelemetry Span test

import io.opentelemetry.sdk.trace.SdkTracerProvider
import io.opentelemetry.sdk.trace.`export`.SimpleSpanProcessor

trait OpenTelemetryEnabled extends SNTestBase {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Create a new trait for OpenTelemetry related tests.

@sfc-gh-bli sfc-gh-bli requested a review from sfc-gh-yuwang June 18, 2024 23:31
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-bom</artifactId>
<version>1.39.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a question here: how is the version control of a specific library done in Java? Does this code mean that user have to use opentelemetry-bom==1.39.0? Is there a way to limit it like >1.0.0, <2.0.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When compile, Maven while load opentelemetry 1.39.0 to compile the project. But during runtime, it actually works with any compatible dependencies.

import com.snowflake.snowpark.DataFrame
import io.opentelemetry.api.GlobalOpenTelemetry

object OpenTelemetry extends Logging {
Copy link
Contributor

Choose a reason for hiding this comment

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

One question about how OpenTelemetry trace action function, in Python, our implementation wrap around the action function. I am asking this because we also want to record any exception happened in the span that is not caused by open telemetry, the example to record it is here: https://opentelemetry.io/docs/languages/java/instrumentation/#set-span-status

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@sfc-gh-bli sfc-gh-bli merged commit afba3a7 into main Jun 20, 2024
17 checks passed
@sfc-gh-bli sfc-gh-bli deleted the snow-1490100 branch June 20, 2024 23:20
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