This repository was archived by the owner on Jul 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
exporters/trace/stackdriver Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # OpenCensus C++ Common library.
2+ # See ../../README.md for details.
3+ #
4+ # Copyright 2018, OpenCensus Authors
5+ #
6+ # Licensed under the Apache License, Version 2.0 (the "License");
7+ # you may not use this file except in compliance with the License.
8+ # You may obtain a copy of the License at
9+ #
10+ # http://www.apache.org/licenses/LICENSE-2.0
11+ #
12+ # Unless required by applicable law or agreed to in writing, software
13+ # distributed under the License is distributed on an "AS IS" BASIS,
14+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ # See the License for the specific language governing permissions and
16+ # limitations under the License.
17+
18+ load ("//opencensus:copts.bzl" , "DEFAULT_COPTS" , "TEST_COPTS" )
19+
20+ licenses (["notice" ]) # Apache 2.0
21+
22+ package (default_visibility = ["//opencensus:__subpackages__" ])
23+
24+ cc_library (
25+ name = "version" ,
26+ hdrs = ["version.h" ],
27+ copts = DEFAULT_COPTS ,
28+ )
Original file line number Diff line number Diff line change 1+ // Copyright 2018, OpenCensus Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ #ifndef OPENCENSUS_COMMON_VERSION_H_
16+ #define OPENCENSUS_COMMON_VERSION_H_
17+
18+ // The current version of the opencensus core library. Macro to allow literal
19+ // string concatenation in constexpr statements.
20+ #define OPENCENSUS_VERSION "0.3.0-dev"
21+
22+ #endif // OPENCENSUS_COMMON_VERSION_H_
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ cc_library(
2929 visibility = ["//visibility:public" ],
3030 deps = [
3131 "//google/devtools/cloudtrace/v2:tracing_proto" ,
32+ "//opencensus/common:version" ,
3233 "//opencensus/common/internal/grpc:status" ,
3334 "//opencensus/trace" ,
3435 "@com_github_grpc_grpc//:grpc++" ,
Original file line number Diff line number Diff line change 2424#include " absl/time/clock.h"
2525#include " google/devtools/cloudtrace/v2/tracing.grpc.pb.h"
2626#include " opencensus/common/internal/grpc/status.h"
27+ #include " opencensus/common/version.h"
2728#include " opencensus/trace/exporter/span_data.h"
2829#include " opencensus/trace/exporter/span_exporter.h"
2930
@@ -38,7 +39,7 @@ constexpr size_t kDisplayNameStringLen = 128;
3839constexpr char kGoogleStackdriverTraceAddress [] = " cloudtrace.googleapis.com" ;
3940
4041constexpr char kAgentKey [] = " g.co/agent" ;
41- constexpr char kAgentValue [] = " opencensus-cpp" ;
42+ constexpr char kAgentValue [] = " opencensus-cpp [ " OPENCENSUS_VERSION " ] " ;
4243
4344bool Validate (const google::protobuf::Timestamp& t) {
4445 const auto sec = t.seconds ();
You can’t perform that action at this time.
0 commit comments