-
Notifications
You must be signed in to change notification settings - Fork 2.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
[WIP] Add support for loadbalancing with any resource attribute #18769
[WIP] Add support for loadbalancing with any resource attribute #18769
Conversation
This reverts commit d8e68e2.
…eid) and add logger support
…k to trace ID balancing
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.
I like the feature, but I think it could be done so that each routing key has its router. Trying to share code among them is likely to cause performance regressions, and I wouldn't be comfortable accepting this change as is without evidence that the performance is at least on par with the current implementation.
@@ -54,7 +55,7 @@ func createDefaultConfig() component.Config { | |||
} | |||
|
|||
func createTracesExporter(_ context.Context, params exporter.CreateSettings, cfg component.Config) (exporter.Traces, error) { | |||
return newTracesExporter(params, cfg) | |||
return newTracesExporter(params, cfg, zap.NewNop()) |
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.
You can actually get a logger from params
.
@@ -73,6 +80,60 @@ func buildExporterConfig(cfg *Config, endpoint string) otlpexporter.Config { | |||
return oCfg | |||
} | |||
|
|||
func SplitTracesByResourceAttr(batches ptrace.Traces, attrKeys []string) (map[string][]ptrace.Traces, error) { | |||
// This code is based on the ConsumeTraces function of the batchperresourceattr |
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.
Shouldn't this be part of a common library then between the two components?
CLA check seems to be failing. Once this is fixed, I'll do another review. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description:
This PR adds support for load balancing by any resource attribute (currently the
loadbalancing
exporter only supports load balancing by trace ID or service name).Changes
consumeTrace
is expected to receiveptrace.Trace
with a single Resource span (i.e. behavior before service name load balancing change)Sample Configuration
Trace ID Load Balancing Sequence Diagram
Resource Attribute Load Balancing Sequence Diagram
To-do
Link to tracking Issue: