Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Jun 6, 2024
1 parent 81a63e7 commit 7b8b85e
Show file tree
Hide file tree
Showing 21 changed files with 121 additions and 42 deletions.
3 changes: 1 addition & 2 deletions sdk/include/opentelemetry/sdk/logs/exporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@

#include "opentelemetry/nostd/span.h"
#include "opentelemetry/sdk/common/exporter_utils.h"
#include "opentelemetry/sdk/logs/recordable.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace logs
{
class Recordable;

/**
* LogRecordExporter defines the interface that log exporters must implement.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#include <memory>
#include <vector>

#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace logs
{
class LogRecordProcessor;

/**
* Factory class for MultiLogRecordProcessor.
Expand Down
8 changes: 6 additions & 2 deletions sdk/include/opentelemetry/sdk/logs/multi_recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@

#pragma once

#include <stdint.h>
#include <cstddef>
#include <memory>
#include <unordered_map>

#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/macros.h"
#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/sdk/logs/recordable.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/version.h"
Expand All @@ -17,8 +23,6 @@ namespace sdk
{
namespace logs
{
class LogRecordProcessor;

class MultiRecordable final : public Recordable
{
public:
Expand Down
4 changes: 4 additions & 0 deletions sdk/include/opentelemetry/sdk/logs/readable_log_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@

#pragma once

#include <stdint.h>
#include <string>
#include <unordered_map>

#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/logs/severity.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h"
#include "opentelemetry/sdk/logs/recordable.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
Expand Down
12 changes: 6 additions & 6 deletions sdk/include/opentelemetry/sdk/metrics/data/circular_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class AdaptingIntegerArray
public:
// Construct an adapting integer array of a given size.
explicit AdaptingIntegerArray(size_t size) : backing_(std::vector<uint8_t>(size, 0)) {}
AdaptingIntegerArray(const AdaptingIntegerArray &other) = default;
AdaptingIntegerArray(AdaptingIntegerArray &&other) = default;
AdaptingIntegerArray(const AdaptingIntegerArray &other) = default;
AdaptingIntegerArray(AdaptingIntegerArray &&other) = default;
AdaptingIntegerArray &operator=(const AdaptingIntegerArray &other) = default;
AdaptingIntegerArray &operator=(AdaptingIntegerArray &&other) = default;
AdaptingIntegerArray &operator=(AdaptingIntegerArray &&other) = default;

/**
* Increments the value at the specified index by the given count in the array.
Expand Down Expand Up @@ -89,10 +89,10 @@ class AdaptingCircularBufferCounter
{
public:
explicit AdaptingCircularBufferCounter(size_t max_size) : backing_(max_size) {}
AdaptingCircularBufferCounter(const AdaptingCircularBufferCounter &other) = default;
AdaptingCircularBufferCounter(AdaptingCircularBufferCounter &&other) = default;
AdaptingCircularBufferCounter(const AdaptingCircularBufferCounter &other) = default;
AdaptingCircularBufferCounter(AdaptingCircularBufferCounter &&other) = default;
AdaptingCircularBufferCounter &operator=(const AdaptingCircularBufferCounter &other) = default;
AdaptingCircularBufferCounter &operator=(AdaptingCircularBufferCounter &&other) = default;
AdaptingCircularBufferCounter &operator=(AdaptingCircularBufferCounter &&other) = default;

/**
* The first index with a recording. May be negative.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ namespace sdk
{
namespace metrics
{
class AttributesProcessor;
class AttributesProcessor; // IWYU pragma: keep

class FilteredOrderedAttributeMap : public opentelemetry::sdk::common::OrderedAttributeMap
{
public:
Expand Down
2 changes: 0 additions & 2 deletions sdk/include/opentelemetry/sdk/version/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#pragma once

#include "opentelemetry/detail/preprocessor.h"

#define OPENTELEMETRY_SDK_VERSION "1.15.0"

#include "opentelemetry/version.h"
Expand Down
11 changes: 11 additions & 0 deletions sdk/src/logs/batch_log_record_processor.cc
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <ratio>
#include <thread>
#include <utility>
#include <vector>

#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/nostd/span.h"
#include "opentelemetry/sdk/common/atomic_unique_ptr.h"
#include "opentelemetry/sdk/common/circular_buffer.h"
#include "opentelemetry/sdk/common/circular_buffer_range.h"
#include "opentelemetry/sdk/logs/batch_log_record_processor.h"
#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h"
#include "opentelemetry/sdk/logs/exporter.h"
#include "opentelemetry/sdk/logs/recordable.h"
#include "opentelemetry/version.h"

Expand Down
4 changes: 4 additions & 0 deletions sdk/src/logs/batch_log_record_processor_factory.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <memory>
#include <utility>

#include "opentelemetry/sdk/logs/batch_log_record_processor.h"
#include "opentelemetry/sdk/logs/batch_log_record_processor_factory.h"
#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h"
#include "opentelemetry/sdk/logs/exporter.h"
#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
Expand Down
24 changes: 15 additions & 9 deletions sdk/src/logs/event_logger.cc
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <string>
#include <utility>

#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/logs/logger.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/sdk/logs/event_logger.h"
#include "opentelemetry/sdk_config.h"
#include "opentelemetry/trace/provider.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace logs
{
namespace nostd = opentelemetry::nostd;

EventLogger::EventLogger(nostd::shared_ptr<opentelemetry::logs::Logger> delegate_logger,
nostd::string_view event_domain) noexcept
EventLogger::EventLogger(
opentelemetry::nostd::shared_ptr<opentelemetry::logs::Logger> delegate_logger,
opentelemetry::nostd::string_view event_domain) noexcept
: delegate_logger_(delegate_logger), event_domain_(event_domain)
{}

const nostd::string_view EventLogger::GetName() noexcept
const opentelemetry::nostd::string_view EventLogger::GetName() noexcept
{
if (delegate_logger_)
{
Expand All @@ -30,13 +34,15 @@ const nostd::string_view EventLogger::GetName() noexcept
return {};
}

nostd::shared_ptr<opentelemetry::logs::Logger> EventLogger::GetDelegateLogger() noexcept
opentelemetry::nostd::shared_ptr<opentelemetry::logs::Logger>
EventLogger::GetDelegateLogger() noexcept
{
return delegate_logger_;
}

void EventLogger::EmitEvent(nostd::string_view event_name,
nostd::unique_ptr<opentelemetry::logs::LogRecord> &&log_record) noexcept
void EventLogger::EmitEvent(
opentelemetry::nostd::string_view event_name,
opentelemetry::nostd::unique_ptr<opentelemetry::logs::LogRecord> &&log_record) noexcept
{
if (!delegate_logger_ || !log_record)
{
Expand Down
13 changes: 7 additions & 6 deletions sdk/src/logs/event_logger_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// SPDX-License-Identifier: Apache-2.0

#include "opentelemetry/sdk/logs/event_logger_provider.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/sdk/common/global_log_handler.h"
#include "opentelemetry/sdk/logs/event_logger.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace logs
{
namespace nostd = opentelemetry::nostd;

EventLoggerProvider::EventLoggerProvider() noexcept
{
Expand All @@ -20,11 +20,12 @@ EventLoggerProvider::EventLoggerProvider() noexcept

EventLoggerProvider::~EventLoggerProvider() {}

nostd::shared_ptr<opentelemetry::logs::EventLogger> EventLoggerProvider::CreateEventLogger(
nostd::shared_ptr<opentelemetry::logs::Logger> delegate_logger,
nostd::string_view event_domain) noexcept
opentelemetry::nostd::shared_ptr<opentelemetry::logs::EventLogger>
EventLoggerProvider::CreateEventLogger(
opentelemetry::nostd::shared_ptr<opentelemetry::logs::Logger> delegate_logger,
opentelemetry::nostd::string_view event_domain) noexcept
{
return nostd::shared_ptr<opentelemetry::logs::EventLogger>{
return opentelemetry::nostd::shared_ptr<opentelemetry::logs::EventLogger>{
new EventLogger(delegate_logger, event_domain)};
}

Expand Down
8 changes: 8 additions & 0 deletions sdk/src/logs/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@
// SPDX-License-Identifier: Apache-2.0

#include <chrono>
#include <memory>
#include <string>
#include <utility>

#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/context/context.h"
#include "opentelemetry/context/context_value.h"
#include "opentelemetry/context/runtime_context.h"
#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/nostd/detail/decay.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/nostd/variant.h"
#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h"
#include "opentelemetry/sdk/logs/logger.h"
#include "opentelemetry/sdk/logs/logger_context.h"
#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/sdk/logs/recordable.h"
#include "opentelemetry/trace/span.h"
#include "opentelemetry/trace/span_context.h"
#include "opentelemetry/trace/span_metadata.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
Expand Down
3 changes: 3 additions & 0 deletions sdk/src/logs/logger_context.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <chrono>
#include <memory>
#include <utility>
#include <vector>

#include "opentelemetry/sdk/logs/logger_context.h"
#include "opentelemetry/sdk/logs/multi_log_record_processor.h"
#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
Expand Down
11 changes: 11 additions & 0 deletions sdk/src/logs/logger_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@
// SPDX-License-Identifier: Apache-2.0

#include <algorithm>
#include <chrono>
#include <memory>
#include <mutex>
#include <utility>
#include <vector>

#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/logs/log_record.h"
#include "opentelemetry/logs/logger.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/sdk/common/global_log_handler.h"
#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h"
#include "opentelemetry/sdk/logs/logger.h"
#include "opentelemetry/sdk/logs/logger_context.h"
#include "opentelemetry/sdk/logs/logger_provider.h"
#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
Expand Down
5 changes: 5 additions & 0 deletions sdk/src/logs/multi_log_record_processor.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <algorithm>
#include <chrono>
#include <memory>
#include <ratio>
#include <utility>
#include <vector>

#include "opentelemetry/sdk/logs/multi_log_record_processor.h"
#include "opentelemetry/sdk/logs/multi_recordable.h"
#include "opentelemetry/sdk/logs/processor.h"
#include "opentelemetry/sdk/logs/recordable.h"
#include "opentelemetry/version.h"

Expand Down
9 changes: 5 additions & 4 deletions sdk/src/logs/multi_log_record_processor_factory.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include "opentelemetry/sdk/logs/multi_log_record_processor_factory.h"
#include "opentelemetry/sdk/logs/multi_log_record_processor.h"

#include <chrono>
#include <memory>
#include <utility>
#include <vector>

#include "opentelemetry/sdk/logs/multi_log_record_processor.h"
#include "opentelemetry/sdk/logs/multi_log_record_processor_factory.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
Expand Down
6 changes: 4 additions & 2 deletions sdk/src/logs/multi_recordable.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include "opentelemetry/sdk/logs/multi_recordable.h"

#include <cstddef>
#include <memory>
#include <unordered_map>
#include <utility>

#include "opentelemetry/sdk/logs/multi_recordable.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
Expand Down
Loading

0 comments on commit 7b8b85e

Please sign in to comment.