{"id":13651361,"url":"https://github.com/opencensus-beam/opencensus_honeycomb","last_synced_at":"2025-04-09T18:43:38.952Z","repository":{"id":45047917,"uuid":"187213388","full_name":"opencensus-beam/opencensus_honeycomb","owner":"opencensus-beam","description":"Opencensus integration with Honeycomb","archived":false,"fork":false,"pushed_at":"2022-10-19T20:22:46.000Z","size":47,"stargazers_count":10,"open_issues_count":2,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T20:43:47.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/opencensus-beam.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}},"created_at":"2019-05-17T12:34:57.000Z","updated_at":"2023-11-01T23:44:40.000Z","dependencies_parsed_at":"2022-08-19T16:50:06.032Z","dependency_job_id":null,"html_url":"https://github.com/opencensus-beam/opencensus_honeycomb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencensus-beam%2Fopencensus_honeycomb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencensus-beam%2Fopencensus_honeycomb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencensus-beam%2Fopencensus_honeycomb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencensus-beam%2Fopencensus_honeycomb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencensus-beam","download_url":"https://codeload.github.com/opencensus-beam/opencensus_honeycomb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248090519,"owners_count":21046106,"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":[],"created_at":"2024-08-02T02:00:48.582Z","updated_at":"2025-04-09T18:43:38.931Z","avatar_url":"https://github.com/opencensus-beam.png","language":"Elixir","funding_links":[],"categories":["Tracing"],"sub_categories":[],"readme":"# Opencensus.Honeycomb\n\n[![CircleCI](https://circleci.com/gh/opencensus-beam/opencensus_honeycomb.svg?style=svg)](https://circleci.com/gh/opencensus-beam/opencensus_honeycomb)\n[![Hex version badge](https://img.shields.io/hexpm/v/opencensus_honeycomb.svg)](https://hex.pm/packages/opencensus_honeycomb)\n\nPosts [OpenCensus] spans to [Honeycomb].\n\n[OpenCensus]: https://opencensus.io\n[Honeycomb]: https://www.honeycomb.io\n\n## Installation\n\n* Take the dependency\n* Configure it\n* Check its all working\n\n### Dependency\n\nAdd `opencensus_honeycomb` to your `deps` in `mix.exs`:\n\n```elixir\n{:opencensus_honeycomb, \"~\u003e 0.1\"}\n```\n\nThen, `mix deps.get` and `mix deps.compile` as usual.\n\n### Configuration\n\nIn your `config/config.exs`, configure `:opencensus` and\n`:opencensus_honeycomb`:\n\n```eixir\nconfig :opencensus,\n  reporters: [{Opencensus.Honeycomb.Reporter, []}],\n  send_interval_ms: 1000\n\nconfig :opencensus_honeycomb,\n  dataset: \"opencensus\",\n  service_name: \"your_app\",\n  write_key: System.get_env(\"HONEYCOMB_WRITEKEY\")\n```\n\n### Verification\n\n`iex -S mix`, then:\n\n    iex\u003e Application.get_env(:opencensus, :reporters)\n    [{Opencensus.Honeycomb.Reporter, []}]\n\n    iex\u003e Application.get_all_env(:opencensus_honeycomb)\n    [write_key: \"...\", service_name: \"...\", dataset: \"...\"]\n\n    iex\u003e :ocp.with_child_span(\"test\")\n    :undefined\n\n    iex\u003e :ocp.current_span_ctx()\n    {:span_ctx, 33234766236774033950150561980069751240,\n     12010566695198730064, 1, :undefined}\n\n    iex\u003e :ocp.finish_span()\n    true\n\nIf you don't notice any sending, check the registration in case the config\nformat changed again. Register manually, then try again:\n\n    iex\u003e :oc_reporter.register(Opencensus.Honeycomb.Reporter, [])\n    :ok\n\nOnce you've seen some spans, try a stack of ten:\n\n    iex\u003e 1..10 |\u003e Enum.map(\u0026to_string/1) |\u003e Enum.map(\u0026:ocp.with_child_span/1)\n    [\n      :undefined,\n      {:span_ctx, 322560190005584483565962561333424343439,\n       7924041616779114111, 1, :undefined},\n       ...\n      {:span_ctx, 322560190005584483565962561333424343439,\n       14682319351797855820, 1, :undefined},\n    ]\n\n    iex\u003e  1..10 |\u003e Enum.map(fn _ -\u003e :ocp.finish_span() end)\n    [true, true, true, true, true, true, true, true, true, true]\n\n## Telemetry\n\nOpencensus.Honeycomb calls `:telemetry.execute/2` before and after sending.\nTo get an idea without reading the in-code documentation, run the following\nat the `iex -S mix` prompt:\n\n```elixir\nalias Opencensus.Honeycomb.{Config,Event,Sender}\nConfig.put(%{write_key: nil})\nhandle_event = fn n, measure, meta, _ -\u003e IO.inspect({n, measure, meta}) end\n:telemetry.attach_many(\"test\", Sender.telemetry_events(), handle_event, nil)\n[%Event{time: Event.now(), data: %{name: \"hello\"}}] |\u003e Sender.send_batch()\n```\n\nYou should see two events inspected:\n\n```elixir\n{[:opencensus, :honeycomb, :start], %{count: 1},\n %{\n   events: [\n     # ...\n   ]\n }}\n\n{[:opencensus, :honeycomb, :stop, :success], %{count: 1, ms: 5.535},\n %{\n   events: [\n     # ...\n   ],\n   payload: \"...\"\n }}\n```\n\nWant to see that against the production API?\n\n```elixir\nConfig.put(%{\n  write_key: System.get_env(\"HONEYCOMB_WRITEKEY\"),\n  dataset: \"smoketest\"\n})\n[%Event{time: Event.now(), data: %{name: \"hello\"}}] |\u003e Sender.send_batch()\n```\n\n## Development\n\nDependency management:\n\n* `mix deps.get` to get your dependencies\n* `mix deps.compile` to compile them\n* `mix licenses` to check their license declarations, recursively\n\nFinding problems:\n\n* `mix compile` to compile your code\n* `mix credo` to suggest more idiomatic style for it\n* `mix dialyzer` to find problems static typing might spot... *slowly*\n* `mix test` to run unit tests\n* `mix test.watch` to run the tests again whenever you change something\n* `mix coveralls` to check test coverage\n\nDocumentation:\n\n* `mix docs` to generate documentation for this project\n* `mix help` to find out what else you can do with `mix`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencensus-beam%2Fopencensus_honeycomb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencensus-beam%2Fopencensus_honeycomb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencensus-beam%2Fopencensus_honeycomb/lists"}