Skip to content

Commit

Permalink
Merge branch 'main' into baggage
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Mar 15, 2021
2 parents 3a8d289 + 1e5751e commit 7aaa78a
Show file tree
Hide file tree
Showing 58 changed files with 2,217 additions and 161 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ Increment the:

## [Unreleased]

* Added `ForceFlush` to `TracerProvider` in SDK. ([#588](https://github.com/open-telemetry/opentelemetry-cpp/pull/588)).
* [EXPORTER] Added Zipkin Exporter. ([#471](https://github.com/open-telemetry/opentelemetry-cpp/pull/471))
* [API] Added Jaeger propagator. ([#599](https://github.com/open-telemetry/opentelemetry-cpp/pull/599))
* [PROPAGATOR] Added Composite Propagator ([#597](https://github.com/open-telemetry/opentelemetry-cpp/pull/597))

## [0.2.0] 2021-03-02

* [SDK] Added `ForceFlush` to `TracerProvider`. ([#588](https://github.com/open-telemetry/opentelemetry-cpp/pull/588)).
* [SDK] Added Resource API. ([#502](https://github.com/open-telemetry/opentelemetry-cpp/pull/502))
* [API] Modified TraceState support for w3c trace context as per specs.
([#551](https://github.com/open-telemetry/opentelemetry-cpp/pull/551))
* [API] Added B3 Propagator. ([#523](https://github.com/open-telemetry/opentelemetry-cpp/pull/523))
* [Exporter] Added ETW Exporter. ([#376](https://github.com/open-telemetry/opentelemetry-cpp/pull/376))
* [CI] Enable cache for Bazel for faster builds. ([#505](https://github.com/open-telemetry/opentelemetry-cpp/pull/505))

## [0.0.1] 2020-12-16

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ if(WITH_STL)
endif()

option(WITH_OTLP "Whether to include the OpenTelemetry Protocol in the SDK" OFF)
option(WITH_ZIPKIN "Whether to include the Zipkin exporter in the SDK" OFF)

option(WITH_PROMETHEUS "Whether to include the Prometheus Client in the SDK"
OFF)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ A PR is considered to be **ready to merge** when:
/
[Maintainer](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer)
(at different company).
* A pull reqeust opened by an Approver / Maintainer can be merged with only one
* A pull request opened by an Approver / Maintainer can be merged with only one
approval from Approver / Maintainer (at different company).
* Major feedback items/points are resolved.
* It has been open for review for at least one working day. This gives people
Expand Down
15 changes: 8 additions & 7 deletions api/docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "Version 0.1.0"
PROJECT_BRIEF = "Version 0.2.0"

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down Expand Up @@ -790,8 +790,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = ./Overview.md \
../include/opentelemetry/common \
INPUT = ../include/opentelemetry/common \
../include/opentelemetry/core \
../include/opentelemetry/nostd/shared_ptr.h \
../include/opentelemetry/nostd/span.h \
Expand Down Expand Up @@ -839,6 +838,8 @@ RECURSIVE = YES
# run.

EXCLUDE = ../include/opentelemetry/common/spin_lock_mutex.h \
../include/opentelemetry/common/key_value_iterable_view.h \
../include/opentelemetry/trace/span_context_kv_iterable_view.h \
../include/opentelemetry/nostd/detail

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
Expand Down Expand Up @@ -1088,7 +1089,7 @@ IGNORE_PREFIX =
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.

GENERATE_HTML = YES
GENERATE_HTML = NO

# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down Expand Up @@ -1444,7 +1445,7 @@ DISABLE_INDEX = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

GENERATE_TREEVIEW = NO
GENERATE_TREEVIEW = YES

# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
Expand Down Expand Up @@ -1912,15 +1913,15 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = NO
GENERATE_XML = YES

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.

XML_OUTPUT = xml
XML_OUTPUT = doxyoutput/xml

# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
Expand Down
25 changes: 25 additions & 0 deletions api/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile clean

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
mkdir -p doxyoutput
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf doxyoutput
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
79 changes: 0 additions & 79 deletions api/docs/Overview.md

This file was deleted.

84 changes: 84 additions & 0 deletions api/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'OpenTelemetry C++ API'
copyright = '2021, OpenTelemetry authors'
author = 'OpenTelemetry authors'

# Run doxygen
# -----------
# For the readthedocs builds, for some reason exhale doesn't find doxygen.
# So we run it manually here.
import subprocess
import os
if not os.path.isdir('doxyoutput'):
os.mkdir('doxyoutput')
subprocess.call(['doxygen'])


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"breathe",
"exhale",
]

breathe_projects = {
"OpenTelemetry C++ API": "./doxyoutput/xml"
}

breathe_default_project = "OpenTelemetry C++ API"

exhale_args = {
"containmentFolder": "otel_api",
"rootFileName": "otel_api.rst",
"rootFileTitle": "Reference documentation",
"doxygenStripFromPath": "..",
"exhaleUseDoxyfile": True,
"createTreeView": True,
}

primary_domain = "cpp"

higlight_language = "cpp"


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
2 changes: 2 additions & 0 deletions api/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OpenTelemetry C++ API
=====================
2 changes: 1 addition & 1 deletion api/include/opentelemetry/context/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Context
}

// Returns the value associated with the passed in key.
context::ContextValue GetValue(const nostd::string_view key) noexcept
context::ContextValue GetValue(const nostd::string_view key) const noexcept
{
for (DataList *data = head_.get(); data != nullptr; data = data->next_.get())
{
Expand Down
16 changes: 3 additions & 13 deletions api/include/opentelemetry/trace/propagation/b3_propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <iostream>
#include <map>
#include <string>
#include "detail/context.h"
#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/context/context.h"
#include "opentelemetry/nostd/shared_ptr.h"
Expand Down Expand Up @@ -62,17 +63,6 @@ class B3PropagatorExtractor : public TextMapPropagator<T>
return context.SetValue(kSpanKey, sp);
}

static SpanContext GetCurrentSpan(const context::Context &context)
{
context::Context ctx(context);
context::ContextValue span = ctx.GetValue(kSpanKey);
if (nostd::holds_alternative<nostd::shared_ptr<Span>>(span))
{
return nostd::get<nostd::shared_ptr<Span>>(span).get()->GetContext();
}
return SpanContext::GetInvalid();
}

static TraceId GenerateTraceIdFromString(nostd::string_view trace_id)
{
uint8_t buf[kTraceIdHexStrLength / 2];
Expand Down Expand Up @@ -213,7 +203,7 @@ class B3Propagator : public B3PropagatorExtractor<T>
// Sets the context for a HTTP header carrier with self defined rules.
void Inject(Setter setter, T &carrier, const context::Context &context) noexcept override
{
SpanContext span_context = B3PropagatorExtractor<T>::GetCurrentSpan(context);
SpanContext span_context = detail::GetCurrentSpan(context);
if (!span_context.IsValid())
{
return;
Expand Down Expand Up @@ -251,7 +241,7 @@ class B3PropagatorMultiHeader : public B3PropagatorExtractor<T>
nostd::string_view trace_description);
void Inject(Setter setter, T &carrier, const context::Context &context) noexcept override
{
SpanContext span_context = B3PropagatorExtractor<T>::GetCurrentSpan(context);
SpanContext span_context = detail::GetCurrentSpan(context);
if (!span_context.IsValid())
{
return;
Expand Down
Loading

0 comments on commit 7aaa78a

Please sign in to comment.