Skip to content

[BUILD] Build break when using OTLP HTTP Metrics exporter #2169

@marcalff

Description

@marcalff

In an application, include file
opentelemetry/exporters/otlp/otlp_http_metric_exporter.h,
to see class OtlpHttpMetricExporter

File opentelemetry/exporters/otlp/otlp_metric_utils.h is included in the build.

The build fails:

fatal error: 'opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h' file not found

because protobuf generated files are not installed with opentelemetry headers.

There are two issues here.

opentelemetry-cpp should expose Factory::Create() methods to build instances of OtlpHttpMetricExporter, per issue #1485, so that users don't need to see OtlpHttpMetricExporter directly.

Because the factory is not available, the work around is to instantiate OtlpHttpMetricExporter instead, which leads to:

The class definition in otlp_http_metric_exporter.h should not need to see protobuf generated code, this is an implementation dependency.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions