Skip to content

Commit 3fc6239

Browse files
authored
Merge branch 'open-telemetry:main' into b3multi-headers-propagation
2 parents 1c339b5 + c281184 commit 3fc6239

File tree

164 files changed

+11386
-2210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+11386
-2210
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Geneva Metrics CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
paths:
7+
- "exporters/geneva/**"
8+
- ".github/workflows/geneva_metrics.yml"
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- "exporters/geneva/**"
13+
- ".github/workflows/geneva_metrics.yml"
14+
15+
cmake_linux:
16+
name: CMake on Linux
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: checkout otel contrib geneva metrics
20+
uses: actions/checkout@v3
21+
with:
22+
path: "otel_cpp_contrib"
23+
- name: checkout otel cpp
24+
uses: actions/checkout@v3
25+
with:
26+
repository: "open-telemetry/opentelemetry-cpp"
27+
ref: "v1.8.2"
28+
path: "otel_cpp"
29+
submodules: "recursive"
30+
- name: setup
31+
run: |
32+
sudo apt update -y
33+
sudo apt install -y --no-install-recommends --no-install-suggests build-essential\
34+
ca-certificates wget git valgrind lcov
35+
- name: run tests
36+
run: |
37+
mkdir -p "$GITHUB_WORKSPACE/otel_cpp/build"
38+
cd "$GITHUB_WORKSPACE/otel_cpp/build"
39+
cmake .. -DCMAKE_BUILD_TYPE=Debug
40+
cmake --build . -j --config Debug
41+
cmake --install . --prefix "$HOME/prebuilt-otel" --config Debug
42+
mkdir -p "$GITHUB_WORKSPACE/otel_cpp_contrib/exporters/geneva/build"
43+
cd "$GITHUB_WORKSPACE/otel_cpp_contrib/exporters/geneva/build"
44+
cmake .. "-DCMAKE_PREFIX_PATH=$HOME/prebuilt-otel" -DCMAKE_BUILD_TYPE=Debug \
45+
-DBUILD_TESTING=ON -DBUILD_EXAMPLE=ON
46+
cmake --build . -j --config Debug

.github/workflows/geneva_trace.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Geneva Trace Nuget Generation
5+
6+
on:
7+
push:
8+
branches: "*"
9+
paths:
10+
- "exporters/geneva-trace/**"
11+
- ".github/workflows/geneva_trace.yml"
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- "exporters/geneva-trace/**"
16+
- ".github/workflows/geneva_trace.yml"
17+
18+
jobs:
19+
geneva-trace-nuget-generation:
20+
name: Geneva Trace
21+
runs-on: windows-latest
22+
steps:
23+
- name: github config
24+
run: git config --system core.longpaths true
25+
- uses: actions/checkout@v3
26+
with:
27+
submodules: 'recursive'
28+
- name: NuGet package generation
29+
env:
30+
PackageVersion: 0.0.1
31+
run: |
32+
cd exporters\geneva-trace\tools && .\build-nuget.cmd

