> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> SDK Deno pour ClickStack - La stack d’observabilité ClickHouse

# Deno

export const ClickStackIntegrates = ({signals = []}) => {
  const list = Array.isArray(signals) ? signals : String(signals).split(",");
  const supported = list.map(s => String(s).trim().toLowerCase());
  const pillStyle = {
    display: "inline-flex",
    alignItems: "center",
    padding: "0.125rem 0.625rem",
    borderRadius: "9999px",
    fontSize: "0.8125rem",
    fontWeight: 500,
    lineHeight: 1.6,
    color: "#161517",
    backgroundColor: "#faff69",
    border: "1px solid rgba(0, 0, 0, .1)",
    marginRight: "0.5rem"
  };
  return <div style={{
    margin: "0 0 1.25rem"
  }}>
      <span style={{
    marginRight: "0.5rem"
  }}>Ce guide intègre :</span>
      {supported.includes("logs") && <span style={pillStyle}>Logs</span>}
      {supported.includes("metrics") && <span style={pillStyle}>Métriques</span>}
      {supported.includes("traces") && <span style={pillStyle}>Traces</span>}
    </div>;
};

<ClickStackIntegrates signals={['logs']} />

<Note>
  Actuellement, seule la journalisation OpenTelemetry est prise en charge. Pour le support du tracing, [consultez le guide suivant](https://dev.to/grunet/leveraging-opentelemetry-in-deno-45bj#a-minimal-interesting-example).
</Note>

<h2 id="logging">
  Journalisation
</h2>

La journalisation est assurée en exportant un logger personnalisé pour le module `std/log`.

**Exemple d’utilisation :**

```typescript theme={null}
import * as log from 'https://deno.land/std@0.203.0/log/mod.ts';
import { OpenTelemetryHandler } from 'npm:@hyperdx/deno';

log.setup({
  handlers: {
    otel: new OpenTelemetryHandler('DEBUG'),
  },

  loggers: {
    'my-otel-logger': {
      level: 'DEBUG',
      handlers: ['otel'],
    },
  },
});

log.getLogger('my-otel-logger').info('Hello from Deno!');
```

<h3 id="run-the-application">
  Exécuter l’application
</h3>

<Tabs>
  <Tab title="Managed ClickStack">
    ```shell theme={null}
    OTEL_EXPORTER_OTLP_ENDPOINT=<YOUR_OTEL_COLLECTOR_HTTP_ENDPOINT> \
    OTEL_SERVICE_NAME="<YOUR_SERVICE_NAME>" \
    deno run --allow-net --allow-env --allow-read --allow-sys --allow-run app.ts
    ```
  </Tab>

  <Tab title="ClickStack Open Source">
    ```shell theme={null}
    OTEL_EXPORTER_OTLP_HEADERS="authorization=<YOUR_INGESTION_API_KEY>" \
    OTEL_EXPORTER_OTLP_ENDPOINT=<YOUR_OTEL_COLLECTOR_HTTP_ENDPOINT> \
    OTEL_SERVICE_NAME="<YOUR_SERVICE_NAME>" \
    deno run --allow-net --allow-env --allow-read --allow-sys --allow-run app.ts
    ```
  </Tab>
</Tabs>
