Can I use StackDriver Trace PHP application in GKE? - cakephp

I want to check latencies of RPC every day about CakePHP Application each endpoints running in GKE cluster. I found it is possible using php google client or zipkin server by reading documents , but I don't know how easy to introduce to our app though both seem tough for me.
In addition, I'm concerned about GKE cluster configuration has StackDriver Trace option though our cluster it sets disabled.Can we trace span if it sets enable?
Could you give some advices?

I succeeded to send gcp's trace api in php client via REST. It can see trace set by php client parameters , but my endpoint for trace api has stopped though I don't know why.Maybe ,it is not still supported well because the document have many ambiguous expression so, I realized watching server response by BigQuery with fluentd and DataStudio and it seem best solution because auto span can be set by table name with yyyymmdd and we can watch arbitrary metrics with custom query or calculation field.

Related

AppStats for managed VMs

We were running on AppEngine but recently moved over to Managed VMs. For some reason AppStats is no longer available? We just get a 404 not found error when browsing to our appstats URL. Is appstats not supported on Managad VMs? If not, is there a way of isolating poorly performing endpoints within our application?
One way to isolate poorly performing endpoints is to use the advanced filter search in the GCP Logs Viewer. It is a little hard to find at first.
To get there, in your Google Cloud console, navigate to Logging for your project. At the right of the text box for "Filter by label or text search" you will see a small dropdown arrow. Click that and select "Convert to advanced filter". This will allow you to write your own sql-ish query where you can find requests that took longer than n to complete.
For example, add the following to the filter:
protoPayload.latency>"0.300s"
This will return a list of all requests that took longer than 300 milliseconds to process. If you have Cloud Trace enabled, you can click on the request response time to see the timeline for the individual service calls.

Icinga 2 API - set service group in maintenance?

How does one fire off a web request to icinga2 to set a service group into maintenance? Documentation is tough to find.
We frequently encounter false positive alerts during deployment (due to app-spinup) and would like to be able to programattically disable checking on service groups until deployment is finished.
There is no unified api yet (that's something we plan for 2.4 later this year). You should use the external commands for that - given that You must first fetch all servicegroup members and send a command ffor each I'd suggest using Livestatus. Details at http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/alternative-frontends#setting-up-livestatus

How to log per request / context - Golang

I'm trying to migrate an a web app from Google Appengine to a dedicated server and I've got stuck to the logging issue. Basically I would like to organise the logs per request/context(like on GAE) so that I can easily review the errors/trace on each request. The most advanced logging library I could find is the glog package but still I can't figure it out how to log per request/context.
Each request gives you a http.Request-object to work with.
If you're using sessions, then you'll have a sessions.Session-object to work with.
You will want to use those objects to help log per request/context, as they identify the request / session.

How to stop CapeDwarf JBoss AS7 from storing logs in datastore?

I am using CapeDwarf JBoss AS7 to host classic GAE+GWT application. On server side, I am logging directly to java.util.Logger framework.
The application works fine, the logs print nice to the console and files.
However, all my logs, together with some http request logs, are also stored in the datastore. Yes, every log line becomes one datastore entity. This should not surprise me, because it is stated in the docs (http://www.jboss.org/capedwarf/docs) and it is needed in order to display logs in gae-like admin console of CapeDwarf.
I was looking for a way to disable this useful but expensive feature. I cannot find any docs that would tell me what to do if I do not need/want my logs in the datastore (e.g. right now 98.3% of my datastore are __org.jboss.capedwarf.LogRequest__ and __org.jboss.capedwarf.LogLine__ entities!). Does anyone happen to know how to do it?
Already answered on our forum: https://community.jboss.org/message/810735#810735

Search support for Google App Engine Go runtime

There is search support (experimental) for python and Java, and eventually Go also may supported. Till then, how can I do minimal search on my records?
Through the mailing list, I got an idea about proxying the search request to a python backend. I am still evaluating GAE, and not used backends yet. To setup the search with a python backed, do I have to send all the request (from Go) to data store through this backend? How practical is it, and disadvantages? Any tutorial on this.
thanks.
You could make a RESTful Python app that with a few handlers and your Go app would make urlfetches to the Python app. Then you can run the Python app as either a backend or a frontend (with a different version than your Go app). The first handler would receive a key as input, would fetch that entity from the datastore, and then would store the relevant info in the search index. The second handler would receive a query, do a search against the index, and return the results. You would need a handler for removing documents from the search index and any other operations you want.
Instead of the first handler receiving a key and fetching from the datastore you could also just send it the entity data in the fetch.
You could also use a service like IndexDen for now (especially if you don't have many entities to index):
http://indexden.com/
When making urlfetches keep in mind the quotas currently apply even when requesting URLs from your own app. There are two issues in the tracker requesting to have these quotas removed/increased when communicating with your own apps but there is no guarantee that will happen. See here:
http://code.google.com/p/googleappengine/issues/detail?id=8051
http://code.google.com/p/googleappengine/issues/detail?id=8052
There is full text search coming for the Go runtime very very very soon.

Resources