.github/workflows/prometheus.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: prometheus instrumentation CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
paths:
7+
- "exporters/prometheus/**"
8+
- ".github/workflows/prometheus.yml"
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- "exporters/prometheus/**"
13+
- ".github/workflows/prometheus.yml"
14+
15+
jobs:
16+
prometheus_bazel_linux:
17+
name: Bazel on Linux
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: checkout otel contrib prometheus
21+
uses: actions/checkout@v3
22+
with:
23+
path: "otel_cpp_contrib"
24+
- name: Mount Bazel Cache
25+
uses: actions/cache@v3
26+
env:
27+
cache-name: bazel_cache
28+
with:
29+
path: /home/runner/.cache/bazel
30+
key: bazel_test
31+
- name: run tests
32+
run: |
33+
cd otel_cpp_contrib/exporters/prometheus
34+
bazel --output_user_root=$HOME/.cache/bazel build --copt=-DENABLE_TEST --@io_opentelemetry_cpp//api:with_abseil //...
35+
bazel --output_user_root=$HOME/.cache/bazel test --copt=-DENABLE_TEST --@io_opentelemetry_cpp//api:with_abseil //...
36+
prometheus_bazel_osx:
37+
name: Bazel on MacOS
38+
runs-on: macos-latest
39+
steps:
40+
- name: checkout otel contrib prometheus
41+
uses: actions/checkout@v3
42+
with:
43+
path: "otel_cpp_contrib"
44+
- name: Mount Bazel Cache
45+
uses: actions/cache@v3
46+
env:
47+
cache-name: bazel_cache
48+
with:
49+
path: /Users/runner/.cache/bazel
50+
key: bazel_osx
51+
- name: run tests
52+
run: |
53+
cd otel_cpp_contrib/exporters/prometheus
54+
bazel --output_user_root=$HOME/.cache/bazel build --copt=-DENABLE_TEST --@io_opentelemetry_cpp//api:with_abseil //...
55+
bazel --output_user_root=$HOME/.cache/bazel test --copt=-DENABLE_TEST --@io_opentelemetry_cpp//api:with_abseil //...
56+
prometheus_bazel_window:
57+
name: Bazel on Windows
58+
runs-on: windows-latest
59+
steps:
60+
- name: checkout otel contrib prometheus
61+
uses: actions/checkout@v3
62+
with:
63+
path: "otel_cpp_contrib"
64+
- name: run tests
65+
shell: pwsh
66+
run: |
67+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
68+
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
69+
$RUNNER_ROOT_PATH = Split-Path (Split-Path (Get-Location))
70+
Set-Location otel_cpp_contrib/exporters/prometheus
71+
& bazel --windows_enable_symlinks "--output_user_root=$RUNNER_ROOT_PATH/bazel_build" `
72+
build --copt=-DENABLE_TEST --copt=/utf-8 --sandbox_debug --@io_opentelemetry_cpp//api:with_abseil //...
73+
& bazel --windows_enable_symlinks "--output_user_root=$RUNNER_ROOT_PATH/bazel_build" `
74+
test --copt=-DENABLE_TEST --copt=/utf-8 --sandbox_debug --@io_opentelemetry_cpp//api:with_abseil //...
75+
prometheus_cmake_linux:
76+
name: CMake on Linux
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: checkout otel contrib prometheus
80+
uses: actions/checkout@v3
81+
with:
82+
path: "otel_cpp_contrib"
83+
- name: checkout otel cpp
84+
uses: actions/checkout@v3
85+
with:
86+
repository: "open-telemetry/opentelemetry-cpp"
87+
ref: "v1.6.1"
88+
path: "otel_cpp"
89+
submodules: "recursive"
90+
- name: setup
91+
run: |
92+
sudo apt update -y
93+
sudo apt install -y --no-install-recommends --no-install-suggests build-essential\
94+
ca-certificates wget git valgrind lcov
95+
- name: run tests
96+
run: |
97+
vcpkg install prometheus-cpp[pull,push] nlohmann-json GTest Benchmark --triplet=x64-linux
98+
mkdir -p "$GITHUB_WORKSPACE/otel_cpp/build"
99+
cd "$GITHUB_WORKSPACE/otel_cpp/build"
100+
cmake .. -DWITH_PROMETHEUS=ON -DWITH_METRICS_PREVIEW=OFF -DCMAKE_BUILD_TYPE=Debug \
101+
-DVCPKG_TARGET_TRIPLET=x64-linux \
102+
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
103+
cmake --build . -j --config Debug
104+
cmake --install . --prefix "$HOME/prebuilt-otel" --config Debug
105+
mkdir -p "$GITHUB_WORKSPACE/otel_cpp_contrib/exporters/prometheus/build"
106+
cd "$GITHUB_WORKSPACE/otel_cpp_contrib/exporters/prometheus/build"
107+
cmake .. "-DCMAKE_PREFIX_PATH=$HOME/prebuilt-otel" -DCMAKE_BUILD_TYPE=Debug \
108+
-DVCPKG_TARGET_TRIPLET=x64-linux \
109+
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
110+
cmake --build . -j --config Debug
111+
ctest -VV -R "opentelemetry_cpp_ecosystem_test.*" .

