Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fmcp-server%2Ftools%2Fevents2metrics.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fmcp-server%2Ftools%2Fevents2metrics.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Events2Metrics

Manage [Coralogix Events2Metrics](https://docs-docusaurus.kinsta.page/user-guides/monitoring-and-insights/events2metrics/.md) directly from your AI agent. The Model Context Protocol (MCP) server provides a unified tool to create, retrieve, update, and delete Events2Metrics resources, and to generate infrastructure-as-code definitions from resource configurations.

## Tool[​](#tool "Direct link to Tool")

Use `manage_events2metrics` for all Events2Metrics operations.

| Action value          | Description                                                                                                                                                                                               |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create`              | Create a new Events2Metrics resource.                                                                                                                                                                     |
| `get`                 | Retrieve a specific Events2Metrics resource by ID.                                                                                                                                                        |
| `list`                | List Events2Metrics resources with an optional case-insensitive name filter.                                                                                                                              |
| `update`              | Update an existing resource. The agent retrieves the current configuration first, then applies your changes.                                                                                              |
| `delete`              | Delete an Events2Metrics resource by ID.                                                                                                                                                                  |
| `generate_openapi`    | Generate the OpenAPI JSON payload for use with the Coralogix REST API.                                                                                                                                    |
| `generate_kubernetes` | Generate a Kubernetes Operator YAML manifest for the [Coralogix Operator](https://docs-docusaurus.kinsta.page/external/coralogix-operator).                                                               |
| `generate_terraform`  | Generate Terraform configuration for the [Coralogix Terraform Provider](https://docs-docusaurus.kinsta.page/developer-portal/infrastructure-as-code/terraform-provider/coralogix-terraform-provider/.md). |

## Supported shape[​](#supported-shape "Direct link to Supported shape")

The tool supports 1 query source per resource: logs or spans. It supports metric labels, metric fields, permutation limits, query filters, and the min, max, count, average, sum, samples, and histogram aggregations.

## Example prompts[​](#example-prompts "Direct link to Example prompts")

### Create a logs metric[​](#create-a-logs-metric "Direct link to Create a logs metric")

```
Create a Coralogix Events2Metrics resource named logs-status-count.

Convert logs matching Lucene query status:* with severity Error into a count

metric. Use source field status, target base metric name status_count,

metric label Status from field status, and permutations limit 1000.
```

### Create a spans metric[​](#create-a-spans-metric "Direct link to Create a spans metric")

```
Create a Coralogix Events2Metrics resource named spans-duration-samples.

Convert spans matching operationName:* into a samples metric over source field

duration. Use sample type Max, target base metric name duration_samples,

metric label Service from field service_name, service filter contains api,

and action filter contains GET.
```

### Export an existing resource[​](#export-an-existing-resource "Direct link to Export an existing resource")

```
Generate OpenAPI JSON, Kubernetes YAML, and Terraform configuration for the

Events2Metrics resource named logs-status-count.
```

## Important behaviors[​](#important-behaviors "Direct link to Important behaviors")

* **Use 1 query type.** A resource must use either `logsQuery` or `spansQuery`, not both.
* **Custom aggregation target metric names are not supported.** Use the generated target metric naming.
* **Logs query aliases are not exposed.** The tool rejects fetched resources with unsupported aliases for the shared infrastructure-as-code path.
* **Update requires retrieval first.** Retrieve the current resource, modify it, then update with the complete definition.
