tailscale / tailscale/tailscale-rs

bindings: plumb tracing into language-native logging

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement language support
Dominant language
Rust
Stars
1.2k
Forks
61
Avg merge
2d 13h
Merged PRs (30d)
22

Description

Want some pre-baked functionality to define language-specific tracing subscribers so we can get tailscale-rs tracing output without stepping on the language-specific stuff. I have this marked as an enhancement, but it verges on bugfix, imo, as you're basically blind without a capability like this.

In python you might have something like:

import tailscale
import logging

TAILSCALE_LOGGER = logging.getLogger('tailscale')

def my_trace_logger(level, message, fields):
    TAILSCALE_LOGGER.log(level, message, **fields) # illustrative -- the mapping is going to be more involved

tailscale.bind_tracer(my_trace_logger)

With a similar idea per language: give each the ability to bind a custom function to do whatever they want with.

pre-baked convenience converters

It'd be nice if we provided batteries-included converters for the most popular logging frameworks in each language, e.g.:

import tailscale

tailscale.bind_tracer(tailscale.LOGGING_TRACER)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or binding entry points. Start by locating the repository's language bindings and existing tracing setup, then determine how a per-language callback and convenience converters would fit each interface. Done means custom tracing handlers can be bound for the supported languages and the proposed logging behavior is defined and covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
api, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.