#support

Unable to View Service in Services Tab, Only Sees Logs

TLDR Srikanth is unable to see their service in the services tab and asks for help. Srikanth suggests using OpenTelemetry and provides resources. Srikanth tries suggested changes but still experiences issues.

Powered by Struct AI
Jun 07, 2023 (6 months ago)
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
11:25 AM
Hi All, I am able to see the logs of my service but not able to see my service in the services tab section, what should I do differently to see this
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
03:52 PM
They are based on the traces data.
Al
Photo of md5-4a36c3bc25964c64330a5747ba443346
Al
08:04 PM
Subscribing for updates.
Jun 08, 2023 (6 months ago)
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
04:21 AM
how can we get that?
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
04:35 AM
Do you use OpenTelemetry to instrument your applications?
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
04:42 AM
using winston
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
04:51 AM
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
04:52 AM
registerInstrumentations({
    instrumentations: [
        new WinstonInstrumentation({
            enabled: true,
            logHook: (_span, record) => {
                record['resource.service.name'] = 'test-service';
            },
        }),
    ],
});
04:52
Srikanth
04:52 AM
I am doing this, is this what's expected?
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
04:54 AM
You are just registering one logging instrumentation. There are a bunch of others that should be registered. The above links show how to do it.
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
04:55 AM
let me share my entire file with you
04:55
Srikanth
04:55 AM
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { ConsoleSpanExporter, InMemorySpanExporter, SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { WinstonInstrumentation } = require('@opentelemetry/instrumentation-winston');

const memoryExporter = new InMemorySpanExporter();
const provider = new NodeTracerProvider();
provider.register();
const tracer = provider.getTracer('default');
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
registerInstrumentations({
    instrumentations: [
        new WinstonInstrumentation({
            enabled: true,
            logHook: (_span, record) => {
                record['resource.service.name'] = 'test-service';
            },
        }),
    ],
});

const winston = require('winston');

global.logger = winston.createLogger({
    transports: [
        new winston.transports.Console(),
    ],
})

function main() {
    tracer.startActiveSpan('main', (span) => {
        ("Started the span, printing context");
        (span.spanContext());
        ("In main main spanning");
        require('./server.js');
    });
    ("Ended span in main");
}

main();
04:55
Srikanth
04:55 AM
we have followed the link to get this
04:55
Srikanth
04:55 AM
are we missing anything?
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
04:56 AM
> we have followed the link to get this
What link have you followed?
04:57
Srikanth
04:57 AM
> are we missing anything?
You are only enabling the logging. Please register all the instrumentation using auto-instrumentation https://signoz.io/blog/nodejs-opensource-application-monitoring/#set-up-opentelemetry-and-send-data-to-signoz
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
04:58 AM
Thank you!
I'll have a look
05:49
Srikanth
05:49 AM
Srikanth I did the following but no luck
05:49
Srikanth
05:49 AM
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { ConsoleSpanExporter, InMemorySpanExporter, SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { WinstonInstrumentation } = require('@opentelemetry/instrumentation-winston');

const memoryExporter = new InMemorySpanExporter();
const provider = new NodeTracerProvider();
provider.register(({
    resource: new Resource({
      [SemanticResourceAttributes.SERVICE_NAME]: 'bot-service',
    }),
  }));
const tracer = provider.getTracer('default');
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
registerInstrumentations({
    instrumentations: [getNodeAutoInstrumentations()],
});

const winston = require('winston');

global.logger = winston.createLogger({
    transports: [
        new winston.transports.Console(),
    ],
})

function main() {
    tracer.startActiveSpan('main', (span) => {
        ("Started the span, printing context");
        (span.spanContext());
        ("In main main spanning");
        require('./server.js');
    });
    ("Ended span in main");
}

main();
05:50
Srikanth
05:50 AM
I see that now I am continuously seeing the following in the logs

{
function_bot  |   traceId: '805f6f9bd44083e258988819acc9ca40',
function_bot  |   parentId: 'e886397ea5108622',
function_bot  |   traceState: undefined,
function_bot  |   name: 'fs statSync',
function_bot  |   id: '0eb6f165db3376df',
function_bot  |   kind: 0,
function_bot  |   timestamp: 1686203300970000,
function_bot  |   duration: 25,
function_bot  |   attributes: {},
function_bot  |   status: { code: 0 },
function_bot  |   events: [],
function_bot  |   links: []
function_bot  | } 
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
08:11 AM
Because you added the console exporter. I don’t see a console exporter in the link I shared. What did you refer to make the above changes?
Srikanth
Photo of md5-830694e439a75261e1bbabcf82dc07f9
Srikanth
09:40 AM
I just made the extra changes missing in the file from the above link that you shared
09:40
Srikanth
09:40 AM
I picked up the task now, that file was already there
09:41
Srikanth
09:41 AM
they're using winston for logging
09:41
Srikanth
09:41 AM
anyway i removed ConsoleSpanExporter, it's still not working as expected Srikanth
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
09:50 AM
Sorry, I don’t follow; who is they here, and what file was already there? Please make sure to setup the instrumentation correctly. Please see our docs shared above.

SigNoz Community

Built with ClickHouse as datastore, SigNoz is an open-source APM to help you find issues in your deployed applications & solve them quickly | Knowledge Base powered by Struct.AI

Indexed 1023 threads (61% resolved)

Join Our Community

Similar Threads

Node Tracing Error & Angular Console Error

Angeles experienced errors in both node tracing and Angular console. Prashant asked for the guide used, while vishal-signoz checked the express and otel versions. Palash was asked to check the angular part.

14
9mo

Troubleshooting Log Parsing Issue in SigNoz

Saad is having issues with large JSON log messages being split into multiple lines by SigNoz. nitya-signoz suggested adjusting `max_log_line` and shared relevant resources, but the issue remains unresolved.

1

30
5d

Troubleshooting SigNoz Monitoring for AWS EC2 Docker-Compose Application

dipak has problems with SigNoz integration to monitor containers in an AWS EC2 Docker-Compose application. Prashant suggests updating the dashboard and using different guides for log collection, metrics collection and application instrumentation. Issues are still unresolved.

3

14
3mo

Exporting OpenTelemetry Data from Pixie to SigNoz on Kubernetes

Nilanjan asks how to export opentelemetry data from Pixie to SigNoz on the same Kubernetes cluster. Srikanth suggests configuring the endpoint of the collector in Pixie, but viewing the data in SigNoz dashboard remains unresolved.

6
7mo

Troubleshooting SigNoz Auto-Instrumentation Configuration

igor is having trouble configuring auto-instrumentation for Java applications using SigNoz, with traces not appearing in the SigNoz UI. Prashant advises to check logs of the otel sidecar, use service name for endpoint, verify supported libraries, and test with telemetrygen. However, the issue still persists.

34
8mo