> ## 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.

# populateLocalMetrics

***

# Function: populateLocalMetrics()

```ts theme={null}
function populateLocalMetrics(
  step: Span | Trace,
  localMetrics: LocalMetricConfig[],
): void;
```

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

Populates local metrics on a trace or span by computing scores client-side.

This function recursively processes child spans.

## Parameters

### step

The trace or span to populate metrics on

[`Span`](/sdk-api/typescript/reference/types/type-aliases/Span) | [`Trace`](/sdk-api/typescript/reference/types/classes/Trace)

### localMetrics

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

List of local metric configurations to apply

## Returns

`void`
