https://signoz.io logo
#support
Title
# support
a

Abdulmalik Salawu

12/17/2023, 11:46 AM
i am getting this error from otel-collector-metrics
Copy code
E1215 04:12:12.073652       1 reflector.go:148] pkg/mod/k8s.io/client-go@v0.27.2/tools/cache/reflector.go:231: Failed to watch *v1.Pod: the server has asked for the client to provide credentials (get pods)
W1215 04:12:13.511381       1 reflector.go:533] pkg/mod/k8s.io/client-go@v0.27.2/tools/cache/reflector.go:231: failed to list *v1.Pod: Unauthorized
E1215 04:12:13.511620       1 reflector.go:148] pkg/mod/k8s.io/client-go@v0.27.2/tools/cache/reflector.go:231: Failed to watch *v1.Pod: failed to list *v1.Pod: Unauthorized
W1215 04:12:15.952621       1 reflector.go:533] pkg/mod/k8s.io/client-go@v0.27.2/tools/cache/reflector.go:231: failed to list *v1.Pod: Unauthorized
E1215 04:12:15.952677       1 reflector.go:148] pkg/mod/k8s.io/client-go@v0.27.2/tools/cache/reflector.go:231: Failed to watch *v1.Pod: failed to list *v1.Pod: Unauthorized
p

Pranay

12/17/2023, 1:39 PM
@Abdulmalik Salawu Can you share which version of SigNoz you are running and which language app are you trying to instrument
a

Abdulmalik Salawu

12/17/2023, 2:05 PM
thanks for your response, version "0.28.1", language is typescript, also here is my tracer.ts
Copy code
// tracing.ts
  'use strict'
  const process = require('process');
  import * as opentelemetry from '@opentelemetry/sdk-node';
  import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
  import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
  import { Resource } from '@opentelemetry/resources';
  import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';

  const exporterOptions = {
    url: '<http://signoz-otel-collector.platform.svc.cluster.local:4318/v1/traces>'
  }

  const traceExporter = new OTLPTraceExporter(exporterOptions);
  const sdk = new opentelemetry.NodeSDK({
    traceExporter,
    instrumentations: [getNodeAutoInstrumentations()],
    resource: new Resource({
      [SemanticResourceAttributes.SERVICE_NAME]: 'posts_service'
    })
    });

    // initialize the SDK and register with the OpenTelemetry API
    // this enables the API to record telemetry
    sdk.start()

    // gracefully shut down the SDK on process exit
    process.on('SIGTERM', () => {
      sdk.shutdown()
      .then(() => console.log('Tracing terminated'))
      .catch((error) => console.log('Error terminating tracing', error))
      .finally(() => process.exit(0));
      });

      export default sdk;
and here is how i called it in my index.ts
Copy code
import mongoose from 'mongoose';
import { app } from './app';
import tracer  from './tracer';
import dotenv from 'dotenv';

dotenv.config();
const start = async () => {
  await tracer.start();
2 Views