diff --git a/src/datadog/datadog_agent.cpp b/src/datadog/datadog_agent.cpp index dcb7dc32..072609a3 100644 --- a/src/datadog/datadog_agent.cpp +++ b/src/datadog/datadog_agent.cpp @@ -333,8 +333,8 @@ void DatadogAgent::flush() { } } -void DatadogAgent::send_app_started(nlohmann::json&& tracer_config) { - auto payload = tracer_telemetry_->app_started(std::move(tracer_config)); +void DatadogAgent::send_app_started() { + auto payload = tracer_telemetry_->app_started(); auto post_result = http_client_->post( telemetry_endpoint_, telemetry_set_request_headers_, std::move(payload), telemetry_on_response_, telemetry_on_error_); diff --git a/src/datadog/datadog_agent.h b/src/datadog/datadog_agent.h index 77ed5566..a18fea61 100644 --- a/src/datadog/datadog_agent.h +++ b/src/datadog/datadog_agent.h @@ -64,7 +64,7 @@ class DatadogAgent : public Collector { std::vector>&& spans, const std::shared_ptr& response_handler) override; - void send_app_started(nlohmann::json&& tracer_config); + void send_app_started(); nlohmann::json config_json() const override; }; diff --git a/src/datadog/tracer.cpp b/src/datadog/tracer.cpp index 077454f7..aacdf8a6 100644 --- a/src/datadog/tracer.cpp +++ b/src/datadog/tracer.cpp @@ -268,7 +268,7 @@ Tracer::Tracer(const FinalizedTracerConfig& config, clock, config.logger); collector_ = agent; if (tracer_telemetry_->enabled()) { - agent->send_app_started(config_json()); + agent->send_app_started(); } } diff --git a/src/datadog/tracer_telemetry.cpp b/src/datadog/tracer_telemetry.cpp index 1d45cccd..e030ffc2 100644 --- a/src/datadog/tracer_telemetry.cpp +++ b/src/datadog/tracer_telemetry.cpp @@ -80,20 +80,13 @@ nlohmann::json TracerTelemetry::generate_telemetry_body( }); } -std::string TracerTelemetry::app_started(nlohmann::json&& tracer_config) { +std::string TracerTelemetry::app_started() { auto telemetry_body = generate_telemetry_body("app-started"); // TODO: environment variables or finalized config details telemetry_body["payload"] = nlohmann::json::object({ {"configuration", nlohmann::json::array({})}, }); - // TODO: Until we figure out "configuration", above, include a - // JSON dump of the tracer configuration as "additional_payload". - telemetry_body["additional_payload"] = - nlohmann::json::array({nlohmann::json::object({ - {"name", "tracer_config_json"}, - {"value", tracer_config.dump()}, - })}); auto app_started_payload = telemetry_body.dump(); return app_started_payload; } diff --git a/src/datadog/tracer_telemetry.h b/src/datadog/tracer_telemetry.h index 3fed8fb8..184614a3 100644 --- a/src/datadog/tracer_telemetry.h +++ b/src/datadog/tracer_telemetry.h @@ -108,7 +108,7 @@ class TracerTelemetry { auto& metrics() { return metrics_; }; // Constructs an `app-started` message using information provided when // constructed and the tracer_config value passed in. - std::string app_started(nlohmann::json&& tracer_config); + std::string app_started(); // This is used to take a snapshot of the current state of metrics and collect // timestamped "points" of values. These values are later submitted in // `generate-metrics` messages. diff --git a/test/test_tracer_telemetry.cpp b/test/test_tracer_telemetry.cpp index 5b92b88b..30f31bcd 100644 --- a/test/test_tracer_telemetry.cpp +++ b/test/test_tracer_telemetry.cpp @@ -27,8 +27,7 @@ TEST_CASE("Tracer telemetry") { RuntimeID::generate()}; SECTION("generates app-started message") { - auto app_started_message = - tracer_telemetry.app_started(nlohmann::json::object()); + auto app_started_message = tracer_telemetry.app_started(); auto app_started = nlohmann::json::parse(app_started_message); REQUIRE(app_started["request_type"] == "app-started"); }