question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove trace context from events

See original GitHub issue

We just updated to v1.3.3. Everything went smoothly, except some of our event handlers started failing because the new trace_context values don’t stringify correctly in NodeJS

We set the HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES for a similar reason in order to deal with BigInt values correctly

Is there any way the trace context in event payloads could respect this setting? What are some of our other options?

Right now we’ve added something like this to our event handlers, but its a bit of a hack:

  if (event?.trace_context) {
    Object.keys(event.trace_context).forEach((key) => {
      if (typeof event.trace_context[key].toString === 'function') {
         event.trace_context[key] = event.trace_context[key].toString()
      }
    })
  }

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nasoncommented, Dec 17, 2020

Dumb question probably: Why do you want trace_context to be stringified in the first place?

Not a dumb question at all @tirumaraiselvan! We have an ingest endpoint set up that that puts events onto an AWS EventBridge bus, which other services (mostly lambdas) subscribe to.

This has been working really well for us, and I opened this issue after upgrading to v1.3.3 because the event payload we were receiving stopped being JSON.stringify-able, and our ingest started failing.

We don’t explicitly need the trace context, but its addition broke our ingest endpoint until we added the patch in the 1st comment. That said, it would be very cool one day to be able to use this trace context to correlate hasura action -> event -> ingest -> subscriber(s)

0reactions
andokscommented, Oct 11, 2022

FYI: the field “trace_context” is not documented in https://hasura.io/docs/latest/event-triggers/payload/. Should it be?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trace Context - W3C
Trace context propagation passes along this unique identification. ... Entries larger than 128 characters long SHOULD be removed first.
Read more >
Announcing New Relic Support for W3C Trace Context
The W3C Trace Context specification has reached “recommendation” status, and New Relic is supporting the standard immediately.
Read more >
Disable trace event - Oracle Communities
Hi, I have enable a trace and now i want to disable this event trace. How can i do this?? The command that...
Read more >
Oracle event trace types - Burleson Consulting
This affects how Oracle will process sorts: ALTER SESSION SET EVENTS '10119 trace name context forever';. * You can disable the Index FFS...
Read more >
Tampering with Windows Event Tracing: Background, Offense ...
Description: This technique involves the removal of a provider entry from a configured autologger. Removing a provider registration from an autologger will ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found