Cannot find data in Prometheus with InfluxDB remote write/read api - influxdb

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"

Related

Where do the time fields in my structured log messages come from?

I am writing out json structured log messages to stdout with exactly one time field, called origin_timestamp.
I collect the log messages using Fluent Bit with the tail input plugin, which uses the parser docker. The parser is configured with the Time_Key time.
The documentation about Time_Key says:
If the log entry provides a field with a timestamp, this option
specify the name of that field.
Since time != origin_timestamp, I would have thought no time fields will be added by Fluent Bit, however the final log messages ending up in Elasticsearch have the following time fields:
(origin_timestamp within the field log that contains the original log message)
origin_timestamp
time
#timestamp (sometimes even multiple times).
The #timestamp field is probably added by the es output plugin I am using in Fluent Bit, but where the heck is the time field coming from?
I came across the following issue in the Fluent-bit issue tracker, Duplicate #timestamp fields in elasticsearch output, which sounds like it might be related to your issue in question.
I've deep linked to a particular comment from one of the contributors, which outlines two possible solutions depending on whether you are using their Kubernetes Filter plugin, or are ingesting the logs into Elasticsearch directly.
Hope this helps.
The time field being added by the docker json plugin. Docker logging plugin takes logs from your stdout and logs to a file in following format by default:
{"log":"Log line is here\n","stream":"stdout","**time**":"2019-01-01T11:11:11.111111111Z"}
So, you might observe three timestamps in your final log:
Added by you (origin_timestamp)
Added by docker driver (time)
Added by fluent bit plugin (#timestamp)
Ref - https://docs.docker.com/config/containers/logging/json-file/

Not able to create Grafana dynamic dashboard on influxDB dot included measurement

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

How do you display a graph's replication factor in the gremlin-console?

I know for DSE graph, in gremlin-console you can create a graph with replication as follows
system.graph('graph_name').replication("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3}")
But how do you find out about an existing graph's replication?
As far as I know, right now it's not possible to do via existing interfaces inside the gremlin-console. Before 5.1.3, there were separate options that was possible to fetch via schema.config().describe(), but they were replaced with replication & systemReplication. Looks like (don't know 100%) that the strings provided via these options could be just passed to corresponding CREATE KEYSPACE commands, so if you have access to cqlsh then you can get replication factor from describe keyspace graph_name. Another possibility is to use Java code to fetch Metadata, and then extract replication factor via getReplication call.

Can we use Stardog to query .ttl files?

I'm asking myself a question : I have a .ttl file stored somewhere on the internet (let's say http://www.example/org/myFile) and I want to query it.
Can I use Stardog to query it ? Something like (in node.js)
const stardog = new Stardog({
endpoint: 'http://www.example.org'
});
and query it with a SPARQL command line ?
I'm asking myself this question because I think the .ttl file need to be stored in a Stardog instance. (and then, http://www.example.org is supposed to be a Stardog instance !)
Thanks,
Clément
It is true that you cannot query a Turtle file. You need to first load it into a Stardog database. See the Known Issues in Stardog documentation:
Queries with FROM NAMED with a named graph that is not in Stardog will not cause Stardog to download the data from an arbitrary HTTP URL and include it in the query.
If you have data stored in another SPARQL endpoint you can query it using SPARQL's federated query functionality (SERVICE keyword) without loading the data into Stardog.

Showing String in Grafana Graph

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

Resources