Skip to content

Commit

Permalink
docs: add otel docs, add extra accepted source headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Dec 2, 2024
1 parent 532fbc1 commit c8336c1
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
67 changes: 67 additions & 0 deletions docs/docs.logflare.com/docs/integrations/open-telemetry/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Open Telemetry
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Logflare features OpenTelemetry integration to ingest directly from OpenTelemtry SDKs.

:::note
This feature is under development and is considered alpha stage. It is not advisable to use it for mission critical production workloads.
:::

The ingestion url is `https://otel.logflare.app:443`.

### Configuration Examples

<Tabs>
<TabItem value="erlang" label="Erlang" default>

```erlang
%% config/sys.config.src
[
{opentelemetry, [
{span_processor, batch},
{traces_exporter, otlp}
]},

{opentelemetry_exporter, [
{otlp_protocol, grpc},
{otlp_compression, gzip},
{otlp_endpoint, "https://otel.logflare.app:443"},
{otlp_headers, [
{"x-source", "my-source-id"},
{"x-api-key", "my-access-token"}
]}
]}
].
```

</TabItem>
<TabItem value="elixir" label="Elixir">

```elixir
# config/config.exs
config :opentelemetry,
span_processor: :batch,
traces_exporter: :otlp

config :opentelemetry_exporter,
otlp_protocol: :grpc,
otlp_compression: :gzip,
otlp_endpoint: "https://otel.logflare.app:443",
otlp_headers: [
{"x-source", "my-source-uuid"},
{"x-api-key", "my-access-token"}
]
```

</TabItem>
</Tabs>

### Limitations

- Only **traces** are currently supported.
- Only GRPC as the transport protocol is currently supported. HTTP Protobuf is not yet supported.
- Gzip compression is required.
2 changes: 2 additions & 0 deletions lib/logflare_grpc/trace/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ defmodule LogflareGrpc.Trace.Server do
case GRPC.Stream.get_headers(stream) do
%{"x-source-token" => token} -> {:ok, token}
%{"x-source-id" => token} -> {:ok, token}
%{"x-source" => token} -> {:ok, token}
%{"x-source-uuid" => token} -> {:ok, token}
_ -> {:error, :unauthorized}
end
end
Expand Down

0 comments on commit c8336c1

Please sign in to comment.