WSO2 Api Manager: How to log the services - api

How can I view (in carbon console or in a File) the services that are consumed by subcribers? Do I need to set a log-level? Can I see the total amount of services consumed per service of a period?

In the Carbon Console you could set Enable Message Tracing. If you enable message tracing AND Enable logging, the carbon.log file is filled with messages;
TID: [0] [AM] [2014-04-18 13:32:48,026] INFO {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils} -
Massage Info: Transaction id=62078996748661323020575 Message direction=IN Server name=nxt-fon-app01.nl.rsg Timestamp=1397820768026
Service name=__SynapseService Operation Name=mediate {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils}
TID: [0] [AM] [2014-04-18 13:32:48,046] INFO {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils} -
Massage Info: Transaction id=62078996748661323020575 Message direction=OUT Server name=nxt-fon-app01.nl.rsg Timestamp=1397820768046
Service name=__SynapseService Operation Name=mediate {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils}
This information is limited you see in incoming call and outgoing call event, but you do not see which service.
To enable runtime statistics you should enable BAM with API

Related

Getting "Invalid client secret is provided" error while setting up Splunk with Azure Event Hub

I am getting the following error while configuring Splunk with Azure Event Hub.
2021-04-23 10:12:17,141 level=WARNING pid=xxxxxxx tid=Thread-2
logger=azure.eventhub._eventprocessor.event_processor
pos=event_processor.py:_load_balancing:281 | EventProcessor instance
'2ea6353e-ee45-4a4e-b173-5f82ae79707c' of eventhub
'insights-activity-logs' consumer group '$Default'. An error occurred
while load-balancing and claiming ownership. The exception is
EventHubError("Unexpected response '{'error': 'invalid_client',
'error_description': 'AADSTS7000215: Invalid client secret is
provided.\r\nTrace
ID:xxxxxxx-c913-420f-8dfb-5169faed3800\r\nCorrelation ID:
xxxxxxxx-81b2-4436-9d25-13e38ec15d9d\r\nTimestamp: 2021-04-23
02:12:10Z', 'error_codes': [7000215], 'timestamp': '2021-04-23
02:12:10Z', 'trace_id': 'xxxxxxxxx-c913-420f-8dfb-5169faed3800',
'correlation_id': 'xxxxxxxx-81b2-4436-9d25-13e38ec15d9d', 'error_uri':
'https://login.microsoftonline.com/error?code=7000215'}'\nUnexpected
response '{'error': 'invalid_client', 'error_description':
'AADSTS7000215: Invalid client secret is provided.\r\nTrace ID:
xxxxxxx-c913-420f-8dfb-5169faed3800\r\nCorrelation ID:
xxxxxxx-81b2-4436-9d25-13e38ec15d9d\r\nTimestamp: 2021-04-23
02:12:10Z', 'error_codes': [7000215], 'timestamp': '2021-04-23
02:12:10Z', 'trace_id': 'xxxxxxxxx-c913-420f-8dfb-5169faed3800',
'correlation_id': 'xxxxxxxxxx-81b2-4436-9d25-13e38ec15d9d',
'error_uri':
'https://login.microsoftonline.com/error?code=7000215'}'"). Retrying
after 10.408012031827356 seconds
I am referring to the following tutorials:
https://www.splunk.com/en_us/blog/tips-and-tricks/splunking-microsoft-azure-monitor-data-part-1-azure-setup.html
https://www.splunk.com/en_us/blog/tips-and-tricks/splunking-microsoft-azure-monitor-data-part-2-splunk-setup.html
From my understanding, it is that we will have to generate a Azure AD application and set its permission for resource management and here, I am making use of it to enable Splunk to access the activity logs to my Event Hub. I have done setting up an AD application and added the role assignment to the AD application, after that, generated a client secret as mentioned in the tutorial. I am subscribing to Azure for Student, will this be the cause of getting this error as I have limited privileges?
I've faced the same error you described, as it turns out, Splunk Add-on for Microsoft Cloud Services version 4.1.2 has a known issues as described in the release note.
enter image description here
Download version 4.1.1 and force installation solved the issue for me

