> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# toPrometheus()

> Function exported by @botmesh/core.

```ts theme={null}
function toPrometheus(snapshot, options?): string;
```

Defined in: [ops/prometheus.ts:55](https://github.com/andresayac/botmesh/blob/main/packages/core/src/ops/prometheus.ts#L55)

Render `snapshot` as Prometheus text.

## Parameters

| Parameter | Type |
| - | - |
| `snapshot` | [`BotMetricsSnapshot`](https://botmesh.afaya.com.co/api/core/interfaces/BotMetricsSnapshot) |
| `options?` | [`PrometheusOptions`](https://botmesh.afaya.com.co/api/core/interfaces/PrometheusOptions) |

## Returns

`string`

## Example

```ts theme={null}
import { toPrometheus, PROMETHEUS_CONTENT_TYPE } from '@botmesh/core'
http.createServer((req, res) => {
  res.setHeader('Content-Type', PROMETHEUS_CONTENT_TYPE)
  res.end(toPrometheus(bot.metrics(), { labels: { bot: 'ventas' } }))
}).listen(9464)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.