@@ -100,9 +100,15 @@ class OtlpFileLogRecordExporterTestPeer : public ::testing::Test
100100 char span_id_hex[2 * opentelemetry::trace::SpanId::kSize ] = {0 };
101101 opentelemetry::trace::SpanId span_id{span_id_bin};
102102
103+ const std::string instrumentation_scope_name{" opentelelemtry_library" };
104+ const std::string instrumentation_scope_version{" 1.2.3" };
103105 const std::string schema_url{" https://opentelemetry.io/schemas/1.2.0" };
104- auto logger = provider->GetLogger (" test" , " opentelelemtry_library" , " " , schema_url,
105- {{" scope_key1" , " scope_value" }, {" scope_key2" , 2 }});
106+ const std::vector<std::pair<std::string, opentelemetry::common::AttributeValue>>
107+ instrumentation_scope_attributes{{" scope_key1" , " scope_value" },
108+ { " scope_key2" ,
109+ 2 }};
110+
111+ auto logger = provider->GetLogger (" test" , instrumentation_scope_name, instrumentation_scope_version, schema_url, instrumentation_scope_attributes);
106112
107113 trace_id.ToLowerBase16 (MakeSpan (trace_id_hex));
108114 report_trace_id.assign (trace_id_hex, sizeof (trace_id_hex));
@@ -143,16 +149,27 @@ class OtlpFileLogRecordExporterTestPeer : public ::testing::Test
143149 auto scope_logs = *resource_logs[" scopeLogs" ].begin ();
144150 auto scope = scope_logs[" scope" ];
145151 auto log = *scope_logs[" logRecords" ].begin ();
146- auto received_trace_id = log[" traceId" ].get <std::string>();
147- auto received_span_id = log[" spanId" ].get <std::string>();
152+
153+ const auto received_schema_url = scope_logs[" schemaUrl" ].get <std::string>();
154+ const auto received_instrumentation_scope_name = scope[" name" ].get <std::string>();
155+ const auto received_instrumentation_scope_version = scope[" version" ].get <std::string>();
156+ const auto received_instrumentation_scope_attributes = scope[" attributes" ];
157+ const auto received_trace_id = log[" traceId" ].get <std::string>();
158+ const auto received_span_id = log[" spanId" ].get <std::string>();
159+
160+ EXPECT_EQ (received_instrumentation_scope_attributes.size (), instrumentation_scope_attributes.size ())
161+ << received_instrumentation_scope_attributes;
162+ EXPECT_EQ (received_schema_url, schema_url);
163+ EXPECT_EQ (received_instrumentation_scope_name, instrumentation_scope_name);
164+ EXPECT_EQ (received_instrumentation_scope_version, instrumentation_scope_version);
165+
148166 EXPECT_EQ (received_trace_id, report_trace_id);
149167 EXPECT_EQ (received_span_id, report_span_id);
150168 EXPECT_EQ (" Log message" , log[" body" ][" stringValue" ].get <std::string>());
151169 EXPECT_LE (15 , log[" attributes" ].size ());
152170
153171 bool check_scope_attribute = false ;
154- auto scope_attributes = scope[" attributes" ];
155- for (auto &attribute : scope_attributes)
172+ for (auto &attribute : received_instrumentation_scope_attributes)
156173 {
157174 if (!attribute.is_object ())
158175 {
0 commit comments