This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
364d5fc
commit 24d6ba1
Showing
5 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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 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,75 @@ | ||
# Streaming | ||
|
||
|
||
Uses grpc streams to allow the plugin to send data immediately or after a certain period of time instead of on an interval governed by Snap. | ||
Streaming by snap enables - | ||
* Improved performance by enabling event based data flows | ||
* Supports runtime configuration controlling event throughput | ||
* Buffer configurations enable dispatching events after a given duration and/or when a given event count has been reached | ||
|
||
Currently there are two plugins that support streaming - [snap relay] (https://github.com/intelsdi-x/snap-relay) and [snap-plugin-collector-rand-streaming] (https://github.com/intelsdi-x/snap-plugin-lib-go/tree/master/examples/snap-plugin-collector-rand-streaming). | ||
|
||
# Configuration options | ||
MaxCollectDuration and MaxMetricsBuffer are two configuration options that can be set through streaming task manifest or flags. | ||
* MaxCollectDuration sets the maximum duration between collections before metrics are sent. It is always greater than 0 and defaults to 10s which means that after 10 seconds if no new metrics are received, the plugin should send whatever data it has in the buffer. | ||
* MaxMetricsBuffer is the maximum number of metrics the plugin is buffering before sending metrics. It defaults to 0 which means the metrics are sent immediately. | ||
|
||
# Streaming task schedule | ||
``` | ||
--- | ||
version: 1 | ||
schedule: | ||
type: "streaming" | ||
workflow: | ||
collect: | ||
metrics: | ||
/random/integer: {} | ||
config: | ||
/random/integer: | ||
MaxCollectDuration: "6s" | ||
MaxMetricsBuffer: 600 | ||
``` | ||
|
||
# Streaming configuration flags | ||
Below is an example of the how to run the streaming rand collector using the configurable flags. | ||
1. Start the Snap daemon: | ||
* Run | ||
``` | ||
$ snapteld -l 1 -t 0 | ||
``` | ||
The option "-l 1" is for setting the debugging log level and "-t 0" is for disabling plugin signing. | ||
|
||
2. Start the plugin using flags: | ||
* Run snap-plugin-collector-rand-streaming plugin | ||
``` | ||
go run main.go --stand-alone --max-collect-duration 10s --max-metrics-buffer 50 | ||
``` | ||
|
||
3. Load the plugin: | ||
Run | ||
``` | ||
$ snaptel plugin load http://localhost:8182 | ||
``` | ||
|
||
* List the metric catalog by running: | ||
``` | ||
$ snaptel metric list | ||
NAMESPACE VERSIONS | ||
/random/float 1 | ||
/random/integer 1 | ||
/random/string 1 | ||
``` | ||
|
||
# Metrics exposed by streaming collectors | ||
Below are some of the metrics collected by the streaming plugins currently. | ||
``` | ||
/intel/relay/collectd | ||
/intel/relay/statsd | ||
/random/integer | ||
/random/float | ||
/random/string | ||
``` | ||
|
||
|
||
|
||
|
This file contains 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 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