Skip to content

Commit

Permalink
Merge branch 'main' into metrics-benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Feb 22, 2023
2 parents 3be7183 + 5c121cf commit 35e430c
Show file tree
Hide file tree
Showing 301 changed files with 3,003 additions and 840 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# bazel configurations for running tests under sanitizers.
# Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc

Expand Down
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# See Clang docs: http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Chromium

Expand Down
3 changes: 3 additions & 0 deletions .cmake-format.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# If comment markup is enabled, don't reflow the first comment block in
# eachlistfile. Use this to preserve formatting of your
# copyright/licensestatements.
Expand Down
51 changes: 51 additions & 0 deletions .copyright-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# Ignore the following directories

./.git/*
./.github/*
./third_party/benchmark/*
./third_party/boost/*
./third_party/googletest/*
./third_party/ms-gsl/*
./third_party/nlohmann-json/*
./third_party/opentelemetry-proto/*
./third_party/prometheus-cpp/*
./tools/vcpkg/*
./tools/ports/*

# Third party code

./api/include/opentelemetry/nostd/internal/absl/*
./exporters/jaeger/thrift-gen/*
./exporters/etw/include/opentelemetry/exporters/etw/TraceLoggingDynamic.h

# Doc

./docs/*

## Ignore the following files patterns

*.md
*.rst
*.png
*.log
*.patch
*.json
*.nuspec

# Packaging
*/CONTROL

# LICENSE files
*/LICENSE

# Ignore the following misc files

./.bazelignore
./.bazelversion
./docker/.gitignore
.markdownlintignore
./ci/toc.yml
./ci/valgrind-suppressions
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,13 @@ jobs:
- name: run tests
run: ./ci/do_ci.sh format

copyright:
name: Copyright
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: check copyright
run: ./tools/check_copyright.sh

windows:
name: CMake -> exporter proto
Expand All @@ -511,6 +518,23 @@ jobs:
- name: run otprotocol test
run: ./ci/do_ci.ps1 cmake.exporter.otprotocol.test

windows-build-dll:
name: CMake -> exporter proto (Build as DLL)
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test (DLL build)
run: ./ci/do_ci.ps1 cmake.dll.test
- name: run otprotocol test (DLL build)
run: ./ci/do_ci.ps1 cmake.exporter.otprotocol.dll.test

windows_with_async_export:
name: CMake (With async export) -> exporter proto
runs-on: windows-2019
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# Ref. https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore
# Prerequisites
*.d
Expand All @@ -16,6 +19,7 @@
*.so
*.dylib
*.dll
*.pdb

# Fortran module files
*.mod
Expand Down Expand Up @@ -51,3 +55,6 @@

tags
.cache/clangd/*

# Temporary dir used when generating semconv
./buildscripts/semantic-convention/opentelemetry-specification
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,20 @@ Increment the:

## [Unreleased]

* [ETW Exporter]Support serialize span/log attributes into JSON
[#1991](https://github.com/open-telemetry/opentelemetry-cpp/pull/1991)
* ETW Exporter]Do not overwrite ParentId when setting attribute on Span
[#1989](https://github.com/open-telemetry/opentelemetry-cpp/pull/1989)
* Convert Prometheus Exporter to Pull MetricReader [#1953](https://github.com/open-telemetry/opentelemetry-cpp/pull/1953)
* Upgrade prometheus-cpp to v1.1.0 [#1954](https://github.com/open-telemetry/opentelemetry-cpp/pull/1954)
* [BUILD] Build OpenTelemetry SDK and exporters into DLL
[#1932](https://github.com/open-telemetry/opentelemetry-cpp/pull/1932)
* [CI] Enforce copyright check in CI [#1965](https://github.com/open-telemetry/opentelemetry-cpp/pull/1965)
* [SEMANTIC CONVENTIONS] Upgrade to version 1.18.0
[#1974](https://github.com/open-telemetry/opentelemetry-cpp/pull/1974)
* Fix Prometheus server crash on listening to already used port [#1986](https://github.com/open-telemetry/opentelemetry-cpp/pull/1986)
* [EXPORTER] Boolean environment variables not parsed per the spec
[#1982](https://github.com/open-telemetry/opentelemetry-cpp/pull/1982)

## [1.8.2] 2023-01-31

Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,17 @@ endif()

include(CMakePackageConfigHelpers)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
if(NOT MSVC)
message(WARNING "Build DLL is supposed to work with MSVC!")
endif()
if(WITH_STL)
message(
WARNING "Build DLL with C++ STL could cause binary incompatibility!")
endif()
add_definitions(-DOPENTELEMETRY_BUILD_EXPORT_DLL)
endif()

include_directories(api/include)

add_subdirectory(api)
Expand Down
6 changes: 2 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,8 @@ cc_library(

## Building shared libs for Windows

Windows DLL build is not supported. There are some constraints on how C++ DLLs
work on Windows, specifically we can't safely allocate memory in one DLL and
free it in another. For now, OpenTelemetry C++ targets need to be statically
linked into the Windows applications.
Windows DLL build is supported under **preview**. Please check the
[doc](./docs/build-as-dll.md) for more details.

## Generatring binary packages

Expand Down
15 changes: 2 additions & 13 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2019, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

workspace(name = "io_opentelemetry_cpp")

Expand Down
15 changes: 2 additions & 13 deletions api/BUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2019, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

Expand Down
26 changes: 0 additions & 26 deletions api/CHANGELOG.md

This file was deleted.

5 changes: 4 additions & 1 deletion api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

add_library(opentelemetry_api INTERFACE)
target_include_directories(
opentelemetry_api
Expand Down Expand Up @@ -78,7 +81,7 @@ if(WITH_LOGS_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_LOGS_PREVIEW)
endif()

if(WITH_NO_GENENV)
if(WITH_NO_GETENV)
target_compile_definitions(opentelemetry_api INTERFACE NO_GETENV)
endif()

Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/baggage/baggage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OPENTELEMETRY_BEGIN_NAMESPACE
namespace baggage
{

class Baggage
class OPENTELEMETRY_EXPORT Baggage
{
public:
static constexpr size_t kMaxKeyValuePairs = 180;
Expand Down
25 changes: 25 additions & 0 deletions api/include/opentelemetry/common/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,28 @@ point.
# define OPENTELEMETRY_API_SINGLETON

#endif

/* clang-format on */
//
// The if/elif order matters here. If both OPENTELEMETRY_BUILD_IMPORT_DLL and
// OPENTELEMETRY_BUILD_EXPORT_DLL are defined, the former takes precedence.
//
// TODO: consider define OPENTELEMETRY_EXPORT for cygwin/gcc, see below link.
// https://gcc.gnu.org/wiki/Visibility#How_to_use_the_new_C.2B-.2B-_visibility_support
//
#if defined(_MSC_VER) && defined(OPENTELEMETRY_BUILD_IMPORT_DLL)

