Add series to measurement(prometheus)

time-series
#1

Hello All,

We have prometheus that gathers data and store them in influxdb. However, when I execute ‘SHOW MEASUREMENTS’, I am not seeing any but when I execute ‘SHOW SERIES’ I can see thousands of entry.

I was trying to use INTO in the query but it requires measurement and in my case, I can see nothing. Please help me on how can I do this?

PS - I am new to influxdb

#2

Wouldn’t you need to select the database in the show measurements query (show measurements on db) or set the database prior to the show query (using “use db”)?

#3

Hello dmuiruri,

before I execute show mesurement, I first execute use

steps I performed:

  1. USE
  2. SHOW MEASUREMENTS -->nothing shows
  3. SHOW SERIES --> I can see thousands of entry

What I need is to remove/delete series

#4

Ok, the db would anyway ask you to set the database.

Well, consider to show a sample input of the line protocol or some output of the indicated series, anything that could help someone reproduce the error.

#5

I had encountered a problem that is opposite to yours. It’s related to retention policy.
I write to self-defined retention policy(not default one).
Show series shows nothing; Show measurement show the measurement I write to.

#6

Here’s the sample output for ‘SHOW SERIES’. I removed the values for company rules

_,name=up,az=ap-northeast-1c,domain=<removed_value>,env=<removed_value>,job=Process(Linux),name=<removed_value>,private_ip=<removed_value>,role=csr,service=<removed_value>,subnet_id=,subnet-c376bc98,system=<removed_value>,vpc_id=<removed_value>

Here’s for ‘SHOW MEASUREMENTS’

SHOW MEASUREMENTS
name: measurements
name


#7

zqq,

Did you resolve that issue?

#8

In the show series results you posted how many series are those: two series, one or more? I would think that the dumped result would show something like each series for single line.

Additionally it seems the line starts with an underscore which begs the question if the name of the series is omitted by design or that’s part of the “invisibility”.

#9

On a second look seems like one series, are there any other series and do all start with the underscore?

#10

dmuiruri,

How can I count the number of series. If what I showed will count as one then there are thousands of series

For the underscore, I honestly don’t know if it’s by design or not because it’s already setup before I use the influxDB

Should a measurement automatically created if prometheus writes data to influxdb?

#11

The position of the underscore is where the name of the measurement would appear following the show series command. So the underscore and the empty show measurement results seem to point towards the same issue…measurement name.

The db shouldn’t allow an empty string for a measurement name, nonetheless worthwhile to check if those names are what you expect them to be.

#12

No.
It seems that show series of default retention policy.

#13

dmuiruri

so for example the series has _ec2 instance in the beginning. Are you saying that when I execute ‘SHOW MEASUREMENTS’ command I should see “ec2 instasnce”.

Should the measurement autmatically created?

#14

Indeed, a series is generated from a given measurement, there wouldn’t be a series if a measurement with that series did not exist.

If a measurement has X unique tag values, then X series will be generated from that particular measurement.

#15

dmuiruri

Do you mean, that I should create a measurement first before series is created?
Apologies, I just want to make it clear :slight_smile:

#16

By the way, in the result of my command _,_name. the measurement is empty because comma follows underscore?

#17

When creating the input to the database say in the line protocol, the measurement name is that first item in this case “payment”

insert payment,device=mobile,product=Notepad,method=credit billed=33,licenses=3i 1434067467100293230

insert another line to the db with a different value in the billing “method”

insert payment,device=mobile,product=Notepad,method=cash billed=33,licenses=3i 1434067467100293230

After a few entries, the result would be a measurement table looking as follows as (not so well formatted):

name: payment
time billed device licenses method product


2015-06-12T00:04:27.10029323Z 33 mobile 3 Gold Notepad
2015-06-12T00:04:27.10029323Z 33 mobile 3 credit Notepad
2015-06-12T00:04:27.10029323Z 33 mobile 3 cash Notepad
2015-06-12T00:04:27.10029323Z 40 mobile 3 bitcoin Notepad

Show series would show

payment,device=mobile,method=Gold,product=Notepad
payment,device=mobile,method=bitcoin,product=Notepad
payment,device=mobile,method=cash,product=Notepad
payment,device=mobile,method=credit,product=Notepad

show measurements

payment

#18

Hello dmuiruri,

Say for example, I successfully inserted a measurement(payment) manually in the influxdb. My question is, what will happen to the points that will be written next from prometheus to influxdb. Will the points automatically be written into the measurement(payment)?

#19

They should be written, particularly so if they record the same measurement (payment).

However, I’m not sure what is meant by “automatically”, the database and measurement name must be indicated correctly to influxdb.

I am still puzzled by what is the measurement name in your earlier sample of the db entry, could it be that your measurement name is an an underscore ( _ )? and in that case, listing measurements would show an underscore.

#20

Hello dmuiruri

Finally understand it. Yes, the measurement name is an underscore(_). Though another problem occurred.

When I execute a sample query:
select * from “autogen”."_" where “az” = “ap-northeast-1c”

There’s no result at all