-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Connectors prototype #6140
Connectors prototype #6140
Conversation
3e75330
to
eb13d1b
Compare
|
||
func newCountMetric(signalType string, count int) pmetric.Metrics { | ||
ms := pmetric.NewMetrics() | ||
rms := ms.ResourceMetrics().AppendEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this copy the resource and scope from the source data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the count
connector is very rudimentary, mostly meant for illustrative purposes. If the general concept moves forward, it will probably do so initially without this component.
9440ca1
to
4b4ddbb
Compare
4b4ddbb
to
ae490e7
Compare
Codecov ReportBase: 91.89% // Head: 91.23% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #6140 +/- ##
==========================================
- Coverage 91.89% 91.23% -0.67%
==========================================
Files 217 219 +2
Lines 13319 13413 +94
==========================================
- Hits 12240 12237 -3
- Misses 850 949 +99
+ Partials 229 227 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
return NewReceiverFactory(f.cfgType, f.createDefaultReceiverConfig, f.receiverFactoryOptions...) | ||
} | ||
|
||
// TODO Implement and enforce ConnectorFactoryOptions that enumerate valid signal combos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having thought about this some more, I believe it will be necessary to provide the full matrix of Create<Type1>To<Type2>Func
's, because each combination may have different behavior.
@djaglowski thanks for doing this, I have couple of questions about the design:
I am struggling a bit with the design choice, I think we can add a proper new component The late configuration for the "next consumer" can also be hacked, by passing a "lazy initialized consumer" which allows us to "swap" the next consumer there, we can check couple of designs there. |
Thanks for the feedback @bogdandrutu.
I agree this implementation is quite awkward for all the reasons you mentioned. Technically, I was able to work with around the dual constructor/configs issue, but authoring the individual components required some assumptions about the order of component creation, which should not be a concern of the component author. I thought perhaps there might be a way to provide a
Good idea - I'll keep this in mind. At some point I need to take a closer look at start/stop order across the collector. I am not very familiar with this code yet but am hoping to build a topological ordering that ensures data is never blocked or stranded. If this works, I think we can pass next consumers in directly during construction, since we would build from the end of the graph backwards to the beginning in order to ensure data flow during startup. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Quick update: I'm continuing to work on this and will open another PR that solidifies the new component type and also includes a graph-based implementation of |
Connectors
This is a working prototype of a new component type called "Connectors", which were proposed and described in #2336.
The general idea is that a connector acts as an exporter/receiver pair, bridging the gap between two or more pipelines. A connector can be used to merge data from multiple pipelines, or to split/replicate data to multiple pipelines. Connectors are configured declaratively, in the same way as receivers, processors, exporters, or extensions, and are integrated into the existing pipeline structure by being used in place of at least one exporter and at least one receiver.
The implementation includes two very simple connectors,
nop
andcount
, which allow for basic demonstration of functionality. (count
is a bit contrived, but useful to illustrate a capability)As much as possible, I've leaned on the existing notions of receivers and exporters. My goal is to allow existing functionality to do as much of the work as possible. Because of this we get a lot of useful functionality for free:
count
cannot be used as a receiver in a logs or traces pipeline)Sample use cases and configuration.
Count logs as they are forwarded. Report the count as a metric.
Duplicate metrics. Forward one stream directly to a backend. Batch the other stream and forward it to a different backend.
Merge traces from two pipelines, then batch them.
Several important aspects of the design are not yet implemented, but I wanted to share the prototype for early feedback.
TODO:
ConnectorFactoryOptions
to describe and enforce valid pipeline connectionsnop
connector can handlelogs -> logs
,metrics -> metrics
,traces -> traces
count
connector can handlelogs -> metric
,metrics -> metrics
,traces -> metrics