Add series to measurement(prometheus)

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

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”)?

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

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.

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.

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


zqq,

Did you resolve that issue?

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”.

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

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?

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.

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

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?

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.

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:

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

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

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)?

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.

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