Skip to content

feat(pyroscope): add Grafana Pyroscope component#62

Merged
kooksee merged 3 commits into
v2from
feat/pyroscope-component
Jun 16, 2026
Merged

feat(pyroscope): add Grafana Pyroscope component#62
kooksee merged 3 commits into
v2from
feat/pyroscope-component

Conversation

@kooksee

@kooksee kooksee commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add component/pyroscope wrapping github.com/grafana/pyroscope-go for continuous profiling
  • Provide YAML-friendly config, lifecycle BeforeStop shutdown, zerolog adapter, default service tags, and TagWrapper re-exports
  • Include README, unit tests, and a runnable push-mode example

Test plan

  • go test ./component/pyroscope/...
  • go build ./component/pyroscope/example/
  • make lint
  • Manual: run example against a Pyroscope server (PYROSCOPE_SERVER=http://localhost:4040 go run ./component/pyroscope/example)

Made with Cursor

Wrap pyroscope-go with YAML config, lifecycle shutdown, log adapter, default tags, and a runnable example.

Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new pyroscope component to integrate Grafana Pyroscope continuous profiling into Go services, complete with configuration, context tagging, logging adapters, unit tests, and an example. Feedback focuses on improving reliability: first, by avoiding a startup panic if the Pyroscope profiler fails to initialize (since profiling is non-critical, it should fail gracefully and return a disabled client); second, by adding a defensive nil check in mergeConfig to prevent potential panics when a nil configuration is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread component/pyroscope/client.go Outdated
Comment thread component/pyroscope/config.go
@kooksee kooksee changed the base branch from v2 to master June 16, 2026 22:50
@kooksee kooksee marked this pull request as draft June 16, 2026 22:50
Log disabled/skipped paths, startup config summary, flush, and graceful shutdown via lifecycle hooks.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kooksee kooksee changed the base branch from master to v2 June 16, 2026 22:55
Return a disabled client when profiler startup fails and guard mergeConfig against nil input.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kooksee kooksee marked this pull request as ready for review June 16, 2026 22:59
@kooksee kooksee merged commit e652fb9 into v2 Jun 16, 2026
2 checks passed
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.

1 participant