{"id":20921139,"url":"https://github.com/codepumper/go-grafana-stack-helpers","last_synced_at":"2026-04-18T02:32:37.553Z","repository":{"id":181424024,"uuid":"666732467","full_name":"codepumper/go-grafana-stack-helpers","owner":"codepumper","description":"Grafana Stack Go Utils is a collection of reusable components and utilities in Go for working with the Grafana stack.","archived":false,"fork":false,"pushed_at":"2023-08-26T12:03:21.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T08:08:52.225Z","etag":null,"topics":["go","grafana","grafana-client","loki","opentelemetry","promtail","tempo"],"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/codepumper.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}},"created_at":"2023-07-15T11:48:28.000Z","updated_at":"2023-07-15T13:38:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"208637ff-c532-4fcd-92b0-e82e453871ff","html_url":"https://github.com/codepumper/go-grafana-stack-helpers","commit_stats":null,"previous_names":["codepumper/go-grafana-stack-helpers"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/codepumper/go-grafana-stack-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepumper%2Fgo-grafana-stack-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepumper%2Fgo-grafana-stack-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepumper%2Fgo-grafana-stack-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepumper%2Fgo-grafana-stack-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codepumper","download_url":"https://codeload.github.com/codepumper/go-grafana-stack-helpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepumper%2Fgo-grafana-stack-helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","grafana","grafana-client","loki","opentelemetry","promtail","tempo"],"created_at":"2024-11-18T19:09:12.273Z","updated_at":"2026-04-18T02:32:37.531Z","avatar_url":"https://github.com/codepumper.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grafana Stack Go Utils\n\nGrafana Stack Go Utils is a collection of reusable components and utilities in Go for working with the Grafana stack. This repository provides high-level implementations and examples that demonstrate how to easily utilize the Grafana, Loki, Promtail, and other components within a Go application.\n\n## Features\n\n- Docker-compose and configuration files for setting up the Grafana stack\n- Tracing client for distributed tracing using Grafana Tempo or other tracing backends\n- Metrics client for collecting and reporting application-specific metrics to Prometheus or other metrics systems\n- Logging package for easy integration with Prometheus, Opentelemetry and Grafana Loki\n\n## Tracing\n\n## Metrics\n\n## Logging\n\nAt this time, OpenTelemetry for Go does not provide a built-in logging implementation. To address this, we can utilize Promtail, which is part of the Grafana Loki project, for log forwarding to OpenTelemetry.\n\nThe logging package uses Promtail for log management. **Promtail** collects logs and pushes them to the **OpenTelemetry collector**, which further processes and forwards the logs to the **Loki exporter**. The exporter translates and transmits the logs to **Loki for storage and analysis**. This setup enables centralized log management and integration with other observability data through the OpenTelemetry ecosystem.\n\n### Usage\n\nTo use the Logging Package in your Go project, simply import it:\n\n```go\nimport \"github.com/codepumper/go-grafana-stack-helpers/logging\"\n```\n\nHere is a quick example that demonstrates how to use the Logging Package:\n\n```go\npackage main\n\nimport (\n\t\"github.com/codepumper/go-grafana-stack-helpers/logging\"\n)\n\nfunc main() {\n    appName := \"my-app\"\n\tlabels := \"{application=\\\"\" + appName + \"\\\"}\"\n\n\terr := logging.InitLogger(\"json\", labels, nil)\n\tif err != nil {\n\t\tfmt.Println(\"Failed to initialize Logger\")\n\t}\n\n\tlogging.Infof(\"This is an info message\")\n\n    logging.Shutdown()\n}\n\n```\n\n\n---\n\nLicense\nThe Packages in this repository are open source and available under the Apache License 2.0. See the LICENSE file for more information.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepumper%2Fgo-grafana-stack-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepumper%2Fgo-grafana-stack-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepumper%2Fgo-grafana-stack-helpers/lists"}