Skip to content

Collector "json: cannot unmarshal bool into Go value of type string" #2751

Answered by michaelfig
michaelfig asked this question in Q&A
Discussion options

You must be logged in to vote

This is another thing I was able to figure out. My method was to turn on diagnostics with:

import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';

diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.VERBOSE);

Then I changed my use of the BatchSpanProcessor to SimpleSpanProcessor. It narrowed down exactly what message provoked the error. I found that my

span.setStatus({ code: SpanStatusCode.ERROR, message: errorMessage });

code was sending an errorMessage that was false. Ensuring it was only a string instead made the problem go away.

Tracing Happiness!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vmarchaud
Comment options

@michaelfig
Comment options

Answer selected by michaelfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants