Skip to content

Commit

Permalink
enrich with information about app node (plausible#4592)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnkk authored Sep 18, 2024
1 parent 59c7ce2 commit 234d63e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ build_metadata =
_fallback = %{}
end

app_host = get_var_from_path_or_env(config_dir, "APP_HOST")

runtime_metadata = [
version: get_in(build_metadata, ["labels", "org.opencontainers.image.version"]),
commit: get_in(build_metadata, ["labels", "org.opencontainers.image.revision"]),
created: get_in(build_metadata, ["labels", "org.opencontainers.image.created"]),
tags: get_in(build_metadata, ["tags"])
tags: get_in(build_metadata, ["tags"]),
app_host: app_host
]

config :plausible, :runtime_metadata, runtime_metadata
Expand Down Expand Up @@ -486,7 +489,10 @@ config :sentry,
dsn: sentry_dsn,
environment_name: env,
release: sentry_app_version,
tags: %{app_version: sentry_app_version},
tags: %{
app_version: sentry_app_version,
app_host: app_host
},
client: Plausible.Sentry.Client,
send_max_attempts: 1,
before_send: {Plausible.SentryFilter, :before_send}
Expand Down
1 change: 1 addition & 0 deletions lib/plausible/open_telemetry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ defmodule Plausible.OpenTelemetry do
[
{"service.name", "analytics"},
{"service.namespace", "plausible"},
{"service.instance.app_host", runtime_metadata[:app_host]},
{"service.instance.id", runtime_metadata[:host]},
{"service.version", runtime_metadata[:version]}
]
Expand Down

0 comments on commit 234d63e

Please sign in to comment.