Removed version override for opentelemetry (#4037)

* Removed version override for opentelemetry

* Disable deprecation warnings for open telemety tests to guard against future deprecations

* Added explanation for 4996 error; removed InMemoryExporter from documentation
This commit is contained in:
Larry Osterman 2022-10-19 16:34:24 -07:00 коммит произвёл GitHub
Родитель 5f64eea985
Коммит 378ee6cbd4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 18 добавлений и 17 удалений

Просмотреть файл

@ -52,11 +52,7 @@ in-memory logger.
opentelemetry::nostd::shared_ptr<opentelemetry::trace::TracerProvider>
CreateOpenTelemetryProvider()
{
#if USE_MEMORY_EXPORTER
auto exporter = std::make_unique<opentelemetry::exporter::memory::InMemorySpanExporter>();
#else
auto exporter = std::make_unique<opentelemetry::exporter::trace::OStreamSpanExporter>();
#endif
auto exporter = std::make_unique<MyExporter>();
// simple processor
auto simple_processor = std::unique_ptr<opentelemetry::sdk::trace::SpanProcessor>(

Просмотреть файл

@ -61,8 +61,7 @@ After this, the SDK API implementations will be able to retrieve the tracer prov
```cpp
// Start by creating an OpenTelemetry Provider.
auto exporter = std::make_unique<opentelemetry::exporter::memory::InMemorySpanExporter>();
m_spanData = exporter->GetData();
auto exporter = std::make_unique<MySpanExporter>();
// simple processor
auto simple_processor = std::unique_ptr<opentelemetry::sdk::trace::SpanProcessor>(

Просмотреть файл

@ -9,6 +9,16 @@ add_compile_definitions(AZURE_TEST_DATA_PATH="${CMAKE_BINARY_DIR}")
add_compile_definitions(AZURE_TEST_RECORDING_DIR="${CMAKE_CURRENT_LIST_DIR}")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
add_compile_options(-Wno-error=deprecated-declarations)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Disable deprecation warnings.
add_compile_options(/wd4996)
endif()
project (azure-core-tracing-opentelemetry-test LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

Просмотреть файл

@ -262,10 +262,10 @@ protected:
{
EXPECT_EQ(
expectedSpanContents["library"]["name"].get<std::string>(),
span->GetInstrumentationLibrary().GetName());
span->GetInstrumentationScope().GetName());
EXPECT_EQ(
expectedSpanContents["library"]["version"].get<std::string>(),
span->GetInstrumentationLibrary().GetVersion());
span->GetInstrumentationScope().GetVersion());
}
return true;
}
@ -502,10 +502,10 @@ TEST_F(OpenTelemetryServiceTests, NestSpans)
"my-service", opentelemetry::nostd::get<std::string>(attributes.at("az.namespace")));
}
EXPECT_EQ("my-service", spans[0]->GetInstrumentationLibrary().GetName());
EXPECT_EQ("my-service", spans[1]->GetInstrumentationLibrary().GetName());
EXPECT_EQ("1.0beta-2", spans[0]->GetInstrumentationLibrary().GetVersion());
EXPECT_EQ("1.0beta-2", spans[1]->GetInstrumentationLibrary().GetVersion());
EXPECT_EQ("my-service", spans[0]->GetInstrumentationScope().GetName());
EXPECT_EQ("my-service", spans[1]->GetInstrumentationScope().GetName());
EXPECT_EQ("1.0beta-2", spans[0]->GetInstrumentationScope().GetVersion());
EXPECT_EQ("1.0beta-2", spans[1]->GetInstrumentationScope().GetVersion());
// The trace ID for the inner and outer requests must be the same, the parent-id/span-id must be
// different.

Просмотреть файл

@ -24,9 +24,5 @@
}
],
"overrides": [
{
"name": "opentelemetry-cpp",
"version": "1.4.1"
}
]
}