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

[BUG] Why Are the Traces for Multiple Service Bus Messages Correlated Under Same Operation ID in Application Insights? #25479

Closed
2 tasks done
SamuelBucheliZ opened this issue Nov 17, 2021 · 3 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. OpenTelemetry OpenTelemetry instrumentation Service Bus
Milestone

Comments

@SamuelBucheliZ
Copy link

Query/Question
As we regularly experienced issues similar to the following ones

we have implemented a periodically scheduled reconnect of the ServiceBusProcessorClient

This reconnect looks roughly as follows

    @Scheduled(
            fixedRateString = "PT1H"
    )   
    public void reconnect() {
        try {
            processorClient.close();
        } catch (Exception e) {
            log.warn("Failed to stop existing Service Bus client", e);
        }

        try {
            processorClient = createClient(config, processMessage, processError);
            processorClient.start();
        } catch (Exception e) {
            log.error("Failed to create new Service Bus client", e);
        }
    }

This reconnect has fixed the issues mentioned above. However, since upgrading to azure-messaging-servicebus version 7.4.1 (from 7.3.0), we have experienced a problem w.r.t. tracing in Application Insights.

Specifically, we have noticed that now the tracing data in Application Insights for all messages handled by the ServiceBusProcessorClient instance created by the reconnect appears in the same transaction, i.e., has the same operation ID.

For example, here the handling hundreds of individual messages is all in the context of this initial reconnect method:

image

Is this expected behaviour? Is there any way to fix this on our side? Or is this a bug in the SDK?

We would expect that the handling of each message has its own operation ID, i.e., is in a separate transaction. The current view makes it very hard to analyze and debug problems due to the enormous number of traces in one transaction.

Why is this not a Bug or a feature Request?
At the moment, we are unsure whether this is a bug or whether we are using the SDK in a wrong way on our side.

Setup (please complete the following information if applicable):

  • OS: Java Spring Boot Application deployed with Docker containers on Azure App Service with Linux Plan
  • IDE: n/a
  • Library/Libraries:
           <dependency>
               <groupId>com.azure</groupId>
               <artifactId>azure-messaging-servicebus</artifactId>
               <version>7.4.1</version>
           </dependency>

and applicationinsights-agent-3.2.0.jar

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 17, 2021
@SamuelBucheliZ SamuelBucheliZ changed the title [QUERY] [QUERY] Why Are the Traces for Multiple Service Bus Messages Correlated Under Same Operation ID in Application Insights? Nov 17, 2021
@pallavit
Copy link
Contributor

/cc: @lmolkova, @conniey can you please take a look.

@pallavit pallavit added the OpenTelemetry OpenTelemetry instrumentation label Nov 17, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 17, 2021
@pallavit pallavit added the Client This issue points to a problem in the data-plane of the library. label Nov 18, 2021
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 18, 2021
@anuchandy anuchandy added this to the [2022] June milestone Apr 26, 2022
@conniey conniey removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Apr 26, 2022
@conniey conniey changed the title [QUERY] Why Are the Traces for Multiple Service Bus Messages Correlated Under Same Operation ID in Application Insights? [BUG] Why Are the Traces for Multiple Service Bus Messages Correlated Under Same Operation ID in Application Insights? Apr 26, 2022
@conniey conniey added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Apr 26, 2022
@ki1729
Copy link
Contributor

ki1729 commented Nov 2, 2022

@SamuelBucheliZ Tracing was/still is in beta for service bus. The previous implementation had a lot of issues, so we have added and updated a lot of traces (and metrics) in the service bus SDK in the last two releases. This should resolve the problem for you. Please do let us know if you face any issue in using tracing now.

@ki1729 ki1729 added needs-author-feedback Workflow: More information is needed from author to address the issue. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Nov 2, 2022
@SamuelBucheliZ
Copy link
Author

@ki1729 Thank you very much for the information. Unfortunately, I do not work on the project where this issue was raised anymore, so I'm not able to verify the fix. I have forwarded this information to the relevant people, however, and would suggest to close the issue at the moment.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. OpenTelemetry OpenTelemetry instrumentation Service Bus
Projects
None yet
Development

No branches or pull requests

6 participants