Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add GRPC in maintainer CI #3248

Merged
merged 3 commits into from
Jan 21, 2025
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
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ jobs:
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: setup grpc
run: |
sudo ./ci/setup_grpc.sh
- name: run cmake gcc (maintainer mode, sync)
env:
CC: /usr/bin/gcc-14
Expand Down Expand Up @@ -111,6 +114,9 @@ jobs:
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: setup grpc
run: |
sudo ./ci/setup_grpc.sh
- name: run cmake gcc (maintainer mode, async)
env:
CC: /usr/bin/gcc-14
Expand Down Expand Up @@ -144,6 +150,9 @@ jobs:
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: setup grpc
run: |
sudo ./ci/setup_grpc.sh
- name: run cmake clang (maintainer mode, sync)
env:
CC: /usr/bin/clang-18
Expand Down Expand Up @@ -177,6 +186,9 @@ jobs:
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: setup grpc
run: |
sudo ./ci/setup_grpc.sh
- name: run cmake clang (maintainer mode, async)
env:
CC: /usr/bin/clang-18
Expand Down Expand Up @@ -210,6 +222,9 @@ jobs:
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: setup grpc
run: |
sudo ./ci/setup_grpc.sh
- name: run cmake clang (maintainer mode, abiv2)
env:
CC: /usr/bin/clang-18
Expand Down
3 changes: 3 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
Expand All @@ -131,6 +132,7 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
Expand Down Expand Up @@ -178,6 +180,7 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
Expand Down
10 changes: 5 additions & 5 deletions exporters/otlp/src/otlp_grpc_metric_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ OtlpGrpcMetricExporter::OtlpGrpcMetricExporter(
OtlpGrpcMetricExporter::OtlpGrpcMetricExporter(const OtlpGrpcMetricExporterOptions &options,
const std::shared_ptr<OtlpGrpcClient> &client)
: options_(options),
aggregation_temporality_selector_{
OtlpMetricUtils::ChooseTemporalitySelector(options_.aggregation_temporality)},
client_(client),
client_reference_guard_(OtlpGrpcClientFactory::CreateReferenceGuard())
client_reference_guard_(OtlpGrpcClientFactory::CreateReferenceGuard()),
aggregation_temporality_selector_{
OtlpMetricUtils::ChooseTemporalitySelector(options_.aggregation_temporality)}
{
client_->AddReference(*client_reference_guard_, options_);

Expand All @@ -64,10 +64,10 @@ OtlpGrpcMetricExporter::OtlpGrpcMetricExporter(
std::unique_ptr<proto::collector::metrics::v1::MetricsService::StubInterface> stub,
const std::shared_ptr<OtlpGrpcClient> &client)
: options_(OtlpGrpcMetricExporterOptions()),
aggregation_temporality_selector_{
OtlpMetricUtils::ChooseTemporalitySelector(options_.aggregation_temporality)},
client_(client),
client_reference_guard_(OtlpGrpcClientFactory::CreateReferenceGuard()),
aggregation_temporality_selector_{
OtlpMetricUtils::ChooseTemporalitySelector(options_.aggregation_temporality)},
metrics_service_stub_(std::move(stub))
{
client_->AddReference(*client_reference_guard_, options_);
Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/test/otlp_grpc_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class OtlpMockTraceServiceStub : public proto::collector::trace::v1::MockTraceSe
public:
async_interface(OtlpMockTraceServiceStub *owner) : stub_(owner) {}

virtual ~async_interface() {}
virtual ~async_interface() override = default;

void Export(
::grpc::ClientContext *context,
Expand Down Expand Up @@ -103,7 +103,7 @@ class OtlpMockTraceServiceStub : public proto::collector::trace::v1::MockTraceSe
OtlpMockTraceServiceStub *stub_;
};

async_interface_base *async() { return &async_interface_; }
async_interface_base *async() override { return &async_interface_; }
async_interface_base *experimental_async() { return &async_interface_; }

::grpc::Status GetLastAsyncStatus() const noexcept { return last_async_status_; }
Expand Down
8 changes: 4 additions & 4 deletions exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class OtlpMockTraceServiceStub : public proto::collector::trace::v1::MockTraceSe
public:
async_interface(OtlpMockTraceServiceStub *owner) : stub_(owner) {}

virtual ~async_interface() {}
virtual ~async_interface() override = default;

void Export(
::grpc::ClientContext *context,
Expand Down Expand Up @@ -103,7 +103,7 @@ class OtlpMockTraceServiceStub : public proto::collector::trace::v1::MockTraceSe
OtlpMockTraceServiceStub *stub_;
};

async_interface_base *async() { return &async_interface_; }
async_interface_base *async() override { return &async_interface_; }
async_interface_base *experimental_async() { return &async_interface_; }

::grpc::Status GetLastAsyncStatus() const noexcept { return last_async_status_; }
Expand Down Expand Up @@ -132,7 +132,7 @@ class OtlpMockLogsServiceStub : public proto::collector::logs::v1::MockLogsServi
public:
async_interface(OtlpMockLogsServiceStub *owner) : stub_(owner) {}

virtual ~async_interface() {}
virtual ~async_interface() override = default;

void Export(
::grpc::ClientContext *context,
Expand Down Expand Up @@ -166,7 +166,7 @@ class OtlpMockLogsServiceStub : public proto::collector::logs::v1::MockLogsServi
OtlpMockLogsServiceStub *stub_;
};

async_interface_base *async() { return &async_interface_; }
async_interface_base *async() override { return &async_interface_; }
async_interface_base *experimental_async() { return &async_interface_; }

::grpc::Status GetLastAsyncStatus() const noexcept { return last_async_status_; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <sstream> // IWYU pragma: keep
#include <string>
#include <utility>

#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/sdk/common/attribute_utils.h"
Expand Down
2 changes: 2 additions & 0 deletions sdk/include/opentelemetry/sdk/resource/resource_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#pragma once

#include <string>

#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/version.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <gtest/gtest.h>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>

#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/sdk/common/attribute_utils.h"
Expand Down
1 change: 1 addition & 0 deletions sdk/test/resource/resource_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <utility>

#include "opentelemetry/nostd/variant.h"
#include "opentelemetry/sdk/common/attribute_utils.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/sdk/resource/resource_detector.h"
#include "opentelemetry/sdk/version/version.h"
Expand Down
Loading