Add --enable-otlp configure flag and 'otlp' debian build profile#1183
Draft
yutongzhang-microsoft wants to merge 1 commit into
Draft
Add --enable-otlp configure flag and 'otlp' debian build profile#1183yutongzhang-microsoft wants to merge 1 commit into
yutongzhang-microsoft wants to merge 1 commit into
Conversation
Wire the build system to optionally pull in opentelemetry-cpp so a follow-up
PR can add an OTLP sink to ComponentStats. The default build is unchanged:
* configure.ac gains a new --enable-otlp option (default: disabled).
When enabled, the build probes for opentelemetry-cpp via pkg-config and
falls back to a header check + a hard-coded -l<lib> list for SDKs that
are not packaged with .pc files. HAVE_OTLP is defined and OTLP is
exposed as an automake conditional, plus OPENTELEMETRY_CFLAGS /
OPENTELEMETRY_LIBS substitutions for use by Makefile.am in later PRs.
* debian/rules gains a new 'otlp' build profile. When the profile is
active, --enable-otlp is passed to configure; otherwise --disable-otlp
is passed, which is the current behaviour.
This is the build-system half of Phase 2 in the Component Statistics HLD
(sonic-net/SONiC#2312). It does not add any source files, does not change
the public API, and does not affect any default build path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR is the build-system half of Phase 2 in the Component Statistics HLD (sonic-net/SONiC#2312).
Phase 1 (#1180 here plus sonic-net/sonic-swss#4516) publishes service-level counters to
COUNTERS_DB. Phase 2 will additionally export the same counters via OTLP/gRPC to a local OpenTelemetry Collector.The OTLP sink depends on
opentelemetry-cpp, which is not yet packaged in every SONiC build environment. To unblock the follow-up PRs that introduce the actual sink (OtlpSinkwrapper +ComponentStatsfan-out), this PR wires up the configure machinery first, behind an opt-in flag.What
configure.ac--enable-otlpoption (default: disabled).PKG_CHECK_MODULESprobe foropentelemetry_api/opentelemetry_sdk/opentelemetry_exporter_otlp_grpc.opentelemetry/version.h) + hard-coded-l<lib>list for SDKs that do not ship.pcfiles.HAVE_OTLP,AM_CONDITIONAL OTLP, and substitutesOPENTELEMETRY_CFLAGS/OPENTELEMETRY_LIBSfor use byMakefile.amin follow-up PRs.debian/rulesotlpbuild profile; activates--enable-otlpwhen present,--disable-otlpotherwise (mirrors the existingnoyangmodpattern).What this PR does NOT do
opentelemetry-cppto be installed unless someone passes--enable-otlp(or builds withDEB_BUILD_PROFILES=otlp).How to verify
Follow-ups
OtlpSinkwrapper + unit tests (independent of this PR).OtlpSinkto theComponentStatswriter-thread fan-out (depends on Add reusable ComponentStats library for per-container statistics. #1180 + this PR + PR B).