Hello. I'm working on sending traces from a Nextjs app, and if I use the console exporter, I can see...
m

Marc Trepanier

over 1 year ago
Hello. I'm working on sending traces from a Nextjs app, and if I use the console exporter, I can see that there are traces being created. When I then switch to the OTLPTraceExporter, I'm getting the following error in my logs:
{"stack":"Error: connect ECONNREFUSED 127.0.0.1:4318\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)\n    at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)","message":"connect ECONNREFUSED 127.0.0.1:4318","errno":"-61","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":"4318","name":"Error"}
My instrumentation file: (Note access token has been redacted)
"use strict";

import { NodeSDK } from "@opentelemetry/sdk-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { Resource } from "@opentelemetry/resources";
import { SEMRESATTRS_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";

diag.setLogger(new DiagConsoleLogger(), <http://DiagLogLevel.INFO|DiagLogLevel.INFO>);

// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const exporterOptions = {
  url: "<https://ingest.eu.signoz.cloud:443/v1/traces>", // use your own data region or use localhost:8080 for self-hosted
  headers: { "signoz-access-token": "your-access-token" }, // Use if you are using SigNoz Cloud
};
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new NodeSDK({
  resource: new Resource({
    [SEMRESATTRS_SERVICE_NAME]: `LEO-${process.env.APP_ENV}`,
  }),
  serviceName: `LEO-${process.env.APP_ENV}`,
  traceExporter,
  instrumentations: [getNodeAutoInstrumentations()],
  spanProcessors: [new SimpleSpanProcessor(new OTLPTraceExporter())],
});

// 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));
});
Hi, I’m migrating from an old signoz version to the latest one, I have this issue: ``` ✘ Container o...
r

Romario Lopez C

10 months ago
Hi, I’m migrating from an old signoz version to the latest one, I have this issue:
✘ Container otel-migrator-sync  service "otel-collector-migrator-sync" didn't complete successfully: exit 1                                                                                                               0.0s
I saw the same issue in github here. I tried to delete the
data/clickhouse/
contents with which returns:
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/.gitkeep': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/user_scripts': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/tmp': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/user_files': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/format_schemas': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/preprocessed_configs': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/uuid': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/flags': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/dictionaries_lib': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/data': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/metadata': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/metadata_dropped': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/rocksdb': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/access': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/store': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/user_defined': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/named_collections': Permission denied
rm: cannot remove 'docker/clickhouse-setup/data/clickhouse/status': Permission denied
Has someone had this issue?