Monitor API hits queries on a RTC server and kill them after a timeout - api

I'm using RTC plain java library to make an API call to the Jazz server to fetch components, projects, etc. Is there any way to monitor the database queries triggered on the server-side either through UI or by using any tool and kill them after a timeout.
Although we can see the active queries under 'Activr Service' page on UI, there isn't a way to kill them.

Related

Monitoring Yarn/Cloudera application logs in production

I am NOT talking about Cloudera or Yarn system level logs. I am talking about applications running on Cloudera/Yarn infrastructure.
We have tens of Java and Python applications running on our Cloudera Infra, and all of them generate application logs. I am looking for the best way to monitor these logs for any errors and warnings. If it is a pure stand alone Java application, traditionally we can use one of these log scraper tools that send emails based on an expression matching (to detect error/warning/any other special situation). I am looking for something similar, that can monitor our application logs and emails us in real time for better production application support.
If thinking about this like a traditional application log monitoring is not the right way, then I am happy to know if there are any better industry standard approaches. Thanks!
I guess the ElasticStack (https://www.elastic.co/de/) could be one approach to solve this. You could use FileBeats to send your application logs to Logstash which forwards it to ElasticSearch. You could then create a Watcher in Kibana which sends i.e. Emails based on some triggering condition (we use a webhook to send notifications into a MS Teams channel).
This solution should work at least in near-realtime (~1-2 minutes delay, but this also depends on your watcher configuration).

What is the programmatic way to disconnect an agent in Bamboo?

Jenkins has a programmatic mechanism for taking nodes offline, is there an equivalent for Bamboo? Ideally I could trigger an offline disconnect after the agent finishes any currently executing jobs.
What is the programmatic way to disconnect a node in Jenkins?
You can achieve this using the Bamboo REST API. Here is a link to the specific call DELETE /agent/{agentId}.

Redis connection settings for app "surviving" redis connectivity issues

I'm using azure redis cache for certain performance monitoring services. Basically when events like page loads, etc occur, I send a fire and forget command to redis to record the event. My goal is for my app to function fine whether or not it can contact the redis server. I'm looking for a best practice for this scenario. I would be OK with losing some events if necessary. I've been finding that even though I'm using fire and forget, the app staggers when the web server runs into high latency or connectivity issues with the server.
I'm using StackExchange.Redis. Any best practice configuration options/programming practices for this scenario?
The way I was implementing a singleton pattern on the connection turned out to be blocking requests. Once I fixed this my app behaves as I want (e.g. it still functions when redis connection dies).

How to execute a SQL-query to osquery remotely?

I was able to find that osquery can work in interactive mode (osqueryi) and in daemon mode (osqueryd), in which it will periodically execute SQL queries in the background on a localhost.
How about remote execution of SQL queries - for example, REST service or JDBC-driver?
When osquery is running in daemon mode, you can enable the distributed query facilities. When this is enabled, osqueryd will periodically check in to a remote server to see whether there are queries for it to execute (typical intervals for this check range from 10 seconds to 1 minute).
Note that due to the nature of the environments that osquery runs in, the osquery agent does not listen for incoming connections. It only ever makes outgoing connections to a remote server to check for queries to execute.
To take advantage of this, you need a server implementing the osquery remote APIs. There are a handful of open-source options available:
Fleet (disclaimer: I build this)
Zentral
Doorman
SGT
Security note: providing remote execution on an osquery agent can be very dangerous since it can retrieve sensitive information on the device it runs on. If you plan to serve some sort of a web page allowing direct queries on your agent, be aware that since osquery provide an SQL abstraction of your system, it can be vulnerable to injections.

IBM Worklight - Connecting/Re-Connecting: WL.Client.connect vs. connectOnStartup vs. WL.Client.invokeProcedure

In our project we are trying to figure our what the best process to connect to the server will be - especially when taking care of offline/online scenarios etc.
Right now, for us, it seems that all three options to connect to the WL server are similar. Whatever option we use, we can call our Adapter Procedures perfectly and we receive Notification Messages that are set in the console.
We are not sure about Direct Update - this is not working properly yet.
Are there any important differences between these three ways of connecting to the WL server, or is basically the same connection procedure being executed in all three cases?
How about WL.Client.init() before connecting - could we call that again (in addition to the standard window load EventListener) in our code before we connect using a WL.Client.connect manually - or is init() supposed to be called only once?
Tied to that is also offline and re-connecting.
As far as I have read in the tutorials, the WL Client framework is managing the connection state. Does that mean that when the WL client is connected to the server through any of these three ways and loses it's WLAN/3G/4G connection (or it's access to the WL server due to internet connection blocker or so) it re-connects automatically (regularly tries to re-connect until successful) when a connection to the WL server is available again?
EDIT
I was thinking about Events or Threads that provide more low-level information (not WORKLIGHT_IS_CONNECTED) - basically events that would be triggered when the device loses/gets WIFI/3G/4G connection and/or internet connection. Or is there only polling using WL.Device.getNetworkInfo() available?
Would the use of Cordova Event like:
document.addEventListener("offline", yourCallbackFunction, false);
provide a functionality close to that?
Though those three ways do have some similarities the differences between them are very important.
WL.Client.init() initializes client side WL framework.
WL.Client.connect() triggers connection request to WL server.
initOptions.connectOnStartup defines whether WL.Client.connect() will be invoked automatically during WL.Client.init().
In general - most of the functionality (e.g. adapters, remote disable) will function even if you call WL.Client.invokeProcedure() without calling WL.Client.connect(). But there are several things that will not function:
You will not be able to fully utilize push notifications without calling WL.Client.connect()
Direct update is triggered during WL.Client.connect()
WL.Client.connect() will get security related info from server, e.g. names of realms, whether user authenticated in those realms etc. Therefore all APIs like WL.Client.getUserInfo, .isAuthenticated(), .getUserName() etc will not function.
It is strongly recommended to start your session with WL.Client.connect() (or initOptions.connectOnStartup=true).