-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add optional metrics in Stackdriver surfacer to monitor channel and cache usage #262
Comments
@manugarg For implementing this, I we thinking that it should support emitting metrics in a similar way we do from probers.
This we could do in stackdriver surfacer, however if we would like log metrics from other surfacer how should we go about it? |
Since the cache implementation is different for each surfacer, I think we'll need to implement this in each surfacer individually. I'll give it more thought, but one quick way to get the info you need will be to log these metrics using logger and then create metrics from the logs in stackdriver. |
I think we can standardize internal metrics with the following labels: |
Yes, I think these labels makes sense. We can add these. |
@kushal288 So the way it works is slightly more complicated than that. We do build an EventMetrics object and pass it on surfacers through a channel. In this case, instead of pushing metrics to a channel, we can just use the surfacer's own Write() interface:
So if the option is set to export internal metrics, we'll start another loop (in the New() method) and export metrics regularly like this:
(For the structure of internalMetricsLoop, take a look at other context based loops in the same file and other places maybe?) Does it make sense, or I misunderstood your question. One thing to think about is though if you'd also like to log these metrics in case the surfacer is jammed for some reason and you would like some insights into what's going on? You can just log the metrics as ... l.Info(em.String()). Please let me know if it doesn't make sense. or is not clear. |
Yes this would work for stackdriver surfacer internal metrics. I am trying to figure out, how can we achieve this. |
Ah, I see. I guess there are a couple of ways to tackle this. I am not yet sure which one makes the most sense: (In no particular order)
Can you start with log based metrics for now, and move to a different approach if that doesn't work very well. |
Yes we will use logs based metrics for monitoring. Thanks for your support! |
For stackdriver surfacer, since it maintains a cache of metrics, we would also like to log the metric for monitoring the length of cache and channel at regular intervals. This will be used for high throughput traffic, where metrics might get accumulated in cache.
The text was updated successfully, but these errors were encountered: