open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.13k stars 2.4k forks source link

Otel collector pod not able to collect msges from nlog config for otel #35732

Open ashwinpagarkhed opened 1 month ago

ashwinpagarkhed commented 1 month ago

Nlog collector for otel

receiver/otlpjsonfile

Otel collector pod not able to collect msges from nlog config for otel

We have a central otel collector in a k8s cluster which is collecting metrics and logs from miccroservices from other k8s cluster. This works fine. However we have a few apps which have nlog logging all application logs to a storage account/eventhub.Now we want to get all the nlog logs through otel

This is the nlog.config file for the xml config for the otel collector as per this:

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
      autoReload="true"
      internalLogFile="C:/home/LogFiles/NLog/Internal-otel-final.txt" 
      internalLogLevel="Trace">
 <extensions>
        <add assembly="NLog.Targets.OpenTelemetryProtocol"/>
 </extensions>
<targets>
        <target xsi:type="OtlpTarget"
        name="otlp"
        endpoint="http://nlog.istio.acs314159.com"
        usehttp="true"
        servicename="Bkg"
        resources="process.name=${processname};process.id=${processid};deployment.environment=ashwindev"
        attributes="thread.id=${thread.id}"
        scheduledDelayMilliseconds="1000"
        useDefaultResource="false"
        includeFormattedMessage="true"/>
</targets>
 <rules>
       <logger name="*" minlevel="Debug" writeTo="otlp"/>
</rules>
</nlog>

the internal file for nlog (used to troubleshoot nlog config errors) shows no error with this current config values .

This is the curretn configs of the otel config:

 data:
  relay: >
    exporters:
      debug:
        verbosity: detailed
      otlphttp:
        endpoint: http://signoz.istio-kubernetes-gateway-otel.acs314159.com
    processors:
      batch: {}
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: ${env:MY_POD_IP}:4317
          http:
            endpoint: ${env:MY_POD_IP}:4318

    service:
      pipelines:
        logs:
          exporters:
          - otlphttp
          processors:
          - batch
          receivers:
          - otlp
        metrics:
          exporters:
          - otlphttp
          processors:
          - batch
          receivers:
          - otlp
        metrics/am:
          exporters:
          - otlphttp
          receivers:
          - otlp
        traces:
          exporters:
          - otlphttp
          processors:
          - batch
          receivers:
          - otlp

The image for the olte deployment is : otel/opentelemetry-collector-contrib:0.110.0

with this setup we are not able to recieve any msges in the otel collector(checked after adding debug to exporter and checking in the logs). Any help here would be appreciated! Thanks

github-actions[bot] commented 1 month ago

Pinging code owners:

snakefoot commented 1 month ago

From: https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md#troubleshooting

Notice the opentelemetry-component uses an EventSource with the name "OpenTelemetry-Exporter-OpenTelemetryProtocol" for its internal logging. Please refer to SDK troubleshooting for instructions on seeing these internal logs.

atoulme commented 1 month ago

Apologies, no idea what this is about. Please rephrase.