hasura / hasura/graphql-engine

support: provide option to stringify log body directly in OTEL exporter

Open
#10,166 1 comment 0 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

In some observability tools, when connected as logs receiver directly to [Hasura's OTEL exporter](https://hasura.io/docs/latest/observability/opentelemetry/#endpoint), it fails to capture some of the details (as opposed to traditional logs exporter i.e. non-OTEL).

Specifically in case of New Relic, when we directly use New Relic OTEL endpoints in Hasura OTEL Exporter, some details such as request body log (JSON object) wouldn't get captured. This is because the New Relic expects a JSON string, whereas the input it gets is JSON object `body` . You would need an OTEL collector in middle to transform from JSON object to JSON string.

### Describe the solution you'd like

Provide a UI as setting (option) to enable this transform by giving user the full control over it. We don't want to make it default behavior which would cause breaking changes to other services.

### Describe alternatives you've considered

As a workaround, you can have OTEL collector in middle such as it processes and transforms the JSON log body into JSON string and forwards it to destination/target endpoint.
```
Hasura OTEL Exporter -> OTEL Collector -> Desired Observability Tool (New Relic Endpoint)
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the Hasura OTEL exporter and the UI settings that control its log output. Trace how the log body is sent to the destination, then define the opt-in setting so JSON bodies can be emitted as JSON strings without changing the default behavior; done means the setting works for New Relic-style endpoints and preserves existing output when disabled.

Written by the indexing model from the issue text.

Assessment

Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.