Skip to content

Commit

Permalink
Add graph-based GetExporters (#7108)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Feb 3, 2023
1 parent 490fd6a commit c3d5b3b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions service/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,20 @@ func (g *pipelinesGraph) ShutdownAll(ctx context.Context) error {
}

func (g *pipelinesGraph) GetExporters() map[component.DataType]map[component.ID]component.Component {
// TODO actual implementation
return make(map[component.DataType]map[component.ID]component.Component)
exportersMap := make(map[component.DataType]map[component.ID]component.Component)
exportersMap[component.DataTypeTraces] = make(map[component.ID]component.Component)
exportersMap[component.DataTypeMetrics] = make(map[component.ID]component.Component)
exportersMap[component.DataTypeLogs] = make(map[component.ID]component.Component)

for _, pg := range g.pipelines {
for _, expNode := range pg.exporters {
// Skip connectors, otherwise individual components can introduce cycles
if expNode, ok := g.componentGraph.Node(expNode.ID()).(*exporterNode); ok {
exportersMap[expNode.pipelineType][expNode.componentID] = expNode.Component
}
}
}
return exportersMap
}

func (g *pipelinesGraph) HandleZPages(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit c3d5b3b

Please sign in to comment.