-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
enhancement(observability): Events processed metrics for Topology
#4472
Conversation
Signed-off-by: Lee Benson <lee@leebenson.com>
Signed-off-by: Lee Benson <lee@leebenson.com>
Signed-off-by: Lee Benson <lee@leebenson.com>
Signed-off-by: Lee Benson <lee@leebenson.com>
@leebenson should we remove all of these as well? I'm also curious about which other metrics we can move into the topology? |
@leebenson you might want to review #4427, which I think addresses topology-level metrics. |
As long as a metric's span is being associated with a I'll be attempting this later today with 'errors' and other metrics types, so -- touch wood -- should have the necessary plumbing already. Looks like #4427 might shift things around a bit, which I'll keep an eye on. |
use tokio::stream::{Stream, StreamExt}; | ||
use tokio::time::Duration; | ||
|
||
lazy_static! { | ||
static ref GLOBAL_CONTROLLER: Arc<Mutex<&'static Controller>> = Arc::new(Mutex::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this imply that all our metrics emit code will be interacting with blocking mutexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is actually old code. It's been removed in #4431. I initially thought it would be necessary to lock the controller for reads, since GraphQL resolvers are async and could be pulling from stats simultaneously. But the Controller
is already capable of parallel reads.
Closing this, as it's been merged into - and overtaken by - #4431 |
This should still be exactly the same with #4427 |
Adds a
EventsProcessed
metrics to theTopology
interface, and all implementing topology types.Screenshot
Queries
Events processed metrics can be queried against the
Topology
interface, or individually on the filtered topology types, e.g:Or:
Implementation
I've added a new
GLOBAL_CONTROLLER
, used to aggregate stats across the life of the API server. This can be used alongside the existingget_metrics()
func, that samples over a provided interval.