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

HIVE-28505: OTEL: Implement OTEL Exporter to expose query details from HiveServer2. #5439

Closed
wants to merge 4 commits into from

Conversation

ayushtkn
Copy link
Member

What changes were proposed in this pull request?

Implement OTEL Exporter to expose basic query details from HiveServer2

Why are the changes needed?

Better Usability & introduce various OTEL Clients to fetch query data

Does this PR introduce any user-facing change?

OTEL Clients can be configured to fetch data from HS2

Is the change a dependency upgrade?

No

How was this patch tested?

Mannual/Pending

<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>${otel.version}</version>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add io.opentelemetry:opentelemetry-exporter-otlp as a dependency here as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

} else {
Span span = tracer.spanBuilder("LiveQuery" + lQuery.getQueryDisplay().getQueryId())
.setAllAttributes(getAttributes(lQuery)).setStartTimestamp(lQuery.getBeginTime(), TimeUnit.MILLISECONDS)
.startSpan();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be starting span and then setting the attributes.
Something like:

Span span = tracer.spanBuilder("LiveQuery" + lQuery.getQueryDisplay().getQueryId()).startSpan();
span.setAllAttributes(getAttributes(lQuery)).setStartTimestamp(lQuery.getBeginTime(), TimeUnit.MILLISECONDS);

Current approach is causing NULL pointer exception intermittently and interrupts the thread.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed, let me know if it looks good, timestamp needs to be set before only, there is no method in Span it is there in builder only

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll test and let you know if it works fine.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants