{"id":22479644,"url":"https://github.com/nxdir-s/telemetry","last_synced_at":"2026-04-01T23:02:55.165Z","repository":{"id":257124013,"uuid":"853632522","full_name":"nxdir-s/telemetry","owner":"nxdir-s","description":"Open Telemetry Utilities for Go","archived":false,"fork":false,"pushed_at":"2026-03-22T06:50:45.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-22T21:41:38.998Z","etag":null,"topics":["go","golang","observability","opentelemetry","opentelemetry-go","telemetry"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nxdir-s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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":"2024-09-07T04:55:01.000Z","updated_at":"2026-03-22T06:47:58.000Z","dependencies_parsed_at":"2024-09-15T00:13:10.616Z","dependency_job_id":"2c52ab4d-2eef-48e0-949c-acd019a5ea1e","html_url":"https://github.com/nxdir-s/telemetry","commit_stats":null,"previous_names":["nxdir-s/telemetry"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/nxdir-s/telemetry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxdir-s%2Ftelemetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxdir-s%2Ftelemetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxdir-s%2Ftelemetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxdir-s%2Ftelemetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nxdir-s","download_url":"https://codeload.github.com/nxdir-s/telemetry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxdir-s%2Ftelemetry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: 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":["go","golang","observability","opentelemetry","opentelemetry-go","telemetry"],"created_at":"2024-12-06T15:16:15.793Z","updated_at":"2026-04-01T23:02:55.140Z","avatar_url":"https://github.com/nxdir-s.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telemetry\n\nThis repository contains utilities for working with Open Telemetry. You can find a getting started guide with OpenTelemetry in Go on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/)\n\n## Usage\n\nInitialize the telemetry providers within `main()`\n\n```go\ncfg := \u0026telemetry.Config{\n    ServiceName:        os.Getenv(\"OTEL_SERVICE_NAME\"),\n    OtelEndpoint:       os.Getenv(\"OTEL_EXPORTER_OTLP_ENDPOINT\"),\n}\n\ncleanup, err := telemetry.InitProviders(ctx, cfg)\nif err != nil {\n    // handle error\n}\n```\n\n\u003cbr /\u003e\n\nExample Lambda Setup\n\n```go\nfunc main() {\n    ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)\n    defer cancel()\n\n    logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))\n    slog.SetDefault(logger)\n\n    cfg := \u0026telemetry.Config{\n        ServiceName:        os.Getenv(\"OTEL_SERVICE_NAME\"),\n        OtelEndpoint:       os.Getenv(\"OTEL_EXPORTER_OTLP_ENDPOINT\"),\n        Lambda:             true,\n    }\n\n    cleanup, err := telemetry.InitProviders(ctx, cfg)\n    if err != nil {\n        // handle error\n    }\n\n    adapter := primary.NewLambdaAdapter()\n\n    // any remaining setup for lambda...\n\n    lambda.StartWithOptions(\n        otellambda.InstrumentHandler(adapter.HandleRequest,\n            otellambda.WithTracerProvider(otel.GetTracerProvider()),\n            otellambda.WithFlusher(otel.GetTracerProvider().(*trace.TracerProvider)),\n            otellambda.WithPropagator(otel.GetTextMapPropagator()),\n        ),\n        lambda.WithContext(ctx),\n        lambda.WithEnableSIGTERM(func() {\n            cleanup()\n            cancel()\n        }),\n    )\n}\n```\n\n## Instrumentation\n\nApplications can be manually instrumented or you can use any of the [officially supported instrumentation libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation)\n\n\u003e docs: https://opentelemetry.io/docs/languages/go/instrumentation/#metrics\n\n\u003cbr /\u003e\n\nTo add custom spans within your application, the following can be done\n\n```go\nctx, span := tracer.Start(ctx, \"Adapter.HandleRequest\")\ndefer span.End()\n```\n\n\u003e docs: https://opentelemetry.io/docs/languages/go/instrumentation/#creating-spans\n\n\u003cbr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxdir-s%2Ftelemetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnxdir-s%2Ftelemetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxdir-s%2Ftelemetry/lists"}