open-telemetry / open-telemetry/opentelemetry-cpp-contrib
Opentelemetry Geneva Log + Metrics exporters conflict on Linux (redefinition of net::Thread)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 153
- Forks
- 184
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 26
Description
Bug Description
When enabling both Geneva logging and metrics exporters in the same binary on Linux, compilation fails due to a type redefinition.
Including both:
#include "opentelemetry/exporters/geneva/geneva_logger_exporter.h"
#include "opentelemetry/exporters/geneva/metrics/exporter.h"
causes a conflict between two internal headers that define the same type:
namespace net {
struct Thread { ... };
}
💥 Build Error
error: redefinition of ‘struct net::Thread’
Include chain (simplified)
Metrics exporter:
geneva/metrics/exporter.h
-> geneva/metrics/socket_tools.h
-> defines net::Thread
Logger exporter:
geneva/geneva_logger_exporter.h
-> fluentd/common/socket_tools.h
-> defines net::Thread
Compiler output:
.../geneva/metrics/socket_tools.h:119:8:
error: redefinition of ‘struct net::Thread’
.../fluentd/common/socket_tools.h:116:8:
note: previous definition of ‘struct net::Thread’
🧩 Environment
OS: Linux (ARM64)
Toolchain: GCC (CI build)
Installation: vcpkg
OpenTelemetry C++
Geneva exporters enabled for both logs and metrics
🧠 Observations
This appears to be an ODR violation caused by two different internal headers defining the same type in the same namespace.
The issue occurs even with different include orders.
Header include guards do not prevent the conflict because the files are different.
The problem reproduces consistently on Linux.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Linux build with both opentelemetry/exporters/geneva/geneva_logger_exporter.h and opentelemetry/exporters/geneva/metrics/exporter.h included. Inspect the net::Thread definitions in geneva/metrics/socket_tools.h and fluentd/common/socket_tools.h and their include paths. Done means a binary enabling both Geneva log and metrics exporters compiles without the redefinition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100