{"id":19427424,"url":"https://github.com/solarwinds/apm-go","last_synced_at":"2026-04-17T21:01:06.700Z","repository":{"id":195863926,"uuid":"691486633","full_name":"solarwinds/apm-go","owner":"solarwinds","description":"OpenTelemetry-based SolarWinds APM Go library","archived":false,"fork":false,"pushed_at":"2026-04-17T16:58:00.000Z","size":6976,"stargazers_count":4,"open_issues_count":8,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-17T18:28:34.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solarwinds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-14T09:23:13.000Z","updated_at":"2026-04-17T13:30:12.000Z","dependencies_parsed_at":"2023-09-19T23:09:07.163Z","dependency_job_id":"21d550e2-8930-4559-9a51-76c852532850","html_url":"https://github.com/solarwinds/apm-go","commit_stats":null,"previous_names":["solarwinds/apm-go"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/solarwinds/apm-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Fapm-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Fapm-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Fapm-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Fapm-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solarwinds","download_url":"https://codeload.github.com/solarwinds/apm-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Fapm-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31945987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:11:42.982Z","updated_at":"2026-04-17T21:01:06.691Z","avatar_url":"https://github.com/solarwinds.png","language":"Go","readme":"# SolarWinds APM Go\n\n## Getting started\n\nℹ️ Check out the [usage examples](examples) to see how easy it is to get \nstarted. The following code snippets are adapted from the [http \nexample](examples/http).\n\nTo use in your Go project:\n\n### Initialize the library\n\n```go\n// Initialize the SolarWinds APM library\ncb, err := swo.Start(\n\t// Optionally add service-level resource attributes \n\tsemconv.ServiceName(\"my-service\"),\n\tsemconv.ServiceVersion(\"v0.0.1\"),\n\tattribute.String(\"environment\", \"testing\"),\n)\nif err != nil {\n\t// Handle error\n}\n// This function returned from `Start()` will tell the apm library to\n// shut down, often deferred until the end of `main()`.\ndefer cb()\n```\n\n### Instrument your code\n\nMany packages have instrumentation-enabled versions. We provide a simple \nwrapper for `net/http` server requests. Here's an example:\n\n```go\n// Create a new handler to respond to any request with the text it was given\nechoHandler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\tif text, err := io.ReadAll(req.Body); err != nil {\n\t\t// The `trace` package is from the OpenTelemetry Go SDK. Here we\n\t\t// retrieve the current span for this request...\n\t\tspan := trace.SpanFromContext(req.Context())\n\t\t// ...so that we can record the error.\n\t\tspan.RecordError(err)\n\t\tspan.SetStatus(codes.Error, \"failed to read body\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t} else {\n\t\t// If no error, we simply echo back.\n\t\t_, _ = w.Write(text)\n\t}\n})\nmux := http.NewServeMux()\n// Wrap echoHandler function with otelhttp instrumentation\nmux.Handle(\"/echo\", swohttp.WrapBaseHandler(echoHandler, \"/echo\"))\n\nhttp.ListenAndServe(\":8080\", mux)\n```\n\nThere are many instrumented libraries available. Here are the libraries we\ncurrently support:\n\n  * Any of the instrumentation in [opentelemetry-go-contrib\n](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation)\n    * _Caveat_: For `net/http` servers, it's best to use our wrapper (as seen\n      in the above example) to correctly attribute distributed trace data.\n  * For SQL: [XSAM/otelsql](https://github.com/XSAM/otelsql)\n\nOpenTelemetry provides a\n[registry](https://opentelemetry.io/ecosystem/registry/?language=go\u0026component=instrumentation)\nfor these libraries, just note that each is at a different maturity\nlevel, as the OpenTelemetry landscape is developing at a rapid pace.\n\n\n### Manual instrumentation\n\nYou may also [manually \ninstrument](https://opentelemetry.io/docs/instrumentation/go/manual/) your code\nusing the OpenTelemetry SDK and it will be properly propagated to SolarWinds\nObservability.\n\nTo create a new Span, first acquire a `Tracer`. Often, this will be a\npackage-level variable.\n\n```go\ntracer := otel.GetTracerProvider().Tracer(\"example.com/foo\")\n```\n\nNext, create a Span and defer its `End()`\n\n```go\nfunc myFunc(ctx context.Context) {\n    ctx, span := tracer.Start(ctx, \"span name here\")\n    defer span.End()\n    // ...do some work\n}\n```\n\nIn this example, the span will be created at the beginning of the function and\nended at the end of the function (via [defer](https://go.dev/tour/flowcontrol/12)).\n\nSpan context is propagated via [`context.Context`](https://pkg.go.dev/context), \nmaking it easy to nest spans:\n\n```go\n    ctx, spanA := tracer.Start(ctx, \"outer span\")\n    defer spanA.End()\n    ctx, spanB := tracer.Start(ctx, \"inner span\")\n    defer spanB.End()\n```\n\n### Configuration\n\nThe only environment variable you need to set before kicking off is the service key:\n\n| Variable Name      | Required | Description                                                                                                                                     |\n|--------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| SW_APM_SERVICE_KEY | Yes      | The service key identifies the service being instrumented within your Organization. It should be in the form of ``\u003capi token\u003e:\u003cservice name\u003e``. |\n\n## Compatibility\n\nWe support the same environments as\n[OpenTelemetry-Go](https://github.com/open-telemetry/opentelemetry-go#compatibility).\n\n## License\n\nCopyright (C) 2023 SolarWinds, LLC\n\nReleased under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n## Miscellaneous\n\nOriginally forked from the [appoptics-apm-go](https://github.com/appoptics/appoptics-apm-go) repository.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarwinds%2Fapm-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolarwinds%2Fapm-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarwinds%2Fapm-go/lists"}