dfed96874f
Add instrumentation for Nebulex, a distributed cache library. This library provides solid telemetry support for this initial implementation. Caching implementation is mostly based on in-memory storage (like ETS) and RPC calls for distribution (via OTP libraries, like :erpc). AFAICT, there is not much specifics for how to translate into Semantic Attributes: those caches are not quite a DB, except maybe for the one which implements the storage; the RPC can't be reliably captured either. Given the above constraints, this initial implementation instruments the library via custom attributes (namespaced as `nebulex.*`). It's not 100% clear the behaviour of OTel for actual distributed caches - from my tests, that may create some orphan spans. I think that's fine as first release. Nebulex follow the patterns of Ecto, so this instrumentation follows a similar pattern of OpentelemetryEcto. It does include a `setup_all/1` function for convenience, that leverages the :init events Nebulex emit on process start. Co-authored-by: Tristan Sloughter <t@crashfast.com>
35 lines
1.2 KiB
Elixir
35 lines
1.2 KiB
Elixir
# This file is responsible for configuring your application
|
|
# and its dependencies with the aid of the Mix.Config module.
|
|
import Config
|
|
|
|
# This configuration is loaded before any dependency and is restricted
|
|
# to this project. If another project depends on this project, this
|
|
# file won't be loaded nor affect the parent project. For this reason,
|
|
# if you want to provide default values for your application for
|
|
# third-party users, it should be done in your "mix.exs" file.
|
|
|
|
# You can configure your application as:
|
|
#
|
|
# config :opentelemetry_nebulex, key: :value
|
|
#
|
|
# and access this configuration in your application as:
|
|
#
|
|
# Application.get_env(:opentelemetry_nebulex, :key)
|
|
#
|
|
# You can also configure a third-party app:
|
|
#
|
|
# config :logger, level: :info
|
|
#
|
|
|
|
# It is also possible to import configuration files, relative to this
|
|
# directory. For example, you can emulate configuration per environment
|
|
# by uncommenting the line below and defining dev.exs, test.exs and such.
|
|
# Configuration from the imported file will override the ones defined
|
|
# here (which is why it is important to import them last).
|
|
#
|
|
try do
|
|
import_config "#{Mix.env()}.exs"
|
|
rescue
|
|
_ -> :ok
|
|
end
|