Skip to content
Open
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
29 changes: 20 additions & 9 deletions google/cloud/bigtable/internal/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,9 @@
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_METRICS_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_METRICS_H

#ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS

#include "google/cloud/bigtable/internal/operation_context.h"
#include "google/cloud/bigtable/version.h"
#include "google/cloud/status.h"
#include <grpcpp/grpcpp.h>
#include <opentelemetry/context/context.h>
#include <chrono>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>

namespace google {
namespace cloud {
Expand Down Expand Up @@ -55,6 +46,26 @@ struct StubSelectionParams {
RpcType streaming;
};

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace bigtable_internal
} // namespace cloud
} // namespace google

#ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS

#include "google/cloud/status.h"
#include <grpcpp/grpcpp.h>
#include <opentelemetry/context/context.h>
#include <chrono>
#include <memory>
#include <string>
#include <vector>

namespace google {
namespace cloud {
namespace bigtable_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

struct PreCallParams {
OperationContext::Clock::time_point attempt_start;
bool first_attempt;
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigtable/internal/operation_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void OperationContext::ElementDelivery(grpc::ClientContext const&) {
OperationContext::OperationContext(std::vector<std::shared_ptr<Metric>>,
std::shared_ptr<Clock>) {}

void OperationContext::StubSelection(StubSelectionParams const&) {}
Comment thread
colinmoy marked this conversation as resolved.

void OperationContext::PreCall(grpc::ClientContext& client_context) {
for (auto const& [key, value] : cookies_) {
client_context.AddMetadata(key, value);
Expand Down
Loading