Skip to content

Commit

Permalink
Mark logs signal as stable API/SDK (#2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Aug 1, 2023
1 parent 8f97cab commit 8c82d24
Show file tree
Hide file tree
Showing 119 changed files with 920 additions and 1,250 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Increment the:

## [Unreleased]

* [SDK] Mark logs signal as stable API/SDK
[#2229](https://github.com/open-telemetry/opentelemetry-cpp/pull/2229)

Breaking changes:

* [SDK] Add unit to Instrument selection criteria
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ option(

option(WITH_FUNC_TESTS "Whether to build functional tests" ON)

option(WITH_LOGS_PREVIEW "Whether to build logs preview" OFF)
if(DEFINED WITH_LOGS_PREVIEW)
message(WARNING "WITH_LOGS_PREVIEW is removed because logs signal is stable")
endif()

option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)

# EXPERIMENTAL
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ The C++ [OpenTelemetry](https://opentelemetry.io/) client.
| ------- | ----------------------- | ------------------------------------------------------------------------ |
| Traces | Public Release | N/A |
| Metrics | Public Release | N/A |
| Logs | Experimental [1] | [Release Milestone](https://github.com/open-telemetry/opentelemetry-cpp/milestone/18)|

* [1]: The current Log Signal Implementation is Experimental, and will change as
the current OpenTelemetry Log specification matures. The current
implementation can be included in build by setting `ENABLE_LOGS_PREVIEW`
preprocessor macro.
| Logs | Public Release | N/A |

## Supported C++ Versions

Expand Down
12 changes: 1 addition & 11 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ if(OPENTELEMETRY_INSTALL)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

set(LOGS_EXCLUDE_PATTERN "")
if(NOT WITH_LOGS_PREVIEW)
set(LOGS_EXCLUDE_PATTERN "logs")
endif()

install(
DIRECTORY include/opentelemetry
DESTINATION include
Expand All @@ -33,8 +28,7 @@ if(OPENTELEMETRY_INSTALL)
DIRECTORY include/opentelemetry
DESTINATION include
FILES_MATCHING
PATTERN "*.h"
PATTERN "${LOGS_EXCLUDE_PATTERN}" EXCLUDE)
PATTERN "*.h")
endif()

if(BUILD_TESTING)
Expand Down Expand Up @@ -79,10 +73,6 @@ if(WITH_GSL)
endif()
endif()

if(WITH_LOGS_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_LOGS_PREVIEW)
endif()

if(WITH_NO_GETENV)
target_compile_definitions(opentelemetry_api INTERFACE NO_GETENV)
endif()
Expand Down
11 changes: 4 additions & 7 deletions api/include/opentelemetry/logs/event_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

#pragma once

#ifdef ENABLE_LOGS_PREVIEW
#include <algorithm>

# include <algorithm>

# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/nostd/unique_ptr.h"
# include "opentelemetry/version.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -37,4 +35,3 @@ class EventId

} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif
17 changes: 7 additions & 10 deletions api/include/opentelemetry/logs/event_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/logs/log_record.h"
# include "opentelemetry/logs/logger.h"
# include "opentelemetry/logs/logger_type_traits.h"
# include "opentelemetry/nostd/shared_ptr.h"
# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/nostd/unique_ptr.h"
# include "opentelemetry/version.h"
#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/logs/logger.h"
#include "opentelemetry/logs/logger_type_traits.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -84,5 +83,3 @@ class EventLogger
};
} // namespace logs
OPENTELEMETRY_END_NAMESPACE

#endif
8 changes: 3 additions & 5 deletions api/include/opentelemetry/logs/event_logger_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/nostd/shared_ptr.h"
# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/version.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -34,4 +33,3 @@ class EventLoggerProvider
};
} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif
8 changes: 3 additions & 5 deletions api/include/opentelemetry/logs/log_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/common/attribute_value.h"
# include "opentelemetry/common/timestamp.h"
# include "opentelemetry/version.h"
#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace trace
Expand Down Expand Up @@ -91,4 +90,3 @@ class LogRecord
};
} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif
13 changes: 5 additions & 8 deletions api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/logs/logger_type_traits.h"
# include "opentelemetry/logs/severity.h"
# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/nostd/unique_ptr.h"
# include "opentelemetry/version.h"
#include "opentelemetry/logs/logger_type_traits.h"
#include "opentelemetry/logs/severity.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace common
Expand Down Expand Up @@ -475,5 +474,3 @@ class Logger
};
} // namespace logs
OPENTELEMETRY_END_NAMESPACE

#endif // end of ENABLE_LOGS_PREVIEW
18 changes: 7 additions & 11 deletions api/include/opentelemetry/logs/logger_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@

#pragma once

#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/common/key_value_iterable.h"
# include "opentelemetry/common/key_value_iterable_view.h"
# include "opentelemetry/nostd/shared_ptr.h"
# include "opentelemetry/nostd/span.h"
# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/nostd/type_traits.h"
# include "opentelemetry/version.h"
#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/common/key_value_iterable_view.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/span.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/type_traits.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -71,5 +69,3 @@ class OPENTELEMETRY_EXPORT LoggerProvider
};
} // namespace logs
OPENTELEMETRY_END_NAMESPACE

