# OpenTelemetryCollectorResource

- Module: [CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector](/reference/api/go/communitytoolkit.aspire.hosting.opentelemetrycollector.md)
- Version: `13.6.1`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Represents an OpenTelemetry Collector container resource.

## Definition

```go
type OpenTelemetryCollectorResource interface {
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `GrpcEndpoint`: `EndpointReference` `get` -- Gets the gRPC endpoint for the collector.
- `HttpEndpoint`: `EndpointReference` `get` -- Gets the HTTP endpoint for the collector.

## Methods

- [WithAppForwarding](/reference/api/go/communitytoolkit.aspire.hosting.opentelemetrycollector/opentelemetrycollectorresource/withappforwarding.md) -- `method` -- Configures all compatible resources in the application to forward telemetry to this collector.
  ```go
  WithAppForwarding() OpenTelemetryCollectorResource
  ```
- [WithConfig](/reference/api/go/communitytoolkit.aspire.hosting.opentelemetrycollector/opentelemetrycollectorresource/withconfig.md) -- `method` -- Adds a configuration file to the collector resource.
  ```go
  WithConfig(configPath string) OpenTelemetryCollectorResource
  ```
