Skip to content

Commit ebb0b05

Browse files
cnkkzoldar
andauthored
Otel improvements (#6014)
* include trace_id in log comments * site team_id to OpenTelemetry attributes * Move tracing to QueryRunner so that all queries profit from additional attributes in their spans * Add trace_id assertion to debug metadata test * Fix warning * add trace_id * remove integer check * log trace_id to correlate logs and traces * Update lib/plausible/clickhouse_repo.ex Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> * Update lib/plausible/open_telemetry/logger.ex Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> * mix format * Refactor trace_id retrieval * configure otlp endpoint via env * disable sampler * set default for variable * remove custom opentelemetry sampler --------- Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
1 parent 0e7f366 commit ebb0b05

2 files changed

Lines changed: 3 additions & 66 deletions

File tree

config/runtime.exs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,8 @@ help_scout_app_secret = get_var_from_path_or_env(config_dir, "HELP_SCOUT_APP_SEC
234234
help_scout_signature_key = get_var_from_path_or_env(config_dir, "HELP_SCOUT_SIGNATURE_KEY")
235235
help_scout_vault_key = get_var_from_path_or_env(config_dir, "HELP_SCOUT_VAULT_KEY")
236236

237-
{otel_sampler_ratio, ""} =
238-
config_dir
239-
|> get_var_from_path_or_env("OTEL_SAMPLER_RATIO", "0.5")
240-
|> Float.parse()
237+
otlp_endpoint =
238+
get_var_from_path_or_env(config_dir, "OTLP_ENDPOINT", "https://api.honeycomb.io:443")
241239

242240
geolite2_country_db =
243241
get_var_from_path_or_env(
@@ -942,13 +940,12 @@ end
942940
if honeycomb_api_key && honeycomb_dataset do
943941
config :opentelemetry,
944942
resource: Plausible.OpenTelemetry.resource_attributes(runtime_metadata),
945-
sampler: {Plausible.OpenTelemetry.Sampler, %{ratio: otel_sampler_ratio}},
946943
span_processor: :batch,
947944
traces_exporter: :otlp
948945

949946
config :opentelemetry_exporter,
950947
otlp_protocol: :grpc,
951-
otlp_endpoint: "https://api.honeycomb.io:443",
948+
otlp_endpoint: otlp_endpoint,
952949
otlp_headers: [
953950
{"x-honeycomb-team", honeycomb_api_key},
954951
{"x-honeycomb-dataset", honeycomb_dataset}

lib/plausible/open_telemetry/sampler.ex

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)