#endif // ENABLE_LOGS_PREVIEW
37 changes: 17 additions & 20 deletions api/include/opentelemetry/logs/logger_type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include <chrono>
# include <type_traits>

# include "opentelemetry/common/attribute_value.h"
# include "opentelemetry/common/key_value_iterable.h"
# include "opentelemetry/common/timestamp.h"
# include "opentelemetry/logs/event_id.h"
# include "opentelemetry/logs/log_record.h"
# include "opentelemetry/logs/severity.h"
# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/nostd/type_traits.h"
# include "opentelemetry/trace/span_context.h"
# include "opentelemetry/trace/span_id.h"
# include "opentelemetry/trace/trace_flags.h"
# include "opentelemetry/trace/trace_id.h"
# include "opentelemetry/version.h"

#include <chrono>
#include <type_traits>

#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/logs/event_id.h"
#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/logs/severity.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/type_traits.h"
#include "opentelemetry/trace/span_context.h"
#include "opentelemetry/trace/span_id.h"
#include "opentelemetry/trace/trace_flags.h"
#include "opentelemetry/trace/trace_id.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -198,5 +197,3 @@ struct LogRecordHasType<ValueType, TargetType, ArgumentType...>

} // namespace logs
OPENTELEMETRY_END_NAMESPACE

#endif
18 changes: 8 additions & 10 deletions api/include/opentelemetry/logs/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

// Please refer to provider.h for documentation on how to obtain a Logger object.
//
// This file is part of the internal implementation of OpenTelemetry. Nothing in this file should be
// used directly. Please refer to logger.h for documentation on these interfaces.

# include "opentelemetry/logs/event_logger.h"
# include "opentelemetry/logs/event_logger_provider.h"
# include "opentelemetry/logs/logger.h"
# include "opentelemetry/logs/logger_provider.h"
# include "opentelemetry/nostd/shared_ptr.h"
# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/nostd/unique_ptr.h"
# include "opentelemetry/version.h"
#include "opentelemetry/logs/event_logger.h"
#include "opentelemetry/logs/event_logger_provider.h"
#include "opentelemetry/logs/logger.h"
#include "opentelemetry/logs/logger_provider.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace common
Expand Down Expand Up @@ -100,4 +99,3 @@ class NoopEventLoggerProvider final : public EventLoggerProvider

} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif
14 changes: 6 additions & 8 deletions api/include/opentelemetry/logs/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include <mutex>
#include <mutex>

# include "opentelemetry/common/macros.h"
# include "opentelemetry/common/spin_lock_mutex.h"
# include "opentelemetry/logs/noop.h"
# include "opentelemetry/nostd/shared_ptr.h"
# include "opentelemetry/version.h"
#include "opentelemetry/common/macros.h"
#include "opentelemetry/common/spin_lock_mutex.h"
#include "opentelemetry/logs/noop.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -90,4 +89,3 @@ class OPENTELEMETRY_EXPORT Provider

} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif
6 changes: 2 additions & 4 deletions api/include/opentelemetry/logs/severity.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once
#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/nostd/string_view.h"
# include "opentelemetry/version.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
Expand Down Expand Up @@ -64,4 +63,3 @@ const nostd::string_view SeverityNumToText[25] = {

} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif
4 changes: 1 addition & 3 deletions api/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ add_subdirectory(plugin)
add_subdirectory(nostd)
add_subdirectory(trace)
add_subdirectory(metrics)
if(WITH_LOGS_PREVIEW)
add_subdirectory(logs)
endif()
add_subdirectory(logs)
add_subdirectory(common)
add_subdirectory(baggage)
add_subdirectory(singleton)
26 changes: 11 additions & 15 deletions api/test/logs/logger_benchmark.cc
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#ifdef ENABLE_LOGS_PREVIEW
#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/logs/logger.h"
#include "opentelemetry/logs/provider.h"
#include "opentelemetry/nostd/shared_ptr.h"

# include "opentelemetry/common/timestamp.h"
# include "opentelemetry/logs/logger.h"
# include "opentelemetry/logs/provider.h"
# include "opentelemetry/nostd/shared_ptr.h"
#include <chrono>
#include <condition_variable>
#include <functional>
#include <mutex>
#include <thread>
#include <vector>

# include <chrono>
# include <condition_variable>
# include <functional>
# include <mutex>
# include <thread>
# include <vector>

# include <benchmark/benchmark.h>
#include <benchmark/benchmark.h>

using opentelemetry::logs::EventId;
using opentelemetry::logs::Logger;
Expand Down Expand Up @@ -256,5 +254,3 @@ int main(int argc, char **argv)
benchmark::Initialize(&argc, argv);
benchmark::RunSpecifiedBenchmarks();
}

#endif
Loading

0 comments on commit 8c82d24

Please sign in to comment.