# define OPENTELEMETRY_EXPORT __declspec(dllimport)

#elif defined(_MSC_VER) && defined(OPENTELEMETRY_BUILD_EXPORT_DLL)

# define OPENTELEMETRY_EXPORT __declspec(dllexport)

#else

//
// build OpenTelemetry as static library or not on Windows.
//
# define OPENTELEMETRY_EXPORT

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace propagation

/* Stores the singleton TextMapPropagator */

class GlobalTextMapPropagator
class OPENTELEMETRY_EXPORT GlobalTextMapPropagator
{
public:
static nostd::shared_ptr<TextMapPropagator> GetGlobalPropagator() noexcept
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/context/runtime_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Token
* this class and passing an initialized RuntimeContextStorage object to
* RuntimeContext::SetRuntimeContextStorage.
*/
class RuntimeContextStorage
class OPENTELEMETRY_EXPORT RuntimeContextStorage
{
public:
/**
Expand Down Expand Up @@ -78,7 +78,7 @@ static RuntimeContextStorage *GetDefaultStorage() noexcept;
// Provides a wrapper for propagating the context object globally.
//
// By default, a thread-local runtime context storage is used.
class RuntimeContext
class OPENTELEMETRY_EXPORT RuntimeContext
{
public:
// Return the current context.
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,4 @@ class Logger
} // namespace logs
OPENTELEMETRY_END_NAMESPACE

#endif
#endif // end of ENABLE_LOGS_PREVIEW
6 changes: 4 additions & 2 deletions api/include/opentelemetry/logs/logger_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#pragma once

#ifdef ENABLE_LOGS_PREVIEW

# include "opentelemetry/common/key_value_iterable.h"
Expand All @@ -16,7 +17,7 @@ namespace logs
/**
* Creates new Logger instances.
*/
class LoggerProvider
class OPENTELEMETRY_EXPORT LoggerProvider
{
public:
virtual ~LoggerProvider() = default;
Expand Down Expand Up @@ -68,4 +69,5 @@ class LoggerProvider
};
} // namespace logs
OPENTELEMETRY_END_NAMESPACE
#endif

#endif // ENABLE_LOGS_PREVIEW
3 changes: 3 additions & 0 deletions api/include/opentelemetry/nostd/detail/all.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <type_traits>
Expand Down
3 changes: 3 additions & 0 deletions api/include/opentelemetry/nostd/detail/decay.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <type_traits>
Expand Down
3 changes: 3 additions & 0 deletions api/include/opentelemetry/nostd/detail/dependent_type.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <type_traits>
Expand Down
3 changes: 3 additions & 0 deletions api/include/opentelemetry/nostd/detail/functional.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <utility>
Expand Down
3 changes: 3 additions & 0 deletions api/include/opentelemetry/nostd/detail/invoke.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <type_traits>
Expand Down
Loading

0 comments on commit 35e430c

Please sign in to comment.