{"id":20515809,"url":"https://github.com/kuper-tech/grafana_annotations","last_synced_at":"2025-08-16T07:16:42.371Z","repository":{"id":50336023,"uuid":"516334390","full_name":"Kuper-Tech/grafana_annotations","owner":"Kuper-Tech","description":"Add custom annotations to grafana from your ruby application.","archived":false,"fork":false,"pushed_at":"2022-09-02T13:15:39.000Z","size":27,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T08:02:35.849Z","etag":null,"topics":["grafana-annotations","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/Kuper-Tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-21T10:58:20.000Z","updated_at":"2024-09-23T09:32:48.000Z","dependencies_parsed_at":"2023-01-17T19:30:34.902Z","dependency_job_id":null,"html_url":"https://github.com/Kuper-Tech/grafana_annotations","commit_stats":null,"previous_names":["sbermarket-tech/grafana_annotations"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Kuper-Tech/grafana_annotations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrafana_annotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrafana_annotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrafana_annotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrafana_annotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kuper-Tech","download_url":"https://codeload.github.com/Kuper-Tech/grafana_annotations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrafana_annotations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259638615,"owners_count":22888469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["grafana-annotations","ruby"],"created_at":"2024-11-15T21:24:47.875Z","updated_at":"2025-06-13T11:37:32.810Z","avatar_url":"https://github.com/Kuper-Tech.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GrafanaAnnotations\n\n[![Gem Version](https://badge.fury.io/rb/grafana_annotations.svg)](https://badge.fury.io/rb/grafana_annotations)\n\nAdd custom annotations to grafana from your ruby application.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'grafana_annotations', '~\u003e 0.1.1'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install grafana_annotations\n\n## Usage\n\n### Configuration\n\n```ruby\nGrafanaAnnotations.configure do |c|\n  # Logs requests and responses. Optional.\n  c.logger Rails.logger\n\n  # Tags for rake tasks instrumentation. Empty by default.\n  c.rake_tags [:my_app, :rake]\n\n  # Rake task annotation prefix\n  c.rake_text_prefix 'Rake task'\n\n  # URL to your grafana installation.\n  c.grafana_base_url ENV.fetch('GRAFANA_URL')\n\n  # Grafana authorization (i.e. `Bearer xxxxx`)\n  c.grafana_authorization ENV.fetch('GRAFANA_AUTHZ')\nend\n```\n\n### Creating annotations\n\n```ruby\nresult = GrafanaAnnotations.default_api_client.create(\n  time: GrafanaAnnotations::Utils::Time.now_ms, # timestamp in milliseconds (integer), optional\n  tags: [:my_app, :my_event],\n  text: \"Boom!\"\n)\n```\n\n### Creating annotation span\n\n`wrap` utility function creates an annotation when block starts executing and updates it with end time after.\n\n```ruby\nGrafanaAnnotations.wrap(text: 'something is happening', tags: [:my_app, :something]) do\n  do_something()\nend\n```\n\n### Rake tasks instrumentation\n\nJust require `grafana_annotations/rake` within your Rakefile and annotation request will be sent for every rake task.\n\n```ruby\n# Rakefile\nrequire 'grafana_annotations/rake'\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\n## Deployment\n\n1. Update changelog and git add it\n2.\n\n```sh\nbump2version patch --allow-dirty\n```\n\n3. git push \u0026\u0026 git push --tags\n4. gem build\n5. gem push grafana_annotations-x.x.x.gem\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuper-tech%2Fgrafana_annotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuper-tech%2Fgrafana_annotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuper-tech%2Fgrafana_annotations/lists"}