I am play with Grafana, reading some metrics from a Rails app, just for test propose.
My data is something like that:
{:endpoint=>"POST_ItemsController#create", :duration=>2938.779, :view_runtime=>2901.051}
But I don't know how (if is possible) show the endpoint name in the Graph, my query:
SELECT "duration", "endpoint" FROM "endpoint_stats" WHERE $timeFilter
And the result:
String are not supported here ?
Thanks in advance
To sum up my comments: You can archive this by saving the endpoint name as tag and using Alias By(..). See the following a screenshot from grafana play:
Source
Related
The situation is i'm using telegraph for sending data to influxDB and Grafana(5.1.3) to visualize.influxDB storing the data in below formate
api.service-v1.request.status.total
api.service-v1.response.size
api.service-v1.upstream_latency
api.service-v1.user.consumer-001.request.count
api.service-v1.user.consumer-001.request.status.200
api.service-v1.user.consumer-001.request.status.429
api.service-v1.user.consumer-001.request.status.499
api.service-v1.user.consumer-001.request.status.total
And I'm like to create a dynamic dashboard based on service, consumer, and its status and more metrics. Can you please help me on this.
We have Find out the solution.
we can create a $service variable with query(show measurements;) and regex(/.*api.([^.]*).*/) to filter service name.
second variable for $consumer and query(show measurements;) with regex option(/.*api.$service.user.([^.]*).*/) these variable we can use to visualized graph using toggle edit mode in grafana.
Thanks
I'm trying to retrieve the individual keyword/query performance report from adwords using the google adwords api across all of our campaigns, but at the moment when I run my query I'm only getting results for queries from our shopping campaigns and I'm confused as to why that would be. The report_query I'm using is as follows
report_query = (
'SELECT AdGroupId, AdGroupName, Keyword, AdGroupStatus, CampaignName, Clicks, Impressions, Cost, Query '
'FROM SEARCH_QUERY_PERFORMANCE_REPORT '
'DURING 20180520,20180522');
f = open('H:/eCommerce/Business Team/Brad Davis/python/google_keyword_performance.csv', 'wb')
report_downloader.DownloadReportWithAwql(
report_query, 'CSV',f, skip_report_header=False,
skip_column_header=False, skip_report_summary=True,
include_zero_impressions=True)
Does anyone have any insights into why this might be? Thank you for your help.
Brad
You might try adding a where clause for the ad network. Here's how it's done in PHP.
->where('AdNetworkType1')->equalTo('SEARCH')
The problem was that I had the incorrect account id (or more correctly, I was given the incorrect account id by multiple people before one of them came back to me and corrected it) associated with the .yaml file loaded with the authorization information. Once I fixed that, everything worked.
InfluxDB announced Prometheus remote write/read api in ver1.4.
https://docs.influxdata.com/influxdb/v1.4/supported_protocols/prometheus/ https://www.influxdata.com/blog/influxdb-now-supports-prometheus-remote-read-write-natively/
I have deployed a new InfluxDB, created a user called "paul" with password 'foo', created a database called "prometheus" and filled with sample data:
Then, I modified the config yml of Prometheus (I found the '*' in influx doc example should be replaced by '-')
I believe Prometheus and InfluxDB are communicating:
However, I cannot find the sample measurement I inserted in InfluxDB.
I am sure I must miss something simple.... Did I do any silly mistakes? Thanks
We found that the metrics were all put into a single measurement called '_' within the INfluxDB database that we chose (called "metrics", in our case) with the field being 'f64' (float64, I assume). The Prometheus measurement name was attached as a label: 'name'. So, in my experience, the InfluxDB query for your measurement above might be something like:
select "f64" from "prometheus"."_" where "__name__" = "prometheus_target_interval_length_seconds_count"
I have created an Azure Stream Analytics (ASA) job to filter data based on a custom header property i send from a client app.
How would i read/filter message header properties in Azure stream analytics?
The portal return no results when i try to test out my query. Below is my query in azure portal.
So far this is my query as simple as this:
SELECT
*
INTO
[mystorage]
FROM
[iothubin]
WHERE Properties.type = "type1"
I also tried to call out the key without its parent (such as: where type = "") with no results as well.
I am sure that i am sending messages with this custom property in the header since i can view it using device explorer tool.
any idea how to get this working?
I haven't tried this yet myself, but supposedly you can access custom properties via GetMetadataPropertyValue(). Give this a try:
https://msdn.microsoft.com/en-us/library/azure/mt793845.aspx
You can use the query described here as an example to query complex schemas.
If you share your schema, we can look at the query for you.
Let me know if it works for you.
Thanks,
JS
I'm trying to find a link which allows me to download a CSV formatted version of my Google Spreadsheet. Currently I'm using:
https://docs.google.com/spreadsheets/d/DOCID/export?format=csv
This works great except that it only download the first Sheet. My document has multiple sheets. Does anyone know how to format this link so that it downloads either all the sheets or a specific sheet? Something like:
&sheet=all
or
&sheet=3
Every document in Google Sheets supports the "Chart Tools datasource protocol", which is explained (in a rather haphazard way) in these articles:
"Creating a Chart from a Separate Spreadsheet"
"Query Language Reference"
"Implementing the Chart Tools Datasource Protocol"
To download a specific sheet as a CSV file, replace {key} with the document's ID and {sheet_name} with the name of the sheet to export:
https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}
The datasource protocol is quite flexible. Various other options include:
Response Format: Options include tqx=out:csv (CSV format), tqx=out:html (HTML table), and tqx=out:json (JSON data).
Export part of a sheet: Supply the range={range} option, where the range can be any valid range specifier, e.g. A1:C99 or B2:F.
Execute a SQL query: Supply the tq={query} option, such as tq=SELECT a, b, (d+e)*2 WHERE c < 100 AND x = 'yes'.
Export textual data: Supply the headers=0 option in case your fields contain textual data, otherwise they might be cut out during export.
Open your Google sheet
Click the "Share" button and configure "Anyone with the link can view"
Press F12 to launch debugging tools in your web browser and select the "Net" tab.
Select "File -> Download As -> Comma-separated values .csv current sheet" (or whatever format you want, e.g. xlsx, ods, pdf, html, csv, or tsv)
Copy the URL of the GET request from the "Net" tab
It will look something like this:
https://docs.google.com/spreadsheets/d/KEY/export?format=csv&id=KEY&gid=SHEET_ID
Note, the "gid" parameter is the sheet ID, which you can find at the end of the URL of the open Google sheet.
Reference: https://developers.google.com/sheets/api/guides/concepts#sheet_id
This is a sample csv data can be downloaded. Download link for this data was made like this
Open google sheet-> Blank ->File->Open
Open file from "My Drive" or "Upload"
File -> Publish to the web -> "Sheet name" option and "csv" option
As of November 2020, the most elegant and simplest solution seems to be buried in #jrc's reply:
https://docs.google.com/spreadsheets/d/KEY/export?format=csv&gid=SHEET_ID
Here's a live example; given the Google Sheet that has a KEY of 1CTgM1g_aYoWFFpHU6A_qyqWGH0ulCFhs67uAcRVf1Rw
i.e: https://docs.google.com/spreadsheets/d/1CTgM1g_aYoWFFpHU6A_qyqWGH0ulCFhs67uAcRVf1Rw
To get the permalink to a CSV export of its first sheet (i.e. gid=0), append: /export?format=csv&gid=0:
https://docs.google.com/spreadsheets/d/1CTgM1g_aYoWFFpHU6A_qyqWGH0ulCFhs67uAcRVf1Rw/export?format=csv&gid=0
Note: if you're just exporting the first sheet, i.e. gid=0, then the URL is the same as the URL format posited in the original question, i.e.
(by default, the endpoint will assume gid=0 if it's left unspecified)
https://docs.google.com/spreadsheets/d/DOCID/export?format=csv
2021 update...
Question has been well answered in another post.
I'll add some things to look out for ...
On the "publish to web" there are:
Drop downs with options to choose the format and,
A choice on which sheets you want included,
Lastly a checkbox to ensure changes are republished
Publish to Web Google Sheets
I've developed an handy python command line application called google-sheets-to-csv few month ago: https://pypi.org/project/google-sheets-to-csv/ which allow to download multiple sheets at once.
Basic usage on linux (probably works on windows as well, I haven't test):
pip install google-sheets-to-csv
gs-to-csv <spreadsheet ID> <sheet selector (regex)> <output directory>
where:
<Spreadshhet ID>: is the weird data in the url https://docs.google.com/spreadsheets/d//
<sheet selector (regex)>: is a regular expression https://en.wikipedia.org/wiki/Regular_expression
<output directory> is an existing directory on your file system
To download all the sheets at once you can do:
mkdir output/
gs-to-csv DOCID ".*" output/
You'll find one file per sheet.
Do not miss details in the project README ( regarding authentification the current published token is not yet validated by google you'll get an authentification warning like in this video used for the validation process: https://youtu.be/7zacMyv_ooU?t=73) If are afraid you can read the code here https://gitlab.com/micro-entreprise/google-sheets-to-csv (it's Open source software!) or use a google service account.
The following URL format (as a template string) is the only one that worked from me:
`https://docs.google.com/spreadsheets/d/e/${id}/pub?output=csv&id=${id}&gid=${gid}`
This assumes the entire document has been published to the web.