Coder Social home page Coder Social logo

remychantenay / slog-otel Goto Github PK

View Code? Open in Web Editor NEW
92.0 1.0 5.0 31 KB

Go slog's Handler implementation to ensure correlation with Open-Telemetry spans.

License: Apache License 2.0

Makefile 0.89% Go 99.11%
golang logging open-telemetry otel slog tracing

slog-otel's Introduction

About me

Not much yet.

slog-otel's People

Contributors

remychantenay avatar scr-oath avatar stephenafamo avatar tomerf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

slog-otel's Issues

for logs/traces on GCP, need to stop writing the event log

Much like the option for NoBaggage, need a way to stop writing the event logs to the traces - this is correlation is done automatically (and views better than a vanilla event) when the logs are fed to GCP's logs as long as the trace_id and span_id are moved up to the OTEL log record by the OTEL collector (i.e. via trace_parser)

[Bug] Slices aren't being recorded

Hi,

First of all - wanted to thank you for making a great library. I am reaching out because while using this library, I noticed a small bug. When I have a slice of string or any in an argument, it doesn't get recorded.

Example:

strs := make([]string, 2)
strs = append(strs, "arg1")
strs = append(strs, "arg2")
slog.InfoContext(ctx, "arguments", "strs", strs)

This shows up fine on my log output with the appropriate trace_id and span_id. However, the argument doesn't get recorded with OTel and is missing from the resulting trace. My configuration is the same as the usage example:

slog.SetDefault(slog.New(slogotel.OtelHandler{
    Next: slog.NewJSONHandler(os.Stdout, nil),
}))

First, I thought that this might be a bug on the receiver side, but then I switched to using stdouttrace and still noticed that it isn't getting recorded. If I marshal the array into a JSON string and then log it with slog, it works fine and shows up in the trace. Are you able to replicate this from your end?

Thanks,
Faraz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.