`SigNoz Log Collector using Serilog` Anyone here c...
# support
p
SigNoz Log Collector using Serilog
Anyone here can help me out configuring Serilog OpenTelemetry Sink with SigNoz to collect the logs in k8s? Following things I have configured in .NET Serilog
Copy code
.WriteTo.OpenTelemetry(options =>
{
    options.Endpoint = endPoint;
    options.Protocol = OtlpProtocol.Grpc;
    // Prevent tracing of outbound requests from the sink
    options.HttpMessageHandler = new SocketsHttpHandler { ActivityHeadersPropagator = null };
    options.IncludedData =
        IncludedData.SpanIdField
        | IncludedData.TraceIdField
        | IncludedData.MessageTemplateTextAttribute
        | IncludedData.MessageTemplateMD5HashAttribute;
    options.ResourceAttributes = new Dictionary<string, object>
    {
        ["service.name"] = serviceName,
        ["index"] = 10,
        ["flag"] = true,
        ["pi"] = 3.14
    };
    //options.Headers = new Dictionary<string, string>
    //{
    //    ["Authorization"] = "Basic dXNlcjphYmMxMjM=", // user:abc123
    //};
    options.BatchingOptions.BatchSizeLimit = 700;
    options.BatchingOptions.Period = TimeSpan.FromSeconds(1);
    options.BatchingOptions.QueueLimit = 10;
});
Endpoint is "http://my-signoz-k8s-infra-otel-agent.signoz-ns:4317" where "signoz-ns" is namespace containing signoz installation in K8S
p
Assuming the repo example is well up to date. The endpoint might not be correctly set here.
Can you switch to downward k8s API to get
HOST_IP:4317
instead? Set the following env for your app manifest:
Copy code
env:
  - name: HOST_IP
    valueFrom:
      fieldRef:
        fieldPath: status.hostIP
And followed by using
http://$(HOST_IP):4317
for your endpoint.