Skip to content
Merged
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
2 changes: 2 additions & 0 deletions api/include/opentelemetry/common/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#pragma once

#include <ctype.h>

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

Expand Down
19 changes: 19 additions & 0 deletions functional/configuration/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

set -e

# To run tests in a local dev environment:
# - set BUILD_DIR to the top level build directory,

[ -z "${BUILD_DIR}" ] && export BUILD_DIR="${HOME}/build"

export EXAMPLE_BIN_DIR="${BUILD_DIR}/examples/configuration/"

# Make sure `example_yaml` is in the path
export PATH=${PATH}:${EXAMPLE_BIN_DIR}

shelltest ./shelltests

8 changes: 8 additions & 0 deletions functional/configuration/shelltests/disabled_empty.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

$ example_yaml --test --yaml shelltests/disabled_empty.yaml
>
MODEL PARSED
SDK CREATED
>= 0
5 changes: 5 additions & 0 deletions functional/configuration/shelltests/disabled_empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: 1.0.0
disabled:
8 changes: 8 additions & 0 deletions functional/configuration/shelltests/disabled_false.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

$ example_yaml --test --yaml shelltests/disabled_false.yaml
>
MODEL PARSED
SDK CREATED
>= 0
5 changes: 5 additions & 0 deletions functional/configuration/shelltests/disabled_false.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: 1.0.0
disabled: false
8 changes: 8 additions & 0 deletions functional/configuration/shelltests/disabled_true.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

$ example_yaml --test --yaml shelltests/disabled_true.yaml
>
MODEL PARSED
SDK CREATED
>= 0
5 changes: 5 additions & 0 deletions functional/configuration/shelltests/disabled_true.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: 1.0.0
disabled: true
8 changes: 8 additions & 0 deletions functional/configuration/shelltests/empty.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

$ example_yaml --test --yaml shelltests/empty.yaml
>
[ERROR] [Yaml Configuration Parser] Parse failed with exception: Yaml: not a map, looking for: file_format
FAILED TO PARSE MODEL
>= 1
4 changes: 4 additions & 0 deletions functional/configuration/shelltests/empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# empty yaml file
8 changes: 8 additions & 0 deletions functional/configuration/shelltests/format_empty.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

$ example_yaml --test --yaml shelltests/format_empty.yaml
>
[ERROR] [Yaml Configuration Parser] Parse failed with exception: Yaml: string value is empty: file_format
FAILED TO PARSE MODEL
>= 1
5 changes: 5 additions & 0 deletions functional/configuration/shelltests/format_empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# This must fail
file_format:
46 changes: 46 additions & 0 deletions functional/configuration/shelltests/kitchen-sink.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

$ example_yaml --test --yaml shelltests/kitchen-sink.yaml | egrep -v "(observed_timestamp|trace_id|span_id)"
>
MODEL PARSED
[WARNING] attribute_limits not supported, ignoring
[WARNING] IncludeExclude attribute processor not supported, ignoring
[WARNING] metric producer not supported, ignoring
[WARNING] metric producer not supported, ignoring
[WARNING] [Periodic Exporting Metric Reader] Invalid configuration: export_timeout_millis_ should be less than export_interval_millis_, using default values
[WARNING] [Periodic Exporting Metric Reader] Invalid configuration: export_timeout_millis_ should be less than export_interval_millis_, using default values
[WARNING] [Periodic Exporting Metric Reader] Invalid configuration: export_timeout_millis_ should be less than export_interval_millis_, using default values
[WARNING] [Periodic Exporting Metric Reader] Invalid configuration: export_timeout_millis_ should be less than export_interval_millis_, using default values
SDK CREATED
{
timestamp : 0
severity_num : 5
severity_text : DEBUG
body : body
resource :
telemetry.sdk.version: 1.22.0
service.version: 1.0.0
double_array_key: [1.1,2.2]
double_key: 1.1
bool_key: 1
int_array_key: [1,2]
int_key: 1
string_array_key: [value1,value2]
string_key: value
service.namespace: my-namespace
telemetry.sdk.language: cpp
bool_array_key: [1,0]
service.name: unknown_service
telemetry.sdk.name: opentelemetry
attributes :
event_id : 0
event_name :
trace_flags : 00
scope :
name : foo_library
version :
schema_url :
attributes :
}
>= 0
Loading
Loading