# Legacy OpenMetrics export
source: https://docs.chalk.ai/docs/legacy-metrics-export

## Look up metric names and labels for the legacy scrape endpoint and configure an existing Datadog Agent.

Use this reference if your OpenMetrics collector scrapes /v1/metrics/export or /v2/metrics/export
with a Chalk service token that has the logs.list permission. For new integrations,
choose a destination in Telemetry export.

### Available metrics

The table below summarizes the metrics that are available for export.
The headers in the table are the exported metric name followed by the
OpenMetrics metric type
(gauge,
histogram,
summary, or
counter).

### Configuring Datadog

Use the following configuration if you maintain a Datadog Agent that polls the Chalk metrics endpoint.

### Step 1: Create a Datadog agent

Datadog Agents are processes that run on your servers to collect metrics and send them to Datadog's online
monitoring systems.

You can use an existing agent to collect Chalk metrics, or
create an agent specifically for Chalk.
Once you have created an agent, you can configure it to ingest metrics from Chalk.

### Step 2: Create a Chalk service token

Chalk secures the metrics export endpoint using the same authentication and authorization mechanisms used for
accessing other Chalk systems.

After creating a Datadog agent, generate a set of service credentials with the logs.list
permission.

Datadog token

Save the client_id and client_secret for the agent configuration.

### Step 3: Configure the agent

Next, configure the Datadog agent
to ingest OpenMetrics data from Chalk.

Edit the OpenMetrics configuration file, which
comes standard with Datadog Agent as of version 6.6.0. Datadog Agent configuration files are found in the
agent configuration directory.
In that directory is a file named openmetrics.d/conf.yaml.
Add the following content:

```yaml
instances:
  - openmetrics_endpoint: https://api.chalk.ai/v1/metrics/export

    ## (Optional) A prefix to prepend to all metrics
    namespace: chalk

    metrics:
      - resolver_latency_seconds
      - resolver_request
      - feature_request
      - scheduled_query_count
      - scheduled_query_success_ratio
      - deployment
      - query_http_response

    headers:
      X-Chalk-Client-Id: token-<redacted>
      X-Chalk-Client-Secret: ts-<redacted>
```

In X-Chalk-Client-Id and X-Chalk-Client-Secret,
supply the client ID and secret you generated in
Step 2.
In the metrics section of the config file,
you can specify any of the metrics found in the
list of supported metrics.

### Step 4: Verification

Your Chalk metrics will appear on the Datadog
Metrics Catalog
after updating the Datadog Agent configuration and restarting your Datadog Agent.

They should appear like this:

Datadog verification





