> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# enableMetrics

***

# Function: enableMetrics()

```ts theme={null}
function enableMetrics(options: object): Promise<LocalMetricConfig[]>;
```

Defined in: [src/utils/log-streams.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/log-streams.ts)

Enable metrics for a log stream.

Supports explicit parameters or environment variables (GALILEO\_PROJECT/GALILEO\_LOG\_STREAM).

## Parameters

### options

Configuration options

#### logStreamName?

`string`

Log stream name (overrides env var)

#### metrics

(
\| `string`
\| [`Metric`](/sdk-api/typescript/reference/types/interfaces/Metric)
\| [`LocalMetricConfig`](/sdk-api/typescript/reference/types/interfaces/LocalMetricConfig))\[]

Metrics to enable. Accepts:

* GalileoMetrics const object values (e.g., GalileoMetrics.correctness)
* String names (e.g., 'toxicity')
* Metric objects (e.g., \{ name: 'custom', version: 2 })
* LocalMetricConfig objects with scorerFn for client-side scoring

#### projectName?

`string`

Project name (overrides env var)

## Returns

`Promise`\<[`LocalMetricConfig`](/sdk-api/typescript/reference/types/interfaces/LocalMetricConfig)\[]>

LocalMetricConfig\[] - Client-side metrics that need local processing.
Server-side metrics are automatically registered.

## Throws

Error if project/log stream not found or metrics don't exist

## Example

```typescript theme={null}
const localMetrics = await enableMetrics({
  projectName: "My Project",
  logStreamName: "Production",
  metrics: [GalileoMetrics.correctness, "toxicity"],
});
```
