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

Support interval counters #32

Closed
jkschneider opened this issue May 30, 2017 · 6 comments
Closed

Support interval counters #32

jkschneider opened this issue May 30, 2017 · 6 comments

Comments

@jkschneider
Copy link
Contributor

A counter that also keeps track of the time since last update (in the form of a gauge).

@checketts
Copy link
Contributor

Would this be like:

uptime 1000.0

If the service has been up for 1000 seconds?

I seem to recall Prometheus preferring unix epoc style as in

process_start_time (https://github.com/prometheus/client_java/blob/master/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/StandardExports.java#L80)

@jkschneider
Copy link
Contributor Author

This is just a counter with an additional gauge that represents the time since the last counter increment. So if you had some sort of cancellable scheduled process, for example, and you wanted to alert if this process didn't complete at least once a day.

@jkschneider jkschneider added this to the 0.10.0.RELEASE milestone Aug 4, 2017
@jkschneider jkschneider modified the milestones: 0.10.0.RELEASE, 0.11., 0.11.0.RELEASE Aug 18, 2017
@jkschneider jkschneider modified the milestones: 1.0.0-rc.1, 1.0.0-rc.2 Sep 15, 2017
@jkschneider jkschneider modified the milestones: 1.0.0-rc.2, 1.0.0-rc.3 Oct 6, 2017
@jkschneider jkschneider removed this from the 1.0.0-rc.3 milestone Nov 1, 2017
@jkschneider jkschneider added this to the 1.1.0 milestone Feb 14, 2018
@jkschneider
Copy link
Contributor Author

It may make sense to create an IntervalTimer as well to measure gaps between events.

@kevcodez
Copy link

kevcodez commented Apr 20, 2018

I recently opened a Stackoverflow Thread and was linked here to share my use case.

I'd like to track scheduled jobs in my spring boot application.

There are multiple use-cases:

  • See the timestamp of the latest invocation of a specific scheduled job
  • See invocation timestamps of scheduled jobs historically
  • See how long a scheduled job took

This could be combined to something like (just to get an idea of what I am saying)

[
  {
    "jobname": {
      "invocations": [
        {
          "took": 1,
          "start": "2018-08-17T18:00:00.001Z",
          "end": "2018-08-17T18:00:00.002Z"
        }
      ]
    }
  }
]

I actually expected that behaviour when using @Timed on a @Scheduled method.

@checketts
Copy link
Contributor

@kevcodez How would this be exported to different monitoring backends? I think it could only be consumed by a person (or a tracing backend)

Application observability falls into 3 categories: logging, tracing, and metrics. Micrometer is really focused around metrics.

I'm not trying to shutdown your request but metrics focuses on aggregation and scalability. What you are describing aligns quite well with tracing. Have you looked into using Zipkin? (We've done some dabbling to create timers that offered tracing at the same time, but that doesn't exist yet see #207 )

@jkschneider jkschneider modified the milestones: 1.1.0-rc.1, 1.2.0 Oct 12, 2018
@jkschneider jkschneider modified the milestones: 1.2.0, 1.x Oct 26, 2018
@marcingrzejszczak marcingrzejszczak removed this from the 1.x milestone Dec 21, 2023
@marcingrzejszczak
Copy link
Contributor

There was no issues on this topic since 2018. We have tracing, metrics and exemplars that can achieve similar goals. Let's close this issue for now and if there's any interest in this, please add your comment and we'll consider re-opening it.

@marcingrzejszczak marcingrzejszczak closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2023
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

4 participants