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): Add events_in_total & events_out_total metrics #6433

Merged
merged 6 commits into from Feb 20, 2021

Conversation

ktff
Copy link
Contributor

@ktff ktff commented Feb 12, 2021

Ref. #6367


Source events_in_total (component)

  • Emitted for each event that came from outside the source.
  • May contain labels marking the origin like: file path, IP, etc.
    • If it's emitted with the label, then it shouldn't be emitted without it.
  • This is basically equivalent to events_processed_total although there are some differences, notably generator source won't emit it.
  • Topology does emit this once for all sources without incrementing the counter so to cover the cases like generator source.

Source events_out_total (topology)

  • Emitted for each event coming out of the source.

Transform events_in_total (topology)

  • Emitted for each event passed to the transform.

Transform events_out_total (topology)

  • Emitted for each event coming out of the transform.

Sink events_in_total (topology)

  • Emitted for each event passed to the sink.
  • This differs from the original idea of emitting it on entry to buffer, which would be really useful but
    • requires switching spans which is costly to call for each event
    • there are edge cases when reusing buffers on reload whose fixes would also have performance cost
    • In theory this all is avoidable/doable but I think it deserve it's own issue since it could end up quite complex and/or not worthy of doing, plus it can easily build on top of this PR. (EDIT: Let's roll with current implementation until we decide to instrument the buffers, then we can decide to either change this metric, or add a new gauge metric)

Sink events_out_total (topology)

  • Emitted for each event acked by the sink.

@ktff ktff self-assigned this Feb 12, 2021
@ktff ktff requested review from a team, bruceg, StephenWakely and jszwedko and removed request for a team February 12, 2021 18:43
@ktff ktff added domain: metrics Anything related to Vector's metrics events domain: observability Anything related to monitoring/observing Vector type: enhancement A value-adding code change that enhances its existing functionality. labels Feb 14, 2021
@ktff ktff added this to the 2021-02-15 Scythe of Elune milestone Feb 14, 2021
Signed-off-by: ktf <krunotf@gmail.com>
Signed-off-by: ktf <krunotf@gmail.com>
Signed-off-by: ktf <krunotf@gmail.com>
Signed-off-by: ktf <krunotf@gmail.com>
Signed-off-by: ktf <krunotf@gmail.com>
Signed-off-by: ktf <krunotf@gmail.com>
@ktff
Copy link
Contributor Author

ktff commented Feb 19, 2021

cc. @jszwedko @bruceg @FungusHumungus

@lucperkins
Copy link
Contributor

I feel like these should be events_* for the sake of consistency

@StephenWakely
Copy link
Contributor

I'm not much of an expert in this area. When I run Vector is there a place I can look to see these events being emitted? They don't seem to show up in vector top.

Copy link
Member

@bruceg bruceg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as long as the metrics actually shows up (ref #6433 (comment))

@jszwedko
Copy link
Member

jszwedko commented Feb 19, 2021

@FungusHumungus the usual way I look at these is piping an internal_metrics source to a console sink. Something like:

[sources.metrics]
type = "internal_metrics"

[sinks.console]
type = "console"
inputs = ["metrics"]
encoding.code = "json"

That'll emit the metrics to stdout on an interval.

@jszwedko
Copy link
Member

It would be good to update vector top to use these instead of the current events_processed_total metric, but I think that can be done as a later step.

Copy link
Contributor

@StephenWakely StephenWakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this works nicely.

@ktff
Copy link
Contributor Author

ktff commented Feb 20, 2021

It would be good to update vector top to use these instead of the current events_processed_total metric, but I think that can be done as a later step.

Yep, there are some more preparations that need to be done before that step.

I feel like these should be events_* for the sake of consistency

@lucperkins they are in the code, it's my comments here that are out of snyc, I'll update them.

@ktff ktff changed the title enhancement(observability): Add event_in_total & event_out_total metrics enhancement(observability): Add events_in_total & events_out_total metrics Feb 20, 2021
@ktff ktff merged commit 420c911 into master Feb 20, 2021
@ktff ktff deleted the ktff/in_out_metrics branch February 20, 2021 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: metrics Anything related to Vector's metrics events 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.

None yet

5 participants