Generating custom metrics from Eventing service

Use case:
Data movement between clusters on reaching certain mileStone/specific criteria.

Planned Approach:
Eventing will set/mark/update specific attributes, XDCR filtering would be enabled to transfer data only when one of those attributes is set.
Eventing is not set at the document level directly, It’s handled via timeHandlers& callback. It’s more of a batch evaluation & execution.


  1. Is there any way we can generate client-specific custom metrics from the eventing function implementation? We can export couch metrics to Prometheus, are there any ways to generate custom one’s?

  2. Are there any criteria for executing the eventing function on a particular event node? Is a function always tied to a single node OR its round-robin OR random??

Hi @charannl,

First you need to be very careful when setting up Eventing with XDCR because it is easy to create a race condition.


I believe there are indeed metrics available in Prometheus (low cardinality), refer to:

Now I don’t use Prometheus myself so I can’t help further in the forum (you can however reach out to professional services).


Eventing responds to mutations on documents. If you have multiple Eventing nodes the documents mutations are streamed based on a crc32 hash on the documents key to map the keys into vBuckets where each Eventing node handles a subset of the vBuckets (1024 for Linux). So the same key ends up at the same Eventing node if you mutate it multiple times. However if you horizontally scale (up/down) the number of Eventing nodes this mapping will change.

The Function runs on every Eventing node where a particular nodes instance of the Function handles a subset of vBuckets. As discussed above it is not random but gets a pretty good distribution based on the hash.


Jon Strabala
Principal Product Manager - Server‌

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.