Skip to content

Unclear if timestamps in text format must be milliseconds or seconds #1528

@aspyct

Description

@aspyct

Hello,

The exposition format documentation specifies that the timestamps must be expressed in milliseconds:

The timestamp is an int64 (milliseconds since epoch, i.e. 1970-01-01 00:00:00 UTC, excluding leap seconds), represented as required by Go's [ParseInt()](https://golang.org/pkg/strconv/#ParseInt) function.

However, when I use promtool to generate blocks from data, it seems to expect timestamps in seconds. Also, the OpenMetrics specifications (which I believe is the exposition format explained by the other document) says that the timestamp must be specified in seconds:

Timestamps MUST be Unix Epoch in seconds.

Are these two different formats/usages?

Related to another ticket, it would be nice if it were specified that prometheus cannot ingest data older than ~1h.

A link to the promtool backfilling tools would be nice too, since that's probably what people are looking for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions