opentelemetry-collector/connector/forwardconnector
Curtis Robert 8ee1f13743
[chore] Enable goleak for all (passing) tests (#9173)
**Description:**
It was suggested that we add the [goleak
package](https://pkg.go.dev/go.uber.org/goleak) to every test in core.
This change adds `goleak` to every package that is succeeds with goleak.
There a number that are not successful, the full list of which I've
posted in the bug.

I generated these files using a shell script to copy a template
`main_test.go` file into each package, then modified the package name.
I'm sure there was a better way to automate this, but it worked well
enough at this point. Here's the script:
 ```
cp ./main_test.go $1

PACKAGE_NAME=$(basename $1)

sed -i '' -e "s|package component|package $PACKAGE_NAME|g"
$1/main_test.go

pushd . && cd $1 && go mod tidy 
go test -v .
```
Usage example:
```
$ ./add_leak_test reciever/scrapererror
```


**Link to tracking Issue:**
#9165

**Testing:**
All added tests are passing, but there are a number failing. Note that there's no sign of `goleak` running until it fails.
2024-01-03 08:35:58 -08:00
..
internal/metadata [chore] use mdatagen for forward connector (#9188) 2023-12-22 11:10:35 -08:00
Makefile Add forward connector (#6763) 2022-12-13 08:37:09 -08:00
README.md [chore] use mdatagen for forward connector (#9188) 2023-12-22 11:10:35 -08:00
doc.go [chore] use mdatagen for forward connector (#9188) 2023-12-22 11:10:35 -08:00
forward.go [chore] use mdatagen for forward connector (#9188) 2023-12-22 11:10:35 -08:00
forward_test.go [chore] [forwardconnector] use defined struct for config (#8814) 2023-11-08 11:48:56 -08:00
go.mod [chore] Enable goleak for all (passing) tests (#9173) 2024-01-03 08:35:58 -08:00
go.sum [chore] Enable goleak for all (passing) tests (#9173) 2024-01-03 08:35:58 -08:00
metadata.yaml [chore] use mdatagen for forward connector (#9188) 2023-12-22 11:10:35 -08:00
package_test.go [chore] Enable goleak for all (passing) tests (#9173) 2024-01-03 08:35:58 -08:00

README.md

Forward Connector

Status
Distributions core, contrib
Issues Open issues Closed issues

Supported Pipeline Types

Exporter Pipeline Type Receiver Pipeline Type Stability Level
traces traces beta
metrics metrics beta
logs logs beta

The forward connector can merge or fork pipelines of the same type.

Configuration

If you are not already familiar with connectors, you may find it helpful to first visit the Connectors README.

The forward connector does not have any configuration settings.

receivers:
  foo:
exporters:
  bar:
connectors:
  forward:

Example Usage

Annotate distinct log streams, then merge them together, batch, and export.

receivers:
  foo/blue:
  foo/green:
processors:
  attributes/blue:
  attributes/green:
  batch:
exporters:
  bar:
connectors:
  forward:
service:
  pipelines:
    logs/blue:
      receivers: [foo/blue]
      processors: [attributes/blue]
      exporters: [forward]
    logs/green:
      receivers: [foo/green]
      processors: [attributes/green]
      exporters: [forward]
    logs:
      receivers: [forward]
      processors: [batch]
      exporters: [bar]

Preprocess data, then replicate and handle in distinct ways.

receivers:
  foo:
processors:
  resourcedetection:
  sample:
  attributes:
  batch:
exporters:
  bar/hot:
  bar/cold:
connectors:
  forward:
service:
  pipelines:
    traces:
      receivers: [foo]
      processors: [resourcedetection]
      exporters: [forward]
    traces/hot:
      receivers: [forward]
      processors: [sample, batch]
      exporters: [bar/hot]
    traces/cold:
      receivers: [forward]
      processors: [attributes]
      exporters: [bar/cold]

Add a temporary debugging exporter. (Uncomment to enable.)

receivers:
  foo:
processors:
  filter:
  batch:
exporters:
  bar:
# connectors:
#   forward:
service:
  pipelines:
    traces:
      receivers:
        - foo
      processors:
        - filter
        - batch
      exporters:
        - bar
      # - forward
  # traces/log:
  #   receivers: [forward]
  #   exporters: [logging]