summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/exporters/jaeger/BUILD
blob: cc1babae069ce24f4f684dbe3d87ff7e9a0aaf9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package(default_visibility = ["//visibility:public"])

load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake", "configure_make", "configure_make_variant")

constraint_setting(
    name = "incompatible_setting",
)

constraint_value(
    name = "incompatible",
    constraint_setting = ":incompatible_setting",
)

config_setting(
    name = "windows",
    constraint_values = [
        "@bazel_tools//platforms:windows",
    ],
    tags = ["jaeger"],
    visibility = ["//visibility:private"],
)

THRIFT_CACHE_ENTRIES = {
    "CMAKE_BUILD_TYPE": "Release",
    "BUILD_COMPILER": "OFF",
    "BUILD_CPP": "ON",
    "BUILD_LIBRARIES": "ON",
    "BUILD_NODEJS": "OFF",
    "BUILD_PYTHON": "OFF",
    "BUILD_JAVASCRIPT": "OFF",
    "BUILD_C_GLIB": "OFF",
    "BUILD_JAVA": "OFF",
    "BUILD_TESTING": "OFF",
    "BUILD_TUTORIALS": "OFF",
    "WITH_HASKELL": "OFF",
}

THRIFT_CACHE_ENTRIES_WIN = {
    "CMAKE_BUILD_TYPE": "Release",
    "BUILD_COMPILER": "OFF",
    "BUILD_CPP": "ON",
    "BUILD_LIBRARIES": "ON",
    "BUILD_NODEJS": "OFF",
    "BUILD_PYTHON": "OFF",
    "BUILD_JAVASCRIPT": "OFF",
    "BUILD_C_GLIB": "OFF",
    "BUILD_JAVA": "OFF",
    "BUILD_TESTING": "OFF",
    "BUILD_TUTORIALS": "OFF",
    "WITH_HASKELL": "OFF",
    "WITH_STDTHREADS": "ON",
    "WITH_BOOSTTHREADS": "OFF",
    "WITH_BOOST_FUNCTIONAL": "OFF",
    "WITH_BOOST_SMART_PTR": "OFF",
    "BUILD_SHARED_LIBS": "OFF",
    "CMAKE_TOOLCHAIN_FILE": "$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake",
}

cmake(
    name = "thrift",
    cache_entries = select({
        "@bazel_tools//platforms:osx": THRIFT_CACHE_ENTRIES,
        "@bazel_tools//platforms:linux": THRIFT_CACHE_ENTRIES,
        "@bazel_tools//platforms:windows": THRIFT_CACHE_ENTRIES_WIN,
    }),
    copts = [
        "-Ilibs/exporters/jaeger/openssl/include",
        "-fexceptions",
    ],
    generate_args = select({
        "@bazel_tools//platforms:osx": [],
        "@bazel_tools//platforms:linux": [],
        "@bazel_tools//platforms:windows": [
            "-G \"NMake Makefiles\"",
        ],
    }),
    install = True,
    lib_source = "@com_github_thrift//:all_srcs",
    out_lib_dir = select({
        "@bazel_tools//platforms:osx": "lib",
        "@bazel_tools//platforms:linux": "lib",
        "@bazel_tools//platforms:windows": "bin",
    }),
    out_static_libs = select({
        "@bazel_tools//platforms:osx": [
            "libthrift.a",
            "libthriftz.a",
        ],
        "@bazel_tools//platforms:linux": [
            "libthrift.a",
            "libthriftz.a",
        ],
        "@bazel_tools//platforms:windows": [
            "thriftmd.lib",
        ],
    }),
    tags = ["jaeger"],
    visibility = ["//visibility:private"],
    deps = [],
)

THRIFT_GEN_DEPS = [
    ":thrift",
    "//ext/src/http/client/curl:http_client_curl",
]

THRIFT_GEN_DEPS_WIN = THRIFT_GEN_DEPS + [
    "@boost_all_hdrs//:boost_all_hdrs",
]

cc_library(
    name = "jaeger_thrift_gencpp",
    srcs = [
        "thrift-gen/Agent.cpp",
        "thrift-gen/Collector.cpp",
        "thrift-gen/ZipkinCollector.cpp",
        "thrift-gen/jaeger_types.cpp",
        "thrift-gen/zipkincore_constants.cpp",
        "thrift-gen/zipkincore_types.cpp",
    ],
    hdrs = [
        "thrift-gen/Agent.h",
        "thrift-gen/Collector.h",
        "thrift-gen/ZipkinCollector.h",
        "thrift-gen/agent_types.h",
        "thrift-gen/jaeger_types.h",
        "thrift-gen/zipkincore_constants.h",
        "thrift-gen/zipkincore_types.h",
    ],
    copts = [
        "-fexceptions",
    ],
    strip_include_prefix = "thrift-gen",
    tags = ["jaeger"],
    deps = select({
        "@bazel_tools//platforms:osx": THRIFT_GEN_DEPS,
        "@bazel_tools//platforms:linux": THRIFT_GEN_DEPS,
        "@bazel_tools//platforms:windows": THRIFT_GEN_DEPS_WIN,
    }),
)

cc_library(
    name = "jaeger_exporter",
    srcs = [
    ],
    hdrs = [
        "src/THttpTransport.h",
        "src/TUDPTransport.h",
        "src/http_transport.h",
        "src/sender.h",
        "src/thrift_sender.h",
        "src/transport.h",
        "src/udp_transport.h",
    ],
    copts = ["-fexceptions"],
    strip_include_prefix = "src",
    tags = ["jaeger"],
    deps = [
        ":jaeger_thrift_gencpp",
    ],
)

cc_library(
    name = "opentelemetry_exporter_jaeger_trace",
    srcs = [
        "src/THttpTransport.cc",
        "src/TUDPTransport.cc",
        "src/http_transport.cc",
        "src/jaeger_exporter.cc",
        "src/recordable.cc",
        "src/thrift_sender.cc",
        "src/udp_transport.cc",
    ],
    hdrs = [
        "include/opentelemetry/exporters/jaeger/jaeger_exporter.h",
        "include/opentelemetry/exporters/jaeger/recordable.h",
    ],
    copts = ["-fexceptions"],
    strip_include_prefix = "include",
    tags = ["jaeger"],
    deps = [
        ":jaeger_exporter",
        "//sdk/src/common:global_log_handler",
    ],
)

cc_test(
    name = "jaeger_recordable_test",
    srcs = ["test/jaeger_recordable_test.cc"],
    copts = ["-fexceptions"],
    tags = [
        "jaeger",
        "test",
    ],
    deps = [
        ":opentelemetry_exporter_jaeger_trace",
        "//sdk/src/resource",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "jaeger_exporter_test",
    srcs = ["test/jaeger_exporter_test.cc"],
    copts = ["-fexceptions"],
    defines = ["BAZEL_BUILD"],
    tags = [
        "jaeger",
        "test",
    ],
    deps = [
        ":opentelemetry_exporter_jaeger_trace",
        "//sdk/src/resource",
        "//sdk/src/trace",
        "@com_google_googletest//:gtest_main",
    ],
)