admin管理员组

文章数量:1435859

I am integrating OpenTelemetry to our C# stack and I am stuck with logging. I can emit logs, and those are correctly assigned to trace via traceId, and I can browse them accordingly, but they are not assigned to service, so I can not display logs for certain service in Instana.

I am emitting service.name attribute for all telemetry and traces and metrics are assigned correctly, only logs are not, and there is no mention of the service in the log message detail. Messages, that are emitted from services, that are covered by Instana Agent have also "Service" information correctly processed and are correctly assigned.

As for my resource attributes and tags, slightly redacted version of my otel-col debug follows:

otel-collector-1  | 2024-11-15T17:59:24.453Z    info    ResourceLog #0
otel-collector-1  | Resource SchemaURL: 
otel-collector-1  | Resource attributes:
otel-collector-1  |      -> telemetry.sdk.name: Str(opentelemetry)
otel-collector-1  |      -> telemetry.sdk.language: Str(dotnet)
otel-collector-1  |      -> telemetry.sdk.version: Str(1.9.0)
otel-collector-1  |      -> deployment.environment.name: Str(development)
otel-collector-1  |      -> service.name: Str(devel-xxx-webapi)
otel-collector-1  |      -> service.namespace: Str(default)
otel-collector-1  |      -> service.version: Str(1.0.0)
otel-collector-1  |      -> service.instance.id: Str(0e394f24-4c4f-4b6d-a9b3-517e674e0f81)
otel-collector-1  | ScopeLogs #0
otel-collector-1  | ScopeLogs SchemaURL: 
otel-collector-1  | InstrumentationScope XXX.WebApi.Api.V1.Controllers.FooController 
otel-collector-1  | LogRecord #0
otel-collector-1  | ObservedTimestamp: 2024-11-15 17:59:23.374383 +0000 UTC
otel-collector-1  | Timestamp: 2024-11-15 17:59:23.374383 +0000 UTC
otel-collector-1  | SeverityText: Information
otel-collector-1  | SeverityNumber: Info(9)
otel-collector-1  | Body: Str(This is an information log from John Appleseed at 11/15/2024 18:59:23!)
otel-collector-1  | Attributes:
otel-collector-1  |      -> Name: Str(John Appleseed)
otel-collector-1  |      -> DateTime: Str(15.11.2024 18:59:23)
otel-collector-1  |      -> {OriginalFormat}: Str(This is an information log from {Name} at {DateTime}!)
otel-collector-1  |      -> SpanId: Str(2bc4c4e49dc822e5)
otel-collector-1  |      -> TraceId: Str(18299d6ae98bfd0fa5d6db4697c83bd6)
otel-collector-1  |      -> ParentId: Str(0000000000000000)
otel-collector-1  |      -> ConnectionId: Str(0HN85JSUB08JR)
otel-collector-1  |      -> RequestId: Str(0HN85JSUB08JR:00000001)
otel-collector-1  |      -> RequestPath: Str(/xxx/v1/foo/log)
otel-collector-1  |      -> ActionId: Str(80c15d73-c0cc-40f5-9374-4d214a8bc330)
otel-collector-1  |      -> ActionName: Str(XXX.WebApi.Api.V1.Controllers.FooController.Log (XXX.WebApi))
otel-collector-1  | Trace ID: 18299d6ae98bfd0fa5d6db4697c83bd6
otel-collector-1  | Span ID: 2bc4c4e49dc822e5
otel-collector-1  | Flags: 1
otel-collector-1  |     {"kind": "exporter", "data_type": "logs", "name": "debug"}

I believe, there will be some attribute or tag, that I need to set, so it is correctly assigned, but I have no idea, what it is, and IBM documentation is no better.

I am integrating OpenTelemetry to our C# stack and I am stuck with logging. I can emit logs, and those are correctly assigned to trace via traceId, and I can browse them accordingly, but they are not assigned to service, so I can not display logs for certain service in Instana.

