Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditional instrumentation and profiling options for server example #854

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions v3/examples/server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
By default, building the server application here (e.g., via `go build` or `go run main.go`) will create a simple web service that is instrumented by the Go Agent. This
has a number of HTTP endpoints which demonstrate different capabilities:
`/`
`/add_attribute`
`/add_span_attribute`
`/async`
`/background_log`
`/background`
`/browser`
`/custom_event`
`/custommetric`
`/external`
`/ignore`
`/log`
`/message`
`/mysql`
`/notice_error_with_attributes`
`/notice_error`
`/notice_expected_error`
`/roundtripper`
`/segments`
`/set_name`
`/version`
All of these are served from TCP port 8000 on the local host.

However, if you build the application with `go build -tags control`, you'll get a "control" version which does not use the Go Agent, to compare against if you are testing to see how an app performs with and without the agent.

If you build with `go build -tags profiling`, you will get a version which generates CPU and memory profiling data. You can get both (a profiling, non-agent version) by including both tags as `go build -tags profiling,control`.
6 changes: 6 additions & 0 deletions v3/examples/server/instrumentation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build !control
// +build !control

package main

const instrumentCode = true
Loading
Loading