-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Showing
68 changed files
with
5,904 additions
and
113 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
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
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,43 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package consumer // import "go.opentelemetry.io/collector/consumer" | ||
|
||
import ( | ||
"context" | ||
|
||
"go.opentelemetry.io/collector/consumer/internal" | ||
"go.opentelemetry.io/collector/pdata/pentity" | ||
) | ||
|
||
// Entities is an interface that receives pentity.Entities, processes it | ||
// as needed, and sends it to the next processing node if any or to the destination. | ||
type Entities interface { | ||
internal.BaseConsumer | ||
// ConsumeEntities receives pentity.Entities for consumption. | ||
ConsumeEntities(ctx context.Context, td pentity.Entities) error | ||
} | ||
|
||
// ConsumeEntitiesFunc is a helper function that is similar to ConsumeEntities. | ||
type ConsumeEntitiesFunc func(ctx context.Context, td pentity.Entities) error | ||
|
||
// ConsumeEntities calls f(ctx, td). | ||
func (f ConsumeEntitiesFunc) ConsumeEntities(ctx context.Context, td pentity.Entities) error { | ||
return f(ctx, td) | ||
} | ||
|
||
type baseEntities struct { | ||
*internal.BaseImpl | ||
ConsumeEntitiesFunc | ||
} | ||
|
||
// NewEntities returns a Entities configured with the provided options. | ||
func NewEntities(consume ConsumeEntitiesFunc, options ...Option) (Entities, error) { | ||
if consume == nil { | ||
return nil, errNilFunc | ||
} | ||
return &baseEntities{ | ||
BaseImpl: internal.NewBaseImpl(options...), | ||
ConsumeEntitiesFunc: consume, | ||
}, nil | ||
} |
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
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,13 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/pdata/pcommon" | ||
) | ||
|
||
func marshalResource(res pcommon.Resource, buf *dataBuffer) { | ||
buf.logAttributes("Resource attributes", res.Attributes()) | ||
buf.logResourceEntities(res.Entities()) | ||
} |
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
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,15 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package internal // import "go.opentelemetry.io/collector/exporter/internal" | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/component" | ||
"go.opentelemetry.io/collector/consumer" | ||
) | ||
|
||
// Profiles is an exporter that can consume profiles. | ||
type Entities interface { | ||
component.Component | ||
consumer.Entities | ||
} |
Oops, something went wrong.