How to monitor client version distribution parsed from user-agent headers? - google-cloud-stackdriver

I have a native app that is configured to include a version number in the user-agent request header in a regex-parseable format. I'd like to include a metric in a Cloud Monitoring dashboard that shows me a distribution of major/minor versions (and perhaps patch versions?) of the total requests over a period.
What I'm ideally looking for is a histogram or stacked bar chart of the share of each major/minor version as a percentage of the total requests in that time period.
I can set up a logs-based metric based on the major/minor version but the only way to display it in a dashboard is as a heatmap and that's not a proper representation.

Google Monitoring, previously called stack driver, by default allows you to configure dashboards for the custom metrics you are selecting from the log files. However, if these dashboards are being useful to plot your data in a desired format you can use python code libraries and create your own custom dashboards displaying your custom data. Google-cloud-monitoring-dashboards python package helps you in creating your custom dashboards, refer to its documentation for more details.

Related

How to consume Google PubSub opencensus metrics using GoLang?

I am new in Google PubSub. I am using GoLang for the client library.
How to see the opencensus metrics that recorded by the google-cloud-go library?
I already success publish a message to Google PubSub. And now I want to see this metrics, but I can not find these metrics in Google Stackdriver.
PublishLatency = stats.Float64(statsPrefix+"publish_roundtrip_latency", "The latency in milliseconds per publish batch", stats.UnitMilliseconds)
https://github.com/googleapis/google-cloud-go/blob/25803d86c6f5d3a315388d369bf6ddecfadfbfb5/pubsub/trace.go#L59
This is curious; I'm surprised to see these (machine-generated) APIs sprinkled with OpenCensus (Stats) integration.
I've not tried this but I'm familiar with OpenCensus.
One of OpenCensus' benefits is that it loosely-couples the generation of e.g. metrics from the consumption. So, while the code defines the metrics (and views), I expect (!?) the API leaves it to you to choose which Exporter(s) you'd like to use and to configure these.
In your code, you'll need to import the Stackdriver (and any other exporters you wish to use) and then follow these instructions:
https://opencensus.io/exporters/supported-exporters/go/stackdriver/#creating-the-exporter
NOTE I encourage you to look at the OpenCensus Agent too as this further decouples your code; you reference the generic Opencensus Agent in your code and configure the agent to route e.g. metrics to e.g. Stackdriver.
For Stackdriver, you will need to configure the exporter with a GCP Project ID and that project will need to have Stackdriver Monitor enabled (and configured). I've not used Stackdriver in some months but this used to require a manual step too. Easiest way to check is to visit:
https://console.cloud.google.com/monitoring/?project=[[YOUR-PROJECT]]
If I understand the intent (!) correctly, I expect API calls will then record stats at the metrics in the views defined in the code that you referenced.
Once you're confident that metrics are being shipped to Stackdriver, the easiest way to confirm this is to query a metric using Stackdriver's metrics explorer:
https://console.cloud.google.com/monitoring/metrics-explorer?project=[[YOUR-PROJECT]]
You may wish to test this approach using the Prometheus Exporter because it's simpler. After configuring the Prometheus Exporter, when you run your code, it will be create an HTTP server and you can curl the metrics that are being generated on:
http://localhost:8888/metrics
NOTE Opencensus is being (!?) deprecated in favor of a replacement solution called OpenTelemetry.

Getting regional stats data from Steamworks API

I am working on a project that involves connecting to Steamworks Web API to fetch statistical information related to a number of games. I have a Web API Key and also, a list of Application IDs for the games I am interested in. After going through the entire Steamworks API I was unable to find an endpoint that satisfies my requirements.
I am looking for statistics related to different regions of the game. I want to know the number of active players in the region. The only relevant endpoint I found (not sure if this is what I am looking for is) GetGlobalStatsForGame endpoint found here. From what I understood, this endpoint can be used to get aggregated values for certain values related to the game. Now, in order for this to work, I need to know what available Global Stats are actually used by the game. Looking at the Global Stats documentation here I can see that there is a function called RequestGlobalStats. However, this involves using a Steamworks sdk.
Is there a way I can request the global stats using the Steamworks Web API? If so, how can I do that? Are there any other endpoints that gives the name for each of these desired values?
Is there a way I can request the global stats using the Steamworks Web API?
You can check out what stats a game provideds with GetSchemaForGame like this: https://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/?key=YOUR_API_KEY&appid=730.
CS GO for example does not have any regional game stats.
Unless developers supply that this information in their game statistics, there is no way with the API to find the information you are looking for.
You have to manually check every stats for the 400000+ games on Steam. I doubt many games have this information.

How to view "Events per second" in Logstash?

I am building an alert using Elasticsearch and I need to access the data for one of the logstash nodes for how many events it is receiving per second. On the Monitoring (formally Marvel) tab, this information is readily available in graph format. Is there anyway to get that same information using an ELK API aside from scripting something?
Take a look at the Logstash Metrics filter plugin

How to create real time application for Log Analysis

I am new to Elasticsearch, Logstash and Kibana by using this tutorial i just played around it. Now I want to know how to create real production application for Log Analysis including login and securities model. Is there any way to achieve with kibana.
A fairly vague question, but...
In Kibana 3, you setup dashboards that are made up of "panels". Each panel can be a different type (histogram, pie chart, etc). Each panel can chart one or more queries.
In Kibana 4 (still in beta), it's a more explicit multi-step process. You create "visualizations", which, like panels, are components that you'll use in dashboards.

Graphite Dashboard viewer for mobile device

I have gone through various documentations on Graphite (Performance Monitoring Tool) to explore if Graphite supports any options to view dashboards on mobile platforms e.g. smart phones, iPad, tablets.
As mentioned here too, I understand that Graphite allows you to query your data, both graphically and returning csv but is there any quick way to integrate Graphite with mobile devices.
Similar product OpenNMS is progressing on iOS app.
Try Grafana (http://grafana.org) it is a new dashboard frontend for graphite.
I posted the same question at Graphite Portal too https://answers.launchpad.net/graphite/+question/227267 but haven't heard yet. So adding my findings so far on same.
As of date Graphite doesn't offer any readily available option (mobile web interface or app) to render graphs and dashboards best suited to mobile devices i.e. phones and tablets. Graphite URL API however allows options to customize graphs as per business requirements.
The graphite webapp provides a /render endpoint for generating graphs (and retrieving raw data). This endpoint accepts various arguments via query string parameters e.g. defining a time window for the graph via from / until.
Below URL requests (JSON) CPU Usage metrics for app servers 401 through 405 in last 1 hour time frame. Note that removing “format=json” request attribute returns graph as image in PNG format (default Graphite behavior).
http://graphite06p.prod.s.com/render/?format=json&until=now&from=-1Hours&showTarget=applications.jboss.app40%5B12345%5Dp_prod_ch4_s_com.jvm.cpuUsage&title=JVM%20%20-%20CPU%20Utilization&_salt=1367342114.856&target=applications.jboss.app40%5B12345%5Dp_prod_ch4_s_com.jvm.cpuUsage
Enterprises can create mobile web app such that server component first fetches raw data from Graphite using above mentioned URL API and then make any required customizations before returning the HTML content back to device browser. For example, the JSON data received from Graphite can be plotted using Javascript library FLOT or ZingChart. Hybrid or native apps too can be built around this approach. Any additional inputs or suggestions are most welcome.

Resources