-
Notifications
You must be signed in to change notification settings - Fork 74
feat: ingestion metrics for system monitoring #2913
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
Merged
amokan
merged 24 commits into
main
from
feat/ingestion-metrics-system-monitoring-refactor
Nov 26, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1b7f1cb
feat: ingestion metrics for system monitoring
Ziinc 86155c9
feat: rename ingested_count metric
Ziinc 69e8cd7
refactor: use a single exporter for all user metrics
andremaker 0f6d4cd
feat: extract_tags callback
Ziinc a809b05
fix: metrics not routing to sources properly
Ziinc fd0f9e7
feat: endpoint query metrics
Ziinc a6af507
docs: system monitoring docs
Ziinc 6ecda81
chore: add more tests
Ziinc 7a55872
chore: formatting
Ziinc c7779b1
docs: remove rejected events
Ziinc 54419a3
Update lib/logflare/sources.ex
Ziinc 09ea14d
chore: remove List.flatten usage
Ziinc ccff772
chore: PR comments, add additional label validation
Ziinc 6f7e3e5
chore: formatting
Ziinc 9812452
chore: linting
Ziinc 2c7f0d0
chore: fix linting
Ziinc e6259e4
chore: version bump
Ziinc 179533c
chore: PR comments
Ziinc bf0fa08
chore: rename test
Ziinc 475ecfb
chore: typing, failing test
Ziinc 9ebd4a3
chore: make dialyzer happy
Ziinc aed8e8f
chore: typings
Ziinc c874a55
chore: failing tests
Ziinc 601f8dd
chore: fix failing tests
Ziinc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1.26.13 | ||
| 1.26.14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| sidebar_position: 6 | ||
| --- | ||
|
|
||
| # System Monitoring | ||
|
|
||
| System Monitoring collects metrics and logs about your sources, backends, and endpoints. Dedicated system sources are provisioned to capture such operational data: | ||
|
|
||
| - **`system.metrics`** - OpenTelemetry metrics for ingestion, queries, and egress | ||
| - **`system.logs`** - Application logs for your sources and backends | ||
|
|
||
| System sources behave like regular sources. Query, search, and monitor them with standard Logflare tools. They appear as favorites by default. | ||
|
|
||
| ## Enabling System Monitoring | ||
|
|
||
| 1. Navigate to **Account Settings** at `/account/edit` | ||
| 2. Find the **"System monitoring"** section | ||
| 3. Check **"Enable system monitoring"** | ||
| 4. Click **"Update account"** | ||
|
|
||
| Logflare creates the three system sources and starts collecting data every 60 seconds. Disabling stops data collection immediately. | ||
|
|
||
| ## System Sources | ||
|
|
||
| ### system.metrics | ||
|
|
||
| Contains OpenTelemetry metrics as structured events. Each metric includes: | ||
|
|
||
| - **`event_message`** - Metric name | ||
| - **`attributes`** - Key-value pairs with metric dimensions and values | ||
| - **`timestamp`** - When the metric was recorded | ||
|
|
||
| Metrics are collected every 60 seconds. | ||
|
|
||
| ### system.logs | ||
|
|
||
| Contains application logs related to your sources, backends, and endpoints. | ||
|
|
||
| ## Metrics Collected | ||
|
|
||
| | Metric | Description | Metadata | | ||
| | ------------------------------------------------ | ---------------------------------------------------------------------------- | ---------------------------------------- | | ||
| | `logflare.backends.ingest.ingested_bytes` | Total bytes ingested per source. Tracks storage consumption. | `source_id`, `backend_id`, custom labels | | ||
| | `logflare.backends.ingest.ingested_count` | Count of events ingested per source. Tracks ingestion volume. | `source_id`, `backend_id`, custom labels | | ||
| | `logflare.endpoints.query.total_bytes_processed` | Bytes processed when executing endpoint queries. Tracks query costs. | `endpoint_id`, custom labels | | ||
| | `logflare.backends.ingest.egress.request_bytes` | Bytes sent to external HTTP endpoints and webhooks. Tracks egress bandwidth. | Backend-specific metadata | | ||
|
|
||
| ## Custom Labels | ||
|
|
||
| Add dimensions to metrics through labels on sources and endpoints. Labels appear in the `attributes` field of metric events. | ||
|
|
||
| For endpoint labelling behavior, see [Query Tagging with Labels](/concepts/endpoints#query-tagging-with-labels). | ||
|
|
||
| ### Format | ||
|
|
||
| Use comma-separated key-value pairs: | ||
|
|
||
| ``` | ||
| environment=production,region=us-east,team=backend | ||
| ``` | ||
|
|
||
| ### Ingest-time Field Extraction | ||
|
|
||
| Extract values from event metadata using field paths: | ||
|
|
||
| ``` | ||
| label_name=field.path | ||
| label_name=m.field.path | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `environment=m.env` extracts `metadata.env` | ||
| - `user_type=m.user.type` extracts `metadata.user.type` | ||
| - `region=region` extracts top-level `region` | ||
|
|
||
| Only string values are extracted. Nested maps and lists are excluded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.