I am emitting service.name attribute for all telemetry and traces and metrics are assigned correctly, only logs are not, and there is no mention of the service in the log message detail. Messages, that are emitted from services, that are covered by Instana Agent have also "Service" information correctly processed and are correctly assigned.

As for my resource attributes and tags, slightly redacted version of my otel-col debug follows:

otel-collector-1  | 2024-11-15T17:59:24.453Z    info    ResourceLog #0
otel-collector-1  | Resource SchemaURL: 
otel-collector-1  | Resource attributes:
otel-collector-1  |      -> telemetry.sdk.name: Str(opentelemetry)
otel-collector-1  |      -> telemetry.sdk.language: Str(dotnet)
otel-collector-1  |      -> telemetry.sdk.version: Str(1.9.0)
otel-collector-1  |      -> deployment.environment.name: Str(development)
otel-collector-1  |      -> service.name: Str(devel-xxx-webapi)
otel-collector-1  |      -> service.namespace: Str(default)
otel-collector-1  |      -> service.version: Str(1.0.0)
otel-collector-1  |      -> service.instance.id: Str(0e394f24-4c4f-4b6d-a9b3-517e674e0f81)
otel-collector-1  | ScopeLogs #0
otel-collector-1  | ScopeLogs SchemaURL: 
otel-collector-1  | InstrumentationScope XXX.WebApi.Api.V1.Controllers.FooController 
otel-collector-1  | LogRecord #0
otel-collector-1  | ObservedTimestamp: 2024-11-15 17:59:23.374383 +0000 UTC
otel-collector-1  | Timestamp: 2024-11-15 17:59:23.374383 +0000 UTC
otel-collector-1  | SeverityText: Information
otel-collector-1  | SeverityNumber: Info(9)
otel-collector-1  | Body: Str(This is an information log from John Appleseed at 11/15/2024 18:59:23!)
otel-collector-1  | Attributes:
otel-collector-1  |      -> Name: Str(John Appleseed)
otel-collector-1  |      -> DateTime: Str(15.11.2024 18:59:23)
otel-collector-1  |      -> {OriginalFormat}: Str(This is an information log from {Name} at {DateTime}!)
otel-collector-1  |      -> SpanId: Str(2bc4c4e49dc822e5)
otel-collector-1  |      -> TraceId: Str(18299d6ae98bfd0fa5d6db4697c83bd6)
otel-collector-1  |      -> ParentId: Str(0000000000000000)
otel-collector-1  |      -> ConnectionId: Str(0HN85JSUB08JR)
otel-collector-1  |      -> RequestId: Str(0HN85JSUB08JR:00000001)
otel-collector-1  |      -> RequestPath: Str(/xxx/v1/foo/log)
otel-collector-1  |      -> ActionId: Str(80c15d73-c0cc-40f5-9374-4d214a8bc330)
otel-collector-1  |      -> ActionName: Str(XXX.WebApi.Api.V1.Controllers.FooController.Log (XXX.WebApi))
otel-collector-1  | Trace ID: 18299d6ae98bfd0fa5d6db4697c83bd6
otel-collector-1  | Span ID: 2bc4c4e49dc822e5
otel-collector-1  | Flags: 1
otel-collector-1  |     {"kind": "exporter", "data_type": "logs", "name": "debug"}

I believe, there will be some attribute or tag, that I need to set, so it is correctly assigned, but I have no idea, what it is, and IBM documentation is no better.

Share Improve this question edited Nov 15, 2024 at 19:42 Miro Hudak asked Nov 15, 2024 at 19:36 Miro HudakMiro Hudak 2,2132 gold badges22 silver badges31 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Thank you for your question.

As you have mentioned, the logs are correlated to the calls through traceId at the moment. Currently we cannot use any configurations or auto-assigment to correlate the logs to the Instana services. This is a gap and we acknowledge it.

We are continuously improving our logging area and we plan to fix this gap as well. We do not have any timeline for this, as of now.

本文标签: aspnetHow to assign log messages to service in Instana via OpenTelemetryStack Overflow