.github/workflows/webserver.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ jobs:
114114
with:
115115
name: opentelemetry-webserver-sdk-x64-linux.tgz
116116
path: /tmp/apache_centos7/opentelemetry-webserver-sdk-x64-linux.tgz
117+
- name: run integrationtest
118+
run: |
119+
docker rm -f apache_centos7_container
120+
cd instrumentation/otel-webserver-module
121+
docker-compose --profile centos7 up -d
122+
docker ps -a
123+
sleep 30
124+
./gradlew :test:integration:integrationTests -i
117125
118126
webserver-build-test-centos6:
119127
name: webserver-centos6-build

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "exporters/geneva-trace/third_party/opentelemetry-cpp"]
2+
path = exporters/geneva-trace/third_party/opentelemetry-cpp
3+
url = https://github.com/open-telemetry/opentelemetry-cpp
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
/* clang-format off */
7+
8+
/**
9+
* List of configurable Field Name constants:
10+
*
11+
* - env_ver - Schema version (optional for ETW exporter).
12+
* - env_name - Built-in ETW name at envelope level (dedicated ETW field).
13+
* - env_time - Built-in ETW time at envelope level.
14+
* - env_dt_spanId - OT SpanId
15+
* - env_dt_traceId - OT TraceId
16+
* - startTime - OT Span start time
17+
* - kind - OT Span kind
18+
* - name - OT Span name in ETW 'Payload["name"]'
19+
* - parentId - OT Span parentId
20+
* - links - OT Span links array
21+
*
22+
* Other standard fields (reserved names) that may be appended by ETW channel:
23+
*
24+
* - Level
25+
* - ProviderGuid
26+
* - ProviderName
27+
* - OpcodeName
28+
* - KeywordName
29+
* - TaskName
30+
* - ChannelName
31+
* - EventMessage
32+
* - ActivityId
33+
* - Pid
34+
* - Tid
35+
*
36+
*/
37+
# define ETW_FIELD_VERSION "env_ver" /* Event version */
38+
# define ETW_FIELD_TYPE "env_type" /* Event type */
39+
# define ETW_FIELD_NAME "env_name" /* Event name */
40+
41+
#ifndef HAVE_FIELD_TIME
42+
#define HAVE_FIELD_TIME
43+
#endif
44+
# define ETW_FIELD_TIME "env_time" /* Event time at envelope */
45+
46+
# define ETW_FIELD_OPCODE "env_opcode" /* OpCode for TraceLogging */
47+
48+
# define ETW_FIELD_TRACE_ID "env_dt_traceId" /* Trace Id */
49+
# define ETW_FIELD_SPAN_ID "env_dt_spanId" /* Span Id */
50+
# define ETW_FIELD_SPAN_PARENTID "parentId" /* Span ParentId */
51+
# define ETW_FIELD_SPAN_KIND "kind" /* Span Kind */
52+
# define ETW_FIELD_SPAN_LINKS "links" /* Span Links array */
53+
54+
# define ETW_FIELD_PAYLOAD_NAME "name" /* ETW Payload["name"] */
55+
56+
/* Span option constants */
57+
# define ETW_FIELD_STARTTIME "startTime" /* Operation start time */
58+
# define ETW_FIELD_ENDTTIME "env_time" /* Operation end time */
59+
# define ETW_FIELD_DURATION "duration" /* Operation duration */
60+
# define ETW_FIELD_STATUSCODE "statusCode" /* OT Span status code */
61+
# define ETW_FIELD_STATUSMESSAGE "statusMessage" /* OT Span status message */
62+
# define ETW_FIELD_SUCCESS "success" /* OT Span success */
63+
# define ETW_FIELD_TIMESTAMP "Timestamp" /* Log timestamp */
64+
65+
# define ETW_FIELD_CLIENTREQID "clientRequestId"
66+
# define ETW_FIELD_CORRELREQID "correlationRequestId"
67+
68+
/* Value constants */
69+
# define ETW_VALUE_SPAN "Span" /* ETW event name for Span */
70+
# define ETW_VALUE_LOG "Log" /* ETW event name for Log */
71+
72+
# define ETW_VALUE_SPAN_START "SpanStart" /* ETW for Span Start */
73+
# define ETW_VALUE_SPAN_END "SpanEnd" /* ETW for Span Start */
74+
75+
# define ETW_FIELD_LOG_BODY "body" /* Log body */
76+
# define ETW_FIELD_LOG_SEVERITY_TEXT "severityText" /* Sev text */
77+
# define ETW_FIELD_LOG_SEVERITY_NUM "severityNumber" /* Sev num */
78+
79+
/* clang-format on */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#ifndef CUSTOM_ETW_FIELDS_H
7+
#define CUSTOM_ETW_FIELDS_H <opentelemetry/exporters/geneva/geneva_fields.h>
8+
#endif
9+
10+
#define ENABLE_LOGS_PREVIEW
11+
#include <opentelemetry/exporters/etw/etw_logger_exporter.h>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#ifndef CUSTOM_ETW_FIELDS_H
7+
#define CUSTOM_ETW_FIELDS_H <opentelemetry/exporters/geneva/geneva_fields.h>
8+
#endif
9+
10+
#include <opentelemetry/exporters/etw/etw_tracer_exporter.h>
Submodule opentelemetry-cpp added at 95f6c66
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Rem Copyright The OpenTelemetry Authors
2+
Rem SPDX-License-Identifier: Apache-2.0
3+
4+
@echo off
5+
pushd "%~dp0"
6+
set "PATH=%CD%;%PATH%"
7+
8+
if not defined PackageVersion (
9+
echo "Set the PackageVersion before proceeding."
10+
exit
11+
)
12+
if not exist "..\packages" mkdir "..\packages"
13+
14+
REM This script assumes that the main OpenTelemetry C++ repo
15+
REM has been checked out as submodule
16+
powershell -File .\build-nuget.ps1 %CD%\..\third_party\opentelemetry-cpp
17+
18+
REM If %OUTPUTROOT% variable is defined, then copy the packages
19+
REM to %OUTPUTROOT%\packages for subsequent deployment.
20+
if defined OUTPUTROOT (
21+
if not exist "%OUTPUTROOT%\packages" mkdir "%OUTPUTROOT%\packages"
22+
copy /Y ..\packages\*.nupkg "%OUTPUTROOT%\packages"
23+
)
24+
popd

0 commit comments

Comments
 (0)