Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Increment the:
resource detectors
[#4412](https://github.com/open-telemetry/opentelemetry-cpp/issues/4412)

* [CONFIGURATION] Internal logging cleanup
[#4479](https://github.com/open-telemetry/opentelemetry-cpp/pull/4479)

* [CONFIGURATION] Add support for composable sampler extensions.
[#4409](https://github.com/open-telemetry/opentelemetry-cpp/issues/4409)

Expand Down
6 changes: 3 additions & 3 deletions examples/configuration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ if(BUILD_TESTING)
AND OTELCPP_WITH_PROMETHEUS
AND OTELCPP_WITH_RESOURCE_DETECTORS_PREVIEW)
add_test(NAME examples.example_yaml_kitchen_sink
COMMAND $<TARGET_FILE:example_yaml> --test --yaml
COMMAND $<TARGET_FILE:example_yaml> --debug --yaml
${CMAKE_CURRENT_SOURCE_DIR}/kitchen-sink.yaml)
endif()

add_test(NAME examples.example_yaml_extensions
COMMAND $<TARGET_FILE:example_yaml> --test --yaml
COMMAND $<TARGET_FILE:example_yaml> --debug --yaml
${CMAKE_CURRENT_SOURCE_DIR}/extensions.yaml)

add_test(NAME examples.example_yaml_sdk_default
COMMAND $<TARGET_FILE:example_yaml> --test --yaml
COMMAND $<TARGET_FILE:example_yaml> --debug --yaml
${CMAKE_CURRENT_SOURCE_DIR}/sdk-default.yaml)
endif()
10 changes: 5 additions & 5 deletions examples/configuration/custom_log_record_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ opentelemetry::sdk::common::ExportResult CustomLogRecordExporter::Export(
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>>
& /* records */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomLogRecordExporter::Export(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomLogRecordExporter::Export(): YOUR CODE HERE");
return opentelemetry::sdk::common::ExportResult::kSuccess;
}

bool CustomLogRecordExporter::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomLogRecordExporter::ForceFlush(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomLogRecordExporter::ForceFlush(): YOUR CODE HERE");
return true;
}

bool CustomLogRecordExporter::Shutdown(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomLogRecordExporter::Shutdown(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomLogRecordExporter::Shutdown(): YOUR CODE HERE");
return true;
}
10 changes: 5 additions & 5 deletions examples/configuration/custom_log_record_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ CustomLogRecordProcessor::MakeRecordable() noexcept
void CustomLogRecordProcessor::OnEmit(
std::unique_ptr<opentelemetry::sdk::logs::Recordable> &&span) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::OnEnd(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomLogRecordProcessor::OnEmit(): YOUR CODE HERE");
auto unused = std::move(span);
}

bool CustomLogRecordProcessor::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::ForceFlush(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomLogRecordProcessor::ForceFlush(): YOUR CODE HERE");
return true;
}

bool CustomLogRecordProcessor::Shutdown(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::Shutdown(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomLogRecordProcessor::Shutdown(): YOUR CODE HERE");
return true;
}
8 changes: 4 additions & 4 deletions examples/configuration/custom_pull_metric_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ opentelemetry::sdk::metrics::AggregationTemporality
CustomPullMetricExporter::GetAggregationTemporality(
opentelemetry::sdk::metrics::InstrumentType /* instrument_type */) const noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::GetAggregationTemporality(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPullMetricExporter::GetAggregationTemporality(): YOUR CODE HERE");
return opentelemetry::sdk::metrics::AggregationTemporality::kCumulative;
}

bool CustomPullMetricExporter::OnForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::OnForceFlush(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPullMetricExporter::OnForceFlush(): YOUR CODE HERE");
return true;
}

bool CustomPullMetricExporter::OnShutDown(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::OnShutDown(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPullMetricExporter::OnShutDown(): YOUR CODE HERE");
return true;
}

void CustomPullMetricExporter::OnInitialized() noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::OnInitialized(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPullMetricExporter::OnInitialized(): YOUR CODE HERE");
}
8 changes: 4 additions & 4 deletions examples/configuration/custom_push_metric_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
opentelemetry::sdk::common::ExportResult CustomPushMetricExporter::Export(
const opentelemetry::sdk::metrics::ResourceMetrics & /* data */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::Export(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPushMetricExporter::Export(): YOUR CODE HERE");
return opentelemetry::sdk::common::ExportResult::kSuccess;
}

opentelemetry::sdk::metrics::AggregationTemporality
CustomPushMetricExporter::GetAggregationTemporality(
opentelemetry::sdk::metrics::InstrumentType /* instrument_type */) const noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::GetAggregationTemporality(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPushMetricExporter::GetAggregationTemporality(): YOUR CODE HERE");
return opentelemetry::sdk::metrics::AggregationTemporality::kCumulative;
}

bool CustomPushMetricExporter::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::ForceFlush(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPushMetricExporter::ForceFlush(): YOUR CODE HERE");
return true;
}

bool CustomPushMetricExporter::Shutdown(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::Shutdown(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomPushMetricExporter::Shutdown(): YOUR CODE HERE");
return true;
}
2 changes: 1 addition & 1 deletion examples/configuration/custom_resource_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

opentelemetry::sdk::resource::Resource CustomResourceDetector::Detect() noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomResourceDetector::Detect(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomResourceDetector::Detect(): YOUR CODE HERE");
return ResourceDetector::Create({{"custom.comment", comment_}});
}
10 changes: 5 additions & 5 deletions examples/configuration/custom_span_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ opentelemetry::sdk::common::ExportResult CustomSpanExporter::Export(
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>>
& /* spans */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanExporter::Export(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomSpanExporter::Export(): YOUR CODE HERE");
return opentelemetry::sdk::common::ExportResult::kSuccess;
}

bool CustomSpanExporter::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanExporter::ForceFlush(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomSpanExporter::ForceFlush(): YOUR CODE HERE");
return true;
}

bool CustomSpanExporter::Shutdown(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanExporter::Shutdown(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomSpanExporter::Shutdown(): YOUR CODE HERE");
return true;
}
12 changes: 6 additions & 6 deletions examples/configuration/custom_span_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ void CustomSpanProcessor::OnStart(
opentelemetry::sdk::trace::Recordable & /* span */,
const opentelemetry::trace::SpanContext & /* parent_context */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanProcessor::OnStart(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomSpanProcessor::OnStart(): YOUR CODE HERE");
}

void CustomSpanProcessor::OnEnd(
std::unique_ptr<opentelemetry::sdk::trace::Recordable> &&span) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanProcessor::OnEnd(): YOUR CODE HERE");
OTEL_INTERNAL_LOG_INFO("CustomSpanProcessor::OnEnd(): YOUR CODE HERE");
auto unused = std::move(span);
}

bool CustomSpanProcessor::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanProcessor::ForceFlush(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomSpanProcessor::ForceFlush(): YOUR CODE HERE");
return true;
}

bool CustomSpanProcessor::Shutdown(std::chrono::microseconds /* timeout */) noexcept
{
OTEL_INTERNAL_LOG_ERROR("CustomSpanProcessor::Shutdown(): YOUR CODE HERE");
return false;
OTEL_INTERNAL_LOG_INFO("CustomSpanProcessor::Shutdown(): YOUR CODE HERE");
return true;
}
3 changes: 3 additions & 0 deletions examples/configuration/extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ file_format: "1.1"
# If omitted or null, false is used.
disabled: false

# Configure the internal log level for the SDK.
log_level: debug

# Configure text map context propagators.
# If omitted, a noop propagator is used.
propagator:
Expand Down
16 changes: 15 additions & 1 deletion examples/configuration/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ file_format: "1.1"
disabled: false
# Configure the log level of the internal logger used by the SDK.
# If omitted, info is used.
log_level: info
log_level: debug
# Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits.
attribute_limits:
# Configure max attribute value size.
Expand Down Expand Up @@ -1006,6 +1006,8 @@ resource:
attributes:
- name: service.name
value: unknown_service
- name: service.version
value: null
- name: string_key
value: value
type: string
Expand Down Expand Up @@ -1074,6 +1076,18 @@ resource:
# Configure resource schema URL.
# If omitted or null, no schema URL is used.
schema_url: https://opentelemetry.io/schemas/1.16.0

# Configure distribution.
# Defines configuration parameters specific to a particular OpenTelemetry distribution or vendor.
# This section provides a standardized location for distribution-specific settings
# that are not part of the OpenTelemetry configuration model.
# It allows vendors to expose their own extensions and general configuration options.
# If omitted, distribution defaults are used.
distribution:
# Configure distribution-specific configuration options.
# Vendors may define their own configuration options here.
example:
property: "value"
# Configure instrumentation.
# This type is in development and subject to breaking changes in minor versions.
instrumentation/development:
Expand Down
Loading
Loading