Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting timestamp in prometheus exporter #3726

Closed
kotharironak opened this issue Oct 11, 2021 Discussed in #3696 · 2 comments
Closed

Supporting timestamp in prometheus exporter #3726

kotharironak opened this issue Oct 11, 2021 Discussed in #3696 · 2 comments

Comments

@kotharironak
Copy link
Contributor

Discussed in #3696

Originally posted by kotharironak October 6, 2021
As per otel metrics proto, each metric's NumberDataPoint has a timestamp - [time_unix_nano](https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto#L376) - for recording the moment when the observation was aggregated.

But, in the Prometheus-exporter, this value is ignored while creating samples (link of createSample function). In my understanding, it is designed from sdk point of view and use in the application, so it will be a scrap moment when these metrics were collected.

I am looking into Kafka sink kind of a job where otlp metrics converted Prometheus format. I would like to re-use this exporter library. In that context, is there a way to support the time_unix_nano in this library while exporting? Can we make this library generic?

e.g Should we extend the signature of createSample to take timestamp?

Sample createSample(
    String name,
    List<String> labelNames,
    List<String> labelValues,
    double value,
    @Nullable ExemplarData exemplar,
long epochNanos)
@kotharironak
Copy link
Contributor Author

looking into this.

@jack-berg
Copy link
Member

Closing with the merging of #3700.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants