Skip to content

Conversation

@merchantmoh-debug
Copy link
Contributor

Adds a new optional module github.com/google/go-github/v81/otel which provides an http.RoundTripper instrumented with OpenTelemetry.

Features

  • Automatic Tracing: Every API call gets a semantic span (e.g., github/GET).
  • Rate Limit Observability: Parses GitHub headers (X-RateLimit-*) and records them as Span Attributes (github.rate_limit.remaining, github.rate_limit.reset).
  • Support Tracing: Records X-Github-Request-Id for easy debugging with GitHub Support.

Verification

Validated with otel/example app against the live API.
Dependencies are isolated in a nested module to avoid bloating core go-github.

google-labs-jules bot and others added 30 commits January 11, 2026 12:59
Adds a warning to the `NewClient` function documentation to inform developers that the default `http.Client` (created when passing `nil`) has no timeout, which can be a security risk in production environments.
…rovement-10999790790030565127

Add security warning to NewClient documentation
- Replaces expensive `fmt.Fprintf` with direct `bytes.Buffer` writes in `Stringify` for the string case, resulting in ~2x performance improvement.
- Adds a documentation warning to `NewClient` about the lack of timeout when using the default HTTP client.
…rovement-10999790790030565127

perf: Optimize Stringify for strings and add NewClient warning
- Implement a buffer pool for `Stringify` to reduce memory allocations.
- Replace `fmt.Fprintf` with `strconv` for primitive types (Bool, Int, Uint, Float) to avoid reflection overhead.
- Ensure correct `bitSize` for `float32` and `float64` to prevent precision artifacts.
- Adds a documentation warning to `NewClient` about the lack of timeout when using the default HTTP client.
…rovement-10999790790030565127

perf: Optimize Stringify with sync.Pool and strconv
…ent safety

- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` to verify performance and correctness.
…rovement-10999790790030565127

Bolt sentinel client improvement 10999790790030565127
- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` to verify performance and correctness.
- Include table-driven test `TestStringify_Primitives` in `strings_test.go` to verify all primitive type code paths.
…rovement-10999790790030565127

perf: Optimize Stringify with sync.Pool and strconv
…ent safety

- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` to verify performance.
- Add table-driven tests in `strings_test.go` covering all primitive types, edge cases (min/max), and precision.
…rovement-10999790790030565127

perf: Optimize Stringify allocations (~2x faster) and document NewCli…
…ent safety

- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` to verify performance.
- Add table-driven tests in `strings_test.go` covering all primitive types, edge cases (min/max), and precision.
- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` to verify performance.
- Add comprehensive table-driven tests in `strings_test.go` verifying correctness for all primitive types, edge cases (min/max), precision, and concurrency safety.
- Fix all linting issues (parallel tests, error formatting, range loops).
…rovement-10999790790030565127

Bolt sentinel client improvement 10999790790030565127
…ent safety

- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` to verify performance.
- Add table-driven tests in `strings_test.go` covering all primitive types, edge cases (min/max), precision, and concurrency safety.
- Fix all linting issues (parallel tests, error formatting, range loops).
…rovement-10999790790030565127

perf: Optimize Stringify allocations (~2x faster) and document NewCli…
…ent safety

- Implement sync.Pool for bytes.Buffer reuse in Stringify.
- Replace fmt.Fprintf with zero-allocation strconv calls for primitives.
- Fix float32/float64 formatting precision.
- Add security warning to NewClient regarding default client timeouts.
- Include benchmark test file `strings_benchmark_test.go` using idiomatic Go 1.24 features.
- Add comprehensive table-driven tests in `strings_test.go` verifying correctness for all primitive types, edge cases (min/max), precision, and concurrency safety.
- Fix all linting issues (parallel tests, error formatting, range loops, b.Loop).
…rovement-10999790790030565127

perf: Optimize Stringify allocations (~2x faster) and document NewCli…
…provement-10999790790030565127-15006340757148053698

Revert a89c0a6 from bolt branch
@merchantmoh-debug
Copy link
Contributor Author

@gmlewis - Surprise!

Haha. Please review.

@gmlewis
Copy link
Collaborator

gmlewis commented Jan 24, 2026

@merchantmoh-debug - I'm starting to think I'm talking to a bot.
This is a duplicate of #3916 and the description and subject are wrong.

@merchantmoh-debug
Copy link
Contributor Author

@gmlewis - Yeah. My bad. It's on my local disk set up. I use antigravity heavily. It likely made an error.

I'll fix it.

@merchantmoh-debug merchantmoh-debug force-pushed the feat/opentelemetry-support branch from 1d9b307 to 4536640 Compare January 24, 2026 03:00
@merchantmoh-debug
Copy link
Contributor Author

@merchantmoh-debug - I'm starting to think I'm talking to a bot. This is a duplicate of #3916 and the description and subject are wrong.

A bot that codes 3x performance boosts to stringify?

Can I get access to that bot please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants