open-index/open-npm huggingface dataset:
npm package: @puddingbroodje/opentelemetry-setup
Description: ## Use ``` npm install @puddingbroodje/opentelemetry-setup ```
Latest version: 1.0.3

# OpenTelemetry

## Use
```
npm install @puddingbroodje/opentelemetry-setup
```

### Basic Usage (Traces only - default)
```typescript
import {initializeOpenTelemetry} from '@puddingbroodje/opentelemetry-setup';

initializeOpenTelemetry({
    apiUrl: 'https://example.com/api',
    apiToken: 'your-api-token',
    serviceName: 'your-service-name',
});
```

### Configure Service Type
```typescript
import {initializeOpenTelemetry} from '@puddingbroodje/opentelemetry-setup';

// Traces only (default)
initializeOpenTelemetry({
    apiUrl: 'https://example.com/api',
    apiToken: 'your-api-token',
    serviceName: 'your-service-name',
    service: 'traces'
});

// Metrics only
initializeOpenTelemetry({
    apiUrl: 'https://example.com/api',
    apiToken: 'your-api-token',
    serviceName: 'your-service-name',
    service: 'metrics'
});

// Logs only
initializeOpenTelemetry({
    apiUrl: 'https://example.com/api',
    apiToken: 'your-api-token',
    serviceName: 'your-service-name',
    service: 'logs'
});

// All telemetry data (traces, metrics, and logs)
initializeOpenTelemetry({
    apiUrl: 'https://example.com/api',
    apiToken: 'your-api-token',
    serviceName: 'your-service-name',
    service: 'all'
});
```

## Additional Dependencies

For metrics and logs support, install the additional exporters:

```bash
npm install @opentelemetry/exporter-metrics-otlp-http @opentelemetry/exporter-logs-otlp-http
```

## Service Types

- `'traces'` (default): Collects distributed tracing data
- `'metrics'`: Collects application metrics
- `'logs'`: Collects application logs  
- `'all'`: Enables traces, metrics, and logs collection