Skip to content

Commit

Permalink
generic operator
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpatel96 committed Oct 16, 2024
1 parent b1ebb26 commit 2ce01f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions processor/schemaprocessor/internal/changelist/changelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,31 @@ func (c ChangeList) Do(ss migrate.StateSelector, signal any) error {
// switch between operator types - what do the operators act on?
switch thisMigrator := migrator.(type) {
// this one acts on both spans and span events!
case operator.SpanOperator:
case operator.Operator[ptrace.Span]:
if span, ok := signal.(ptrace.Span); ok {
if err := thisMigrator.Do(ss, span); err != nil {
return err
}
} else {
return fmt.Errorf("SpanOperator %T can't act on %T", thisMigrator, signal)
}
case operator.MetricOperator:
case operator.Operator[pmetric.Metric]:
if metric, ok := signal.(pmetric.Metric); ok {
if err := thisMigrator.Do(ss, metric); err != nil {
return err
}
} else {
return fmt.Errorf("MetricOperator %T can't act on %T", thisMigrator, signal)
}
case operator.LogOperator:
case operator.Operator[plog.LogRecord]:
if log, ok := signal.(plog.LogRecord); ok {
if err := thisMigrator.Do(ss, log); err != nil {
return err
}
} else {
return fmt.Errorf("LogOperator %T can't act on %T", thisMigrator, signal)
}
case operator.ResourceOperator:
case operator.Operator[pcommon.Resource]:
if resource, ok := signal.(pcommon.Resource); ok {
if err := thisMigrator.Do(ss, resource); err != nil {
return err
Expand Down

0 comments on commit 2ce01f7

Please sign in to comment.