Skip to content

Commit

Permalink
opentelemetry tracer: Add TraceState types from OTel C++ SDK (envoypr…
Browse files Browse the repository at this point in the history
…oxy#32333)

Signed-off-by: Joao Grassi <[email protected]>
Signed-off-by: Joao Grassi <[email protected]>
  • Loading branch information
joaopgrassi authored Feb 22, 2024
1 parent 5d4dccb commit c82c083
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
8 changes: 8 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ def envoy_dependencies(skip_targets = []):
_io_hyperscan()
_io_vectorscan()
_io_opentracing_cpp()
_io_opentelemetry_api_cpp()
_net_colm_open_source_colm()
_net_colm_open_source_ragel()
_net_zlib()
Expand Down Expand Up @@ -775,6 +776,13 @@ def _io_opentracing_cpp():
actual = "@io_opentracing_cpp//:opentracing",
)

def _io_opentelemetry_api_cpp():
external_http_archive("io_opentelemetry_cpp")
native.bind(
name = "opentelemetry_api",
actual = "@io_opentelemetry_cpp//api:api",
)

def _com_github_datadog_dd_trace_cpp():
external_http_archive("com_github_datadog_dd_trace_cpp")
native.bind(
Expand Down
18 changes: 18 additions & 0 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,24 @@ REPOSITORY_LOCATIONS_SPEC = dict(
license = "Apache-2.0",
license_url = "https://github.com/opentracing/opentracing-cpp/blob/v{version}/LICENSE",
),
io_opentelemetry_cpp = dict(
project_name = "OpenTelemetry",
project_desc = "Observability framework and toolkit designed to create and manage telemetry data such as traces, metrics, and logs.",
project_url = "https://opentelemetry.io",
version = "1.14.0",
sha256 = "9a67561b8f4dba8cf8bb323b404069cbcc2f59974e1330b1ba192c5c8d68c28e",
strip_prefix = "opentelemetry-cpp-{version}",
urls = ["https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v{version}.tar.gz"],
use_category = ["observability_ext"],
extensions = [
"envoy.tracers.opentelemetry",
"envoy.tracers.opentelemetry.samplers.always_on",
],
release_date = "2024-02-17",
cpe = "N/A",
license = "Apache-2.0",
license_url = "https://github.com/open-telemetry/opentelemetry-cpp/blob/v{version}/LICENSE",
),
skywalking_data_collect_protocol = dict(
project_name = "skywalking-data-collect-protocol",
project_desc = "Data Collect Protocols of Apache SkyWalking",
Expand Down
6 changes: 6 additions & 0 deletions source/extensions/tracers/opentelemetry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ envoy_cc_library(
"span_context_extractor.h",
"tracer.h",
],
copts = [
# Make sure that headers included from opentelemetry-api use Abseil from Envoy
# https://github.com/open-telemetry/opentelemetry-cpp/blob/v1.14.0/api/BUILD#L32
"-DHAVE_ABSEIL",
],
external_deps = ["opentelemetry_api"],
deps = [
":trace_exporter",
"//envoy/thread_local:thread_local_interface",
Expand Down
10 changes: 9 additions & 1 deletion test/extensions/tracers/opentelemetry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ envoy_extension_cc_test(
srcs = [
"opentelemetry_tracer_impl_test.cc",
],
copts = [
# Make sure that headers included from opentelemetry-api use Abseil from Envoy
# https://github.com/open-telemetry/opentelemetry-cpp/blob/v1.14.0/api/BUILD#L32
"-DHAVE_ABSEIL",
],
extension_names = ["envoy.tracers.opentelemetry"],
external_deps = ["abseil_optional"],
external_deps = [
"abseil_optional",
"opentelemetry_api",
],
deps = [
"//envoy/common:time_interface",
"//envoy/runtime:runtime_interface",
Expand Down

0 comments on commit c82c083

Please sign in to comment.