Skip to content

Commit 16ff66c

Browse files
committed
enabling other detectors
1 parent ac7d11f commit 16ff66c

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

docs/configuration.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -224,35 +224,24 @@ populated with a comma-separated list of resource detector identifiers:
224224
export GRAFANA_DOTNET_DISABLE_RESOURCEDETECTORS="Host,Process"
225225
```
226226

227-
### Adding instrumentations not supported by the distribution
227+
### Adding resource detectors not supported by the distribution
228228

229-
Instrumentations not included in the distribution can easily be added by
229+
Resource detectors not included in the distribution can easily be added by
230230
extension methods on the tracer and meter provider.
231231

232-
For example, if it is desired to use the `EventCounters` instrumentation, which is
233-
not included in the [full package](./installation.md#install-the-full-package-with-all-available-instrumentations),
234-
one install the `EventCounters` instrumentation library along with the base
235-
package.
236-
237-
```sh
238-
dotnet add package --prerelease Grafana.OpenTelemetry.Base
239-
dotnet add package OpenTelemetry.Instrumentation.EventCounters --prerelease
240-
```
241-
242-
Then, the `EventCounters` instrumentation can be enabled via the [`AddEventCountersInstrumentation`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.EventCounters#step-2-enable-eventcounters-instrumentation)
232+
To enable an unsupported resource detector, call the `ConfigureResource`
243233
extension method, alongside the `UseGrafana` method.
244234

245235
```csharp
246236
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
247237
.UseGrafana()
248-
.AddEventCountersInstrumentation(options => {
249-
options.RefreshIntervalSecs = 1;
250-
options.AddEventSources("MyEventSource");
238+
.ConfigureResource(config => {
239+
config.AddCustomResourceDetector();
251240
})
252241
.Build();
253242
```
254243

255-
This way, any other instrumentation library [not supported by the distribution](./supported-instrumentations.md)
244+
This way, any other resource detector library [not supported by the distribution](./supported-resource-detectors.md)
256245
can be added according to the documentation provided with it.
257246

258247
### Extra steps to activate specific instrumentations

0 commit comments

Comments
 (0)