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

Add export --internal to access metrics #3619

Merged
merged 10 commits into from Dec 1, 2023

Conversation

jachris
Copy link
Contributor

@jachris jachris commented Nov 6, 2023

This PR makes it so that we store pipeline metrics in the database. They are marked as "internal", which means that they are not exported by default. Instead, we can use export --internal to do so. The implementation uses a #internal meta extractor as a marker, but this extractor can only be accessed from code and not user-written pipelines.

It also fixes a bug where export --live | where <filter> discarded the filter.

Example

export --internal |
where source == true |
summarize bytes=sum(output.approx_bytes) by timestamp resolution 1s |
sort timestamp desc
{
  "timestamp": "2023-11-10T11:15:54.000000",
  "bytes": 79927223
}
{
  "timestamp": "2023-11-10T11:15:53.000000",
  "bytes": 81788928
}
{
  "timestamp": "2023-11-10T11:15:52.000000",
  "bytes": 80740352
}
{
  "timestamp": "2023-11-10T11:15:51.000000",
  "bytes": 75497472
}
{
  "timestamp": "2023-11-10T11:15:50.000000",
  "bytes": 75497472
}
{
  "timestamp": "2023-11-10T11:15:49.000000",
  "bytes": 76546048
}
{
  "timestamp": "2023-11-10T11:15:48.000000",
  "bytes": 78643200
}

Tasklist

  • Where to tick import source in pipeline manager?
  • Write docs for metrics format.
  • Add internal flag to event data
  • export --live --internal does not work yet (to be done later)
  • Create issue for follow-up PR

@jachris jachris added feature New functionality operator Source, transformation, and sink engine Core pipeline and storage engine labels Nov 6, 2023
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

👀

libtenzir/fbs/table_slice.fbs Outdated Show resolved Hide resolved
@jachris jachris force-pushed the topic/import-export-metrics branch 24 times, most recently from f6af1c7 to d8b7c67 Compare November 13, 2023 09:40
@jachris jachris marked this pull request as ready for review November 13, 2023 09:41
@jachris
Copy link
Contributor Author

jachris commented Nov 13, 2023

I still have to write the docs for the actual metrics events, but besides that, this should be ready for review.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

Two initial comments on the docs to start a discussion; still reviewing the code changes.

web/docs/metrics.md Outdated Show resolved Hide resolved
web/docs/metrics.md Outdated Show resolved Hide resolved
@jachris jachris force-pushed the topic/import-export-metrics branch 3 times, most recently from 2b2efc2 to 07ae815 Compare November 14, 2023 14:28
@dominiklohmann dominiklohmann merged commit 6f759c2 into main Dec 1, 2023
26 of 28 checks passed
@dominiklohmann dominiklohmann deleted the topic/import-export-metrics branch December 1, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Core pipeline and storage engine feature New functionality operator Source, transformation, and sink
Projects
None yet
2 participants