Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

Plugin Running Times Metrics #324

Closed
wants to merge 14 commits into from
Closed

Plugin Running Times Metrics #324

wants to merge 14 commits into from

Conversation

yakkomajuri
Copy link
Contributor

Changes

Adding PostHog metrics on time taken for plugins to run. Allows for charts like this:

Screenshot 2021-04-20 at 12 01 07

This adds timers alongside StatsD, and also:

  • Makes posthog available anywhere and more configurable
  • Adds a set of events that should be ignored by plugins. I had originally added $snapshot to that list given Don't process $snapshot via plugins #280 but I guess we need onEvent before we can do that, otherwise it would affect export plugins. $plugin_running_duration has to be ignored to prevent an infinite event generator

Checklist

  • Updated Settings section in README.md, if settings are affected
  • Jest tests

@yakkomajuri yakkomajuri changed the title WIP Plugin Running Times Metrics Plugin Running Times Metrics Apr 22, 2021
Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

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

Plenty of code feedback below. Plus one bigger issue: this PR sends a new event to track metrics per every ingested event... which is way too much volume, effectively doubling what we currently do. Instead we must batch this info and just transmit like we currently transmit the instance status reports in the main app.

src/shared/posthog.ts Outdated Show resolved Hide resolved
src/worker/ingestion/process-event.ts Outdated Show resolved Hide resolved
src/worker/plugins/run.ts Outdated Show resolved Hide resolved
src/worker/plugins/run.ts Show resolved Hide resolved
src/worker/plugins/run.ts Outdated Show resolved Hide resolved
tests/postgres/worker.test.ts Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@yakkomajuri
Copy link
Contributor Author

New approach still WIP, need to smoothen some edges and update tests.

@yakkomajuri yakkomajuri marked this pull request as draft April 22, 2021 14:14
@yakkomajuri
Copy link
Contributor Author

The conflicts are running a bit deep so I think I'll just start fresh

@yakkomajuri yakkomajuri closed this May 7, 2021
@yakkomajuri yakkomajuri mentioned this pull request May 7, 2021
2 tasks
@mariusandra mariusandra deleted the ph-metrics branch May 21, 2021 13:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants