Replies: 1 comment
-
|
#5184 Closing as duplicate |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to remove duplicate & non relevant attributes from the Otlp Log record before it is exported to OTLP log collector destination
I tried adding my own
LogProcessorusing an derived implementation ofBaseProcessor<LogRecord>. it does not work becauseLogRecord.attributesdoes not have these values when Otel library calls my implementationSample json log for reference
{ "resourceLogs": [ { "resource": { "attributes": [ { "key": "service.name", "value": { "stringValue": "OtelLokiLogTest" } }, { "key": "service.instance.id", "value": { "stringValue": "7cf6b018-0330-41f6-9846-4d5d69a6571e" } }, { "key": "telemetry.sdk.name", "value": { "stringValue": "opentelemetry" } }, { "key": "telemetry.sdk.language", "value": { "stringValue": "dotnet" } }, { "key": "telemetry.sdk.version", "value": { "stringValue": "1.6.0" } } ] }, "scopeLogs": [ { "logRecords": [ { "timeUnixNano": "1701859790202535200", "severityNumber": "SEVERITY_NUMBER_INFO", "severityText": "Information", "body": { "stringValue": "Get Weatherforecast function called 2023-12-06 4:19:50 PM" }, "attributes": [ { "key": "date", "value": { "stringValue": "2023-12-06 4:19:50 PM" } }, { "key": "{OriginalFormat}", "value": { "stringValue": "Get Weatherforecast function called {date}" } }, { "key": "SpanId", "value": { "stringValue": "d840418c7f429c48" } }, { "key": "TraceId", "value": { "stringValue": "a4ba025a812e1d889c062a8319f7e951" } }, { "key": "ParentId", "value": { "stringValue": "0000000000000000" } }, { "key": "ConnectionId", "value": { "stringValue": "0HMVM93BK0GTU" } }, { "key": "RequestId", "value": { "stringValue": "0HMVM93BK0GTU:00000003" } }, { "key": "RequestPath", "value": { "stringValue": "/weatherforecast" } }, { "key": "ActionId", "value": { "stringValue": "9eb2e807-14ab-410a-99a8-995b556f9362" } }, { "key": "ActionName", "value": { "stringValue": "OtelLokiLogTest.Controllers.WeatherForecastController.Get (OtelLokiLogTest)" } }, { "key": "name", "value": { "stringValue": "Eloise Stracke" } }, { "key": "age", "value": { "intValue": "82" } }, { "key": "address", "value": { "stringValue": "Klingport" } } ], "traceId": "pLoCWoEuHYicBiqDGffpUQ==", "spanId": "2EBBjH9CnEg=", "observedTimeUnixNano": "1701859790202535200" } ] } ] } ] }Beta Was this translation helpful? Give feedback.
All reactions