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

HPCC4J-612 Shift to zero-code instrumentaton #747

Conversation

rpastrana
Copy link
Member

@rpastrana rpastrana commented Sep 11, 2024

  • Removes manually declared spans
  • Adds WithSpan annotations on several clients

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change is a breaking change (fix or feature that will cause existing behavior to change).

Checklist:

  • I have created a corresponding JIRA ticket for this submission
  • My code follows the code style of this project.
    • I have applied the Eclipse code-format template provided.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the HPCC Systems CONTRIBUTORS document (https://github.com/hpcc-systems/HPCC-Platform/wiki/Guide-for-contributors).
  • The change has been fully tested:
    • This change does not cause any existing JUnits to fail.
    • I have include JUnit coverage to test this change
    • I have performed system test and covered possible regressions and side effects.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Premature optimization
    • This change fixes the problem, not just the symptom

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net/browse/HPCC4J-612

Jirabot Action Result:
Workflow Transition To: Merge Pending
Additional PR: #747

@rpastrana rpastrana requested a review from jpmcmu September 11, 2024 00:51
@rpastrana
Copy link
Member Author

@jpmcmu please review

@rpastrana
Copy link
Member Author

image

@rpastrana rpastrana force-pushed the HPCC4J-612-ShiftToZeroCodeInstrumentation branch from 7ac51c3 to a3ca6b8 Compare September 11, 2024 22:26
@rpastrana
Copy link
Member Author

@jpmcmu updated please review.

Copy link
Contributor

@jpmcmu jpmcmu left a comment

Choose a reason for hiding this comment

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

A few questions / changes

pom.xml Outdated
<!-- Not managed by opentelemetry-bom -->
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-annotations</artifactId>
<version>2.6.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.

This should be declared above as variable with the rest of the version

@@ -3,6 +3,8 @@
import org.hpccsystems.ws.client.utils.Connection;
import org.hpccsystems.ws.client.utils.ObjectPool;

//import io.opentelemetry.instrumentation.annotations.WithSpan;
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 still need this commented out lines?

import io.opentelemetry.instrumentation.annotations.SpanAttribute;
import io.opentelemetry.instrumentation.annotations.WithSpan;

//import io.opentelemetry.instrumentation.annotations.WithSpan;
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate commented out import

{
if (method == null || method.isEmpty())
throw new Exception ("Must provide valid HTTP method");

URL url = new URL (getBaseUrl() + (uri != null && uri.startsWith("/") ? "" : "/") + uri);

Span sendHTTPReqSpan = GlobalOpenTelemetry.get().getTracer(BaseHPCCWsClient.PROJECT_NAME)
/*Span sendHTTPReqSpan = GlobalOpenTelemetry.get().getTracer(BaseHPCCWsClient.PROJECT_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you planning on keeping this around in case we want to re-enable?

else
{
sendHTTPReqSpan.setAttribute("hasCredentials", false);
//sendHTTPReqSpan.setAttribute("hasCredentials", true);
Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed this briefly, but does the Zero-code stuff set the currentSpan()? If it does could we grab the current span and use it to add additional attributes?

@rpastrana rpastrana force-pushed the HPCC4J-612-ShiftToZeroCodeInstrumentation branch from a3ca6b8 to f68e38b Compare September 12, 2024 12:48
@rpastrana rpastrana requested a review from jpmcmu September 12, 2024 17:41
@rpastrana
Copy link
Member Author

@jpmcmu please review latest changes

@rpastrana rpastrana force-pushed the HPCC4J-612-ShiftToZeroCodeInstrumentation branch 3 times, most recently from 64ec587 to 698c498 Compare September 13, 2024 16:18
Copy link
Contributor

@jpmcmu jpmcmu left a comment

Choose a reason for hiding this comment

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

@rpastrana looks good to me

- Removes manually declared spans
- Adds WithSpan annotations on several clients
- Adds hascredentials span attribute to current span
- Ensures executeECLScript is traced

Signed-off-by: Pastrana <[email protected]>
@rpastrana rpastrana force-pushed the HPCC4J-612-ShiftToZeroCodeInstrumentation branch from 698c498 to ca685f9 Compare September 17, 2024 15:08
@rpastrana rpastrana merged commit 874dba1 into hpcc-systems:candidate-9.6.x Sep 17, 2024
4 of 6 checks passed
Copy link

Jirabot Action Result:
Fix versions already added.

rpastrana added a commit to rpastrana/HPCC4J that referenced this pull request Sep 20, 2024
rpastrana added a commit to rpastrana/HPCC4J that referenced this pull request Sep 20, 2024
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