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

enhancement(observability): Events processed metrics for Topology #4472

Closed
wants to merge 7 commits into from

Conversation

leebenson
Copy link
Member

Adds a EventsProcessed metrics to the Topology interface, and all implementing topology types.

Screenshot

Screenshot 2020-10-09 at 14 18 44

Queries

Events processed metrics can be queried against the Topology interface, or individually on the filtered topology types, e.g:

{
  topology {
    __typename
    name
    eventsProcessed {
      eventsProcessed
    }
  }
}

Or:

{ 
  sources {
    eventsProcessed {
      timestamp
      eventsProcessed
    }
  }
}

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 existing get_metrics() func, that samples over a provided interval.

Signed-off-by: Lee Benson <lee@leebenson.com>
Signed-off-by: Lee Benson <lee@leebenson.com>
@leebenson leebenson added type: enhancement A value-adding code change that enhances its existing functionality. domain: observability Anything related to monitoring/observing Vector labels Oct 9, 2020
@leebenson leebenson added this to the 2020-09-28 - Derezzed milestone Oct 9, 2020
@leebenson leebenson self-assigned this Oct 9, 2020
@binarylogic
Copy link
Contributor

binarylogic commented Oct 11, 2020

@leebenson should we remove all of these as well?

https://github.com/timberio/vector/blob/9b1eada50e8679bfe4f4e97660ef8cf6e2090dae/src/internal_events/add_tags.rs#L9

I'm also curious about which other metrics we can move into the topology?

@binarylogic
Copy link
Contributor

@leebenson you might want to review #4427, which I think addresses topology-level metrics.

cc @lukesteensen

@binarylogic binarylogic requested review from lukesteensen and removed request for JeanMertz October 13, 2020 02:44
@leebenson
Copy link
Member Author

I'm also curious about which other metrics we can move into the topology?

As long as a metric's span is being associated with a component_name when it's emitted, then we can consume it from within GraphQL already. The resolvers just need implementing for the GraphQL schema to pull them out.

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(
Copy link
Contributor

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?

Copy link
Member Author

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.

@leebenson
Copy link
Member Author

Closing this, as it's been merged into - and overtaken by - #4431

@leebenson leebenson closed this Oct 14, 2020
@leebenson leebenson deleted the leebenson/source-events-processed branch October 14, 2020 08:57
@lukesteensen
Copy link
Member

As long as a metric's span is being associated with a component_name when it's emitted, then we can consume it from within GraphQL already.

This should still be exactly the same with #4427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: observability Anything related to monitoring/observing Vector type: enhancement A value-adding code change that enhances its existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants