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

# Configurar observabilidad

> Apunta la telemetría de Midaz a tu collector de OpenTelemetry: las variables de entorno que inyecta el chart, el endpoint OTLP fijo y cómo sobrescribirlo.

El chart de Midaz **no** despliega un stack de observabilidad. Emite trazas y métricas de OpenTelemetry y espera que tú ejecutes el collector y el backend. El chart solo controla si inyecta las variables de entorno OTEL en los deployments `ledger`, `crm` y `tracer`.

<Note>
  El chart no contiene plantillas de Grafana. La clave `grafana:` todavía existe en `values.yaml`, pero no renderiza nada, así que definir `grafana.enabled: true` no tiene efecto.
</Note>

## Inyectar las variables de entorno OTEL

***

La clave `otel-collector-lerian.enabled` controla la inyección y es `true` de forma predeterminada:

```yaml theme={null}
otel-collector-lerian:
  enabled: true
```

<Warning>
  El esquema de esta clave es estricto. El esquema acepta solo `enabled`. Rechaza claves legacy (`external`, `extraEnvs`, `exporters`, `opentelemetry-collector`) en el momento de `helm install`/`helm upgrade`.
</Warning>

Cuando está habilitada, el chart agrega estas variables a los contenedores `ledger`, `crm` y `tracer`:

| Variable                      | Valor                                 |
| :---------------------------- | :------------------------------------ |
| `POD_IP`                      | `status.podIP` (referencia de campo)  |
| `HOST_IP`                     | `status.hostIP` (referencia de campo) |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `$(HOST_IP):4317`                     |
| `OTEL_RESOURCE_ATTRIBUTES`    | `k8s.pod.ip=$(POD_IP)`                |

## Lo que debes proveer

***

El endpoint está **fijo en `$(HOST_IP):4317`**, el nodo donde se ejecuta el pod. Por lo tanto, mantener `enabled: true` necesita un collector OTLP en el puerto 4317 en cada nodo, normalmente un DaemonSet con `hostNetwork` o un host port. Sin él, las aplicaciones exportan a un endpoint muerto.

## Usar un endpoint distinto

***

Puedes enviar la telemetría a otro lugar: un Service de collector central, un backend gestionado o tu infraestructura de observabilidad existente. Deja la inyección desactivada y define el endpoint directamente en el ConfigMap de la aplicación:

```yaml theme={null}
otel-collector-lerian:
  enabled: false

ledger:
  configmap:
    OTEL_EXPORTER_OTLP_ENDPOINT: "otel-collector.observability.svc.cluster.local:4317"

crm:
  configmap:
    OTEL_EXPORTER_OTLP_ENDPOINT: "otel-collector.observability.svc.cluster.local:4317"

tracer:
  configmap:
    OTEL_EXPORTER_OTLP_ENDPOINT: "otel-collector.observability.svc.cluster.local:4317"
```

## Dashboards

***

El chart no incluye dashboards. Constrúyelos en el backend que reciba la telemetría.

Para el chart independiente del collector, consulta [Helm charts de infraestructura](/es/platform/deploy/infrastructure/infrastructure-helm).
