I started implementing SigNoz with nestJs and Grap...
# support
e
I started implementing SigNoz with nestJs and GraphQL hosted on a K8S cluster. However, I have a question At a first look, I'm not able to see the body of the requests being captured in the traces Do you know where I can check the body of the requests? This is the trace.ts that I'm using.
Copy code
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'
import { Resource } from '@opentelemetry/resources'
import process from 'process'
import { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql'
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
import { NestInstrumentation } from '@opentelemetry/instrumentation-nestjs-core'
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node'
import { NodeSDK } from '@opentelemetry/sdk-node'
import { ConfigService } from '@nestjs/config'

export async function initTrace(configService: ConfigService<Record<string, unknown>, false>) {
    const exporterOptions = {
      url: configService.get<string>('gateway-graphql.APM_URL') || '0.0.0.0',
    }
    const traceExporter = new OTLPTraceExporter(exporterOptions)
  
    const tracer = new NodeSDK({
      traceExporter,
      instrumentations: [new GraphQLInstrumentation(),new HttpInstrumentation(),new NestInstrumentation()],
      resource: new Resource({
        [SemanticResourceAttributes.SERVICE_NAME]: 'gateway-graphql',
      }),
    })
  
    tracer
      .start()
      .then(() => console.log('Tracing initialized'))
      .catch((error) => console.log('Error initializing tracing', error))
  
  
  
    // gracefully shut down the SDK on process exit
    process.on('SIGTERM', () => {
      tracer
        .shutdown()
        .then(() => console.log('Tracing terminated'))
        .catch((error) => console.log('Error terminating tracing', error))
        .finally(() => process.exit(0))
    })
  
    await tracer.start()
    console.log('tracer.started')
  }
s
The request (or response) body is not captured. And there are many reasons to not capture. Non-exhaustive reasons 1. the amount of data will grow multifold 2. It will contain sensitive info. 3. It will lead to SDK’s poor performance of the additional overhead this introduces in terms of CPU, memory, and many more. In general practice, the request body is not captured as a part of tracing telemetry. If there is something you are interested in, you would instead make it something like a header and just capture it (that has config options).
e
Thank you @Srikanth Chekuri for he response.
Where to configure these kind of options ?
Plus, I got part of the body captured and the whole one, like only this one
Any way I can configure the rest ?
s
What configuration are you referring to? Can you be more specific?
e
The one you mentioned, where can to find a documentation for this configuration
s
Each instrumentation readme includes the detailed usage here https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node
e
Will check it, thank you for the help !