Google Cloud Platform - Catch and log errors and automatically terminate VM

I am running a workflow on a n1-ultramem-40 instance that will run for several days. If an error occurs, I would like to catch and log the error, be notified, and automatically terminate the Virtual Machine. Could I use StackDriver and gcloud logging to achieve this? How could I automatically terminate the VM using these tools? Thanks!
Let's break the puzzle into two parts. The first is logging an error to Stackdriver and the second is performing an external action automatically when such an error is detected.
Stackdriver provides a wide variety of language bindings and package integrations that result in log messages being written. You could include such API calls in your application which detects the error. If you don't have access to the source code of your application but it instead logs to an external file, you could use the Stackdriver agents to monitor log files and relay the log messages to Stackdriver.
Once you have the error messages being sent to Stackdriver, the next task would be defining a Stackdriver log export definition. This is the act of defining a "filter" that looks for the specific log entry message(s) that you are interested in acting upon. Associated with this export definition and filter would be a PubSub topic. A pubsub message would then be written to this topic when an Stackdriver log entry is made.
Finally, we now have our trigger to perform your action. We could use a Cloud Function triggered from a PubSub message to execute arbitrary API logic. This could be code that performs an API request to GCP to terminate the VM.

Third party rest service returns 503 from mule flow

I have been consuming third party address lookup service from my mulesoft application, this works fine when i execute it in anypoint studio with mule server 3.9.0.
When i deploy the same application to cloud run time manager (3.9.0), I am getting HTTP status 503 (service unavailable).
I tried adding property "anypoint.platform.gatekeeper=false" in cloud runtime properties, but still no luck.
Could anyone please assist what configuration mistake i have done, as i am new to MuleSoft.
Message : Response code 503 mapped as failure.
Element : /Air-s-address-v1-address-lookup-flow/processors/1 # Air-s-address-v1-development:Air-s-address-v1-address-lookup.xml:20 (Address Lookup)
--------------------------------------------------------------------------------
Exception stack is:
Response code 503 mapped as failure. (org.mule.module.http.internal.request.ResponseValidatorException)
org.mule.module.http.internal.request.SuccessStatusCodeValidator.validate(SuccessStatusCodeValidator.java:37)
org.mule.module.http.internal.request.DefaultHttpRequester.validateResponse(DefaultHttpRequester.java:431)
org.mule.module.http.internal.request.DefaultHttpRequester.innerProcess(DefaultHttpRequester.java:414)
(264 more...)
(set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
Below is my HTTP Request configuration:

Wso2 IoT : ERROR - DeviceMgtAPIUtils Exception occurred while starting the Task service

When I back up Platform Configurations on wso2 IoT (I click to save), in the console I have an error:
[IoT-Core] ERROR - DeviceMgtAPIUtils Exception occurred while starting the Task service.
org.wso2.carbon.policy.mgt.common.PolicyMonitoringTaskException: Policy monitoring is not enabled in the cdm-config.xml
Thank or your reponse
Tof
Enable <MonitoringEnable> inside <PolicyConfiguration> in /core/repository/conf/cdm-config.xml. Then restart server.
Monitoring Enable should be true in MonitoringEnable element not "Enable".

Do I need to be configured as a publisher to do request/response (full dupllex) between endpoints configured AsA_Server in NServiceBus?

I am only using Bus.Reply() (not Bus.Publish()) in my endpoints (all configured AsA_Server). When I fire one of them up, I get the following warning:
2013-02-27 14:11:02,574 [Worker.15] WARN NServiceBus.Unicast.UnicastBus [(null)
] <(null)> - Subscription message from [not the currently running endpoint's queue]#my machine arrived at this endpoint, yet this endpoint is not configured to be a publi
sher.
Do I need to be configured AsA_Publisher in order to do request/response between endpoints configured AsA_Server? The full duplex sample does not seem to give any additional guidance in this area.
Per Andreas Ohlund:
That's just a warning, turn off auto subscriptions to avoid it.
Code to do this:
Configure.UnicastBus().DoNotAutoSubscribe();
Also per Andreas, AutoSubscription will only apply to IEvent messages.