enrich with information about app node (#4592)

This commit is contained in:
Cenk Kücük 2024-09-18 18:08:24 +01:00 committed by GitHub
parent 59c7ce2ef1
commit 234d63e549
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -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
@ -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}

View File

@ -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]}
]