-
Notifications
You must be signed in to change notification settings - Fork 9
Issue with multiple mule applications #9
Comments
Hi Krishna. Are you using Mule domain to deploy multiple applications?
…On Wed, 16 Sep 2020 at 13:16, krishnaprasadhg ***@***.***> wrote:
Hello,
We have multiple mule applications. Mule application & APM works fine when
the APM+dependent jars are configured at application level. However this
increases Mule application jar by ~15 MB. Increase in Mule application jars
causes low memory issues.
So we placed the APM +dependent jars in the mule host level. The issue we
encountered is the very 1st mule application works fine, remaining mule
applications not able to get any API/http calls.
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXR5DKO7Z5ALXPO6K67AVTSGAUYLANCNFSM4ROEH2SA>
.
|
Hi Michael, Yes. We are using mule domain. Thanks |
Michael, |
sorry for the delay, I was busy with my day job :)
Will have a look at it today.
…On Fri, 18 Sep 2020 at 22:56, Manish Jain ***@***.***> wrote:
Michael,
There are multple projects which are under 1 common domain so we cant
apply domain-tracer approach their as it would then group all APM under
that domain .
so we are following tracer.xml approach .
Manish
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXR5DJH5N6RVP5M25TWUMTSGNKGTANCNFSM4ROEH2SA>
.
|
Hi @manishgcjain and @krishnaprasadhg, I created a test project that also uses API autodiscovery (attached) and Mule 4.3.0. I then pushed a client.id enforcement policy and created an application that allowed the request to go through:
I was able to see an APM transaction created for the successful call to the flow, but the one where the policy blocked the execution due to the invalid client-id the flow wasn't invoked. In the flow itself, I am tracking the start and finish of the flow execution, but with APM policy violation the flow is not being invoked at all. Is this the problem you are experiencing? I wanted to ask your help to get Mulesoft to update their documentation and publish the specs for their event APIs the same way they did for Mule 3. Mule 4 has been around for a while, but their documentation is inadequate, for example the page with Javadoc points still at 4.1.1 and I had no luck trying to contact them to do something about it. Voeful lack of documentation and open community (Stack Overflow or even Mulesoft own forums) made me stop developing the agent for Mule 4, so if you can help me to get Mulesoft to lift up their game with the documentation, I am happy to continue making enhancements. Javadoc: |
I can also invoke the application multiple times with the policy succeeding and it seems to work ok. See below 7 successful calls. Do you know which policy you are using that causes the problem? My API definition is: {"api":{"$self":{"name":"v1:16383844","groupId":"a1cb42d2-1a95-4d63-bdc9-4ea2b5ad0e35","assetId":"test-api-1","assetVersion":"1.0.0","productVersion":"v1","description":null,"tags":[],"order":1,"providerId":null,"deprecated":false,"endpointUri":null,"instanceLabel":null}},"endpoint":{"$self":{"type":"http","uri":null,"proxyUri":null,"isCloudHub":null,"deploymentType":"CH","policiesVersion":null,"referencesUserDomain":null,"responseTimeout":null,"muleVersion4OrAbove":true}},"policyConfigurations":[{"$self":{"policyTemplateId":"299240","groupId":"68ef9520-24e9-4cf2-b2f5-620025690913","assetId":"client-id-enforcement","assetVersion":"1.2.2","configurationData":{"credentialsOriginHasHttpBasicAuthenticationHeader":"httpBasicAuthenticationHeader","clientIdExpression":"#[attributes.headers['client_id']]"},"pointcutData":null,"disabled":false,"order":1}}]} |
Hi Michael, I have also been having issues when API Auto-discovery is enabled. I've raised a ticket with Mulesoft asking them to update their documentation for https://docs.mulesoft.com/mule-runtime/4.3/mule-4-api-javadoc. If there is anything else that would help to progress this, please let me know. Thanks, Alan |
Hi, I have had a response from Mulesoft stating: The documentation for 4.3.0 can be found at: However we are ware that the title of the documentation is wrong as it states: Hope this helps. Thanks, Alan |
Hi Michael, I am facing issue intermittently with APM, it is working fine if we are adding the mule-agent in a first place means while building a mule application from scratch. But, if we are adding the mule-agent in an existing mule application then it is throwing 500 connection close error. To make work APM changes in existing application if we remove the application instance from API Manager and deploy the application in Runtime Manager and after the successful deployment again manage the application in API Manager it is working fine. |
Hi Akhil. Can you send me the error that Mule is throwing when 500 error occurs? Hopefully, it logs an exception when it happens. |
Also, what policies are you using? I am trying to figure out if one of them can be causing an issue. |
Hi Michael, getting below error, it is not logging any error in mule_ee as well as mule application logs. following policies are applied on APIs -
|
Can you please set the Another thing, I tried to run some load testing on my end to try and reproduce the failure and the only thing I could achieve was saturating the internal reporter queue for the APM agent due to too many messages needing to be sent to the APM server. Just to test this further, can you please increase the size and the number of instances of the APM server? This is the error I saw in my logs:
|
Also, to debug it further, can you please ask Mulesoft support to get you the exact exception that Mule policy throws when the API consumers see the 500 error? |
Hi Michael, I wasn't getting any messages back other than the 500 Server Error when the APM log level was set to INFO. I ran the application in Debug mode in Anypoint Studio and set the log level to Debug. Anypoint Studio gave the following message:
The logs from APM in Debug are below:
|
Hi Alan, Thanks for that. Is there a stack trace preceding this?
The other debug messages seem to be normal APM agent class instrumentation. Also, is it a particular policy that causes this error, a combination of policies, or any policy that can cause it? Still trying to reproduce it on my end, really appreciate your help. |
Hi Michael, Unfortunately there is no stack trace available. I've tried with a couple of API's with varying policies. The first one I tried had only Client ID Enforcement, whereas the current one has Client ID Enforcement, HTTP Caching and Spike Control. |
Hi Alan
Have you tried increasing the number and size of APM servers?
On Thu, 15 Oct 2020 at 12:39 am, AlanElliottMAG ***@***.***> wrote:
Hi Michael,
Unfortunately there is no stack trace available.
I've tried with a couple of API's with varying policies. The first one I
tried had only Client ID Enforcement, whereas the current one has Client ID
Enforcement, HTTP Caching and Spike Control.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXR5DKJSPT2EQSWCIYOVJTSKWSZJANCNFSM4ROEH2SA>
.
--
|
Tried to run it with these 3 policies added, still can't get any 5xx errors back to the calling client. Also, can you send me the configuration of your API policies? There can be something that causes the error that comes from how the policies are configured. |
Hi Michael, Have you tried creating a new API without any of the APM code and adding it to API Manager with policies applied and then adding APM afterwards? From what I have seen from the comments here, if APM is baked in at the time of first development then it seems to work ok, but retrofitting it is where the problems lie. In terms of the policy settings, they are as follow: Policy | Client ID enforcement Policy | HTTP Caching Policy | Spike Control Thanks, Alan |
Thanks. I managed to reproduce the issue with transactions not being sent from Cloudhub when I added I am suspecting this must be the substitutions CH deployment process does when you deploy projects that stops |
Now, I managed to fix the issue where Mule application with API autodiscovery deployed into CloudHub and not showing APM transactions. But I couldn't reproduce the 500 errors on my end. @krishnaprasadhg @adrianj @manishgcjain can you please test v0.1.0 and let me know? https://github.com/michaelhyatt/elastic-apm-mule4-agent/releases/tag/v0.1.0 |
Hi Michael, We are using on-prem Mule Runtimes after, adding the new version I am not facing 500 connection close server error. But, still facing issue while sending transaction data to APM. Internally checking within the team if it gets resolved I will let you know. Thanks for the help!! |
@akhilpathak26 I added an example to the repo for you to test with domain, APIKit and 2 projects in it. Can you please check if it runs in your environment? https://github.com/michaelhyatt/elastic-apm-mule4-agent/tree/master/examples/domain It uses Mule 4.3.0 by default, also make sure to install the latest and greatest version of the Mule 4 APM agent v0.2.0. |
Hi Michael, Just wanted to let you know that I tried the latest and greatest version v0.2.0 and it works like a charm. I even went a step further and got Mule and APM working together in a Docker container. Thanks for all your help. Alan. |
Hi Michael, I've tried with the new 0.2.0 version. it is working fine when I am triggering requests from my local machine.(postman and application deployed on Studio). But, when I deployed same application on Mule Runtime it is not publishing transaction data to APM server. |
Will Distributed Tracing be added anytime soon? It would be really beneficial to include the use of service map to showcase APM's monitoring capabilities to the business. Thanks, Alan |
@akhilpathak26 is there any further info, or maybe error messages from your server (not Studio) that can shed the light? |
Hi @AlanElliottMAG , Yes, I wanted to look into it again, now that there is a newer Javadoc. In the past, the problem was the new immutable message model that Mule 4 introduced that prohibited changing the Mule message to propagate the tracing header from within the notification code. Mule 4 also deviated from Mule 3 on how Mule message properties converted into the protocol headers. In Mule 3, message properties were automatically converted into HTTP headers, JMS properties etc. Mule 4 doesn't support this convention anymore and each protocol doesn't seem to have a common way of setting the properties anymore. The latter can be overcome by building separate support for the most commonly used protocols. The former is a bigger issue since ideally, I wanted to avoid using things like a reflection to force header propagation as it may break the code with every change of Mule APIs and implementation. If you know the way or can ask MuleSoft support about how |
@akhilpathak26 @krishnaprasadhg - I tried to reproduce your issue with multiple domain applications, but it is working fine in both, Anypoint and standalone server. I used the sample domain test app: https://github.com/michaelhyatt/elastic-apm-mule4-agent/tree/master/examples/domain This is what I did:
Do you see anything there that shows that your setup maybe different? |
Hi Michael, Thanks for sharing the domain examples - https://github.com/michaelhyatt/elastic-apm-mule4-agent/tree/master/examples/domain. But, in this example I observed that you did the APM config changes at proj1 and proj2. I tried the same by adding that at domain project and it is not working after adding the APM config changes in domain project. We have 50+ mule application on single Mule Runtime, if we do the changes at mule application level then it will be a huge difference. Is it possible if we add all the APM config at domain and refer the domain to other applications. In this way no change is required at each mule application level. |
just to add on Akhil's point adding dependency in each project would increase the jar size by ~15MB each. and we will be having apm agent in each jar which is not required as it would be loaded in the single jvm. so is there a way to have the dependency at the server level and in each project we can define them as "provided " or "test" |
@akhilpathak26 - I couldn't find a way to configure and enable notifications at the domain level in Mule 4 the same way it worked in Mule 3. My agent relies on notifications to capture pipeline, processor and exception events to translate them into APM transactions and spans. If you have access to Mulesoft support, can you please ask them for an example on how to enable and configure server notifications in the domain configuration so they work across all the projects deployed with the domain? To be clear, these are the notifications I am relying upon the APM agent to work: |
@manishgcjain - because there is no way to configure events and dependencies at the domain level, I have to add dependencies into every project deployed with the domain. So, the official Elastic Java APM agent jars that Mule agent is using have to be added to each project, the attach and agent jars are about 7MB each because they are shadowing all the dependencies, so I can't do anything about the size of the resulting jar, unfortunately. I don't want to bypass the agent completely, since it provides tons of really useful functionality, such as metrics collections, JMX beans integration, etc, so the size problem will be there for quite some time, unfortunately. |
@AlanElliottMAG - I have the version of the agent that supports adding Mule transaction to the overall trace, i.e. creates a transaction with the same parent If it is useful and you would like to have a look, happy to make a jar available, otherwise, will try to figure out a more complete solution that supports distributed tracing end to end. |
@michaelhyatt - Any update on the issue as it requires the mule runtime for change in each API project which is practically not feasible. Can you please help in providing fix . |
@michaelhyatt - An end to end distributed tracing solution would be ideal. I'm happy to test out anything you have though. If it isn't too much trouble to make a jar available, I'll stick it into my dev instances and see what we can get out of it. Thanks |
@manishgcjain adding tracing once at the domain level with Mule 4 is not possible for 2 reasons:
https://docs.mulesoft.com/mule-runtime/4.3/about-classloading-isolation
Things worked differently in Mule 3, but in Mule 4 the classloader isolation and notifications make it impossible to enable tracing at the domain level, so you will need to redeploy the applications to enable tracing. If you want to help me with escalating the two questions below to Mulesoft support, I would really appreciate your help:
BTW, were you able to run the demo applications I sent you earlier with API policies applied? |
@AlanElliottMAG - created release v0.3.0. Will keep you posted with how I go about propagating the |
@michaelhyatt - Unfortunately, that change has rendered the Trace Sample section unusable. It now looks like this: Whereas in 0.2.0 it looks like the below which is far more useful: The Trace Sample section is one of the most useful aspects of APM as it allows us to pinpoint bottlenecks to the code level. Thanks, Alan |
hmmm, that's weird... All my tests are green including the new ones. Do you
mind contributing your project to test and reproduce it, if possible?
![image](https://user-images.githubusercontent.com/15670925/98051597-4e1f6d00-1e88-11eb-9b71-c0e02fb7333a.png)
|
Unfortunately I won't be able to contribute the project as it is a live system that we are retrofitting APM into and as such needs to communicate with Anypoint Platform and several other API's to work, plus it contains sensitive information. I'll try again with 0.3.0 and see if there is anything in the logs to suggest what is happening, however, I'm going to be off for 4 weeks after today, so it will have to wait until I'm back, sorry. |
@manishgcjain @akhilpathak26 @krishnaprasadhg - I updated the example domain project to use the shared library from the domain, so now you can only add it once in the Sample app: README: Let me know what you think. |
@AlanElliottMAG I added a distributed tracing example project, please check it out https://github.com/michaelhyatt/elastic-apm-mule4-agent/tree/master/examples/tracing-test |
Hello,
We have multiple mule applications. Mule application & APM works fine with security policies are disabled. The issue is mule applications stops working when we enable client id enforcement security policies.
We tested with APM agent v 1.18.0/1.17.0.
Thanks
The text was updated successfully, but these errors were encountered: