Skip to content

feat: Add mezmo_analytics source - #85

Open
biblicalph wants to merge 2 commits into
masterfrom
biblicalph/LOG-23218
Open

feat: Add mezmo_analytics source#85
biblicalph wants to merge 2 commits into
masterfrom
biblicalph/LOG-23218

Conversation

@biblicalph

@biblicalph biblicalph commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Adds a new multi output source (mezmo_analytics) which collects internally generated events for routing through pipelines.
The source exposes outputs for usage metrics, usage metrics by annotations, log clusters, log cluster samples and log cluster annotations.
The source will be used to egress the internal events to Pulsar. The direct DB write paths will be deprecated as part of the Timescale shutdown.

Ref: LOG-23218

Summary

Vector configuration

How did you test this PR?

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

@biblicalph biblicalph self-assigned this Aug 14, 2026
@biblicalph
biblicalph marked this pull request as draft August 14, 2026 21:55
@biblicalph
biblicalph force-pushed the biblicalph/LOG-23218 branch 5 times, most recently from 38b0cbb to 807b700 Compare August 16, 2026 18:07
[features]
default = []
lua = ["dep:mlua", "dep:tokio-stream", "vrl/lua"]
lua = ["dep:mlua", "vrl/lua"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tokio-stream is no longer optional

@biblicalph
biblicalph force-pushed the biblicalph/LOG-23218 branch 2 times, most recently from a4e20ae to 95c7012 Compare August 16, 2026 19:08

@biblicalph biblicalph Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mostly relocation of the previous store::save_in_loop implementation.
The main changes here are:

  1. Create analytic batches for the newly added source and publish them
  2. Aggregation continues even if there is not DB connection (ensures data is served to the source)

@biblicalph
biblicalph force-pushed the biblicalph/LOG-23218 branch from 95c7012 to ead8440 Compare August 16, 2026 19:33
The source collects internally generated data including
usage metrics, usage annotations and log cluster events.

The source emits each event as a separate output, ensuring
we can route to specific destinations appropriately.

The implementation allows us to setup a source to collect
and route data to Pulsar.

Ref: LOG-23218
@biblicalph
biblicalph force-pushed the biblicalph/LOG-23218 branch from ead8440 to 782b4bd Compare August 17, 2026 04:01
@biblicalph
biblicalph marked this pull request as ready for review August 17, 2026 17:40
Comment thread lib/vector-core/src/mezmo/analytics.rs Outdated
Comment thread lib/vector-core/src/mezmo/analytics.rs
@darinspivey

Copy link
Copy Markdown
Contributor

@greptile

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a multi-output source that exports internally generated usage and log-clustering analytics for downstream routing.

  • Introduces process-global broadcast channels and five named analytics outputs.
  • Publishes usage and annotation metrics through the new source.
  • Refactors log-clustering aggregation to publish cluster, sample, and usage records while retaining database storage.

Confidence Score: 3/5

The PR does not appear safe to merge because multiple configured sources duplicate analytics records and sustained output backpressure permanently drops batches.

Every source instance still subscribes to the same process-global broadcasts, while lagged receivers continue to discard overwritten batches after a named output remains backpressured.

Files Needing Attention: src/sources/mezmo_analytics/config.rs, lib/vector-core/src/mezmo/analytics.rs

Important Files Changed

Filename Overview
lib/vector-core/src/mezmo/analytics.rs Adds global per-output broadcast channels and subscriptions; lagged receivers still permanently lose unread analytics batches.
src/sources/mezmo_analytics/config.rs Registers the source and all five outputs, but every configured instance still subscribes to the same global event streams.
src/sources/mezmo_analytics/mod.rs Concurrently forwards analytics batches to their named source outputs.
lib/vector-core/src/usage_metrics/mod.rs Converts aggregated billing and annotation usage into analytics log events before existing flushes.
src/transforms/mezmo_log_clustering/aggregate.rs Aggregates log-clustering data and emits cluster, sample, and usage batches alongside database persistence.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    UM[Usage metrics aggregation] --> PUB[Global analytics publishers]
    LC[Log clustering aggregation] --> PUB
    PUB --> U[usage_metrics]
    PUB --> A[usage_metrics_by_annotations]
    PUB --> C[log_clusters]
    PUB --> S[log_cluster_samples]
    PUB --> G[log_cluster_usage]
    U --> MA[mezmo_analytics source]
    A --> MA
    C --> MA
    S --> MA
    G --> MA
    MA --> DS[Downstream pipelines and Pulsar]
Loading

Reviews (2): Last reviewed commit: "chore: Emit standard vector internal eve..." | Re-trigger Greptile

Comment thread src/sources/mezmo_analytics/config.rs
Comment thread lib/vector-core/src/mezmo/analytics.rs
Emit events for dropped data

Ref: LOG-24349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants