Skip to content

Conversation

@perhapsmaple
Copy link
Contributor

@perhapsmaple perhapsmaple commented Jan 26, 2026

Fixes #3787

Changes

Adds pkg-config support for the following exporters exporters:

  • in-memory exporter
  • ostream exporter
  • otlp exporter
  • elasticsearch exporter
  • prometheus exporter
  • zipkin exporter
  • etw exporter (actually required?)

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.95%. Comparing base (225d4a7) to head (2b387dc).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3829   +/-   ##
=======================================
  Coverage   89.95%   89.95%           
=======================================
  Files         225      225           
  Lines        7170     7170           
=======================================
  Hits         6449     6449           
  Misses        721      721           

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@perhapsmaple perhapsmaple marked this pull request as ready for review January 26, 2026 13:29
@perhapsmaple perhapsmaple requested a review from a team as a code owner January 26, 2026 13:29
@owent
Copy link
Member

owent commented Jan 29, 2026

Could we call opentelemetry_add_pkgconfig() from otel_install_components() so we don’t have to invoke it separately for each component?

@perhapsmaple
Copy link
Contributor Author

@owent I have taken an example with the ostream exporter:

We have 2 components but need 6 pkgconfig files:

Components:

otel_add_component(
  COMPONENT exporters_ostream
  TARGETS
    opentelemetry_exporter_ostream_span      # needs .pc file
    opentelemetry_exporter_ostream_metrics   # needs .pc file
    opentelemetry_exporter_ostream_logs      # needs .pc file
  ...
)
otel_add_component(
  COMPONENT exporters_ostream_builder
  TARGETS
    opentelemetry_exporter_ostream_span_builder     -> needs .pc file
    opentelemetry_exporter_ostream_metrics_builder  -> needs .pc file
    opentelemetry_exporter_ostream_logs_builder     -> needs .pc file
  ...
)

Pkgconfig:

opentelemetry_add_pkgconfig(
  exporter_ostream_span
  "OpenTelemetry Exporter - OStream Span"
  "Exports trace spans to output stream."
  "opentelemetry_trace")  -> Span-specific dependency
opentelemetry_add_pkgconfig(
  exporter_ostream_metrics
  "OpenTelemetry Exporter - OStream Metrics"
  "Exports metrics to output stream."
  "opentelemetry_metrics")  -> Metrics-specific dependency
opentelemetry_add_pkgconfig(
  exporter_ostream_logs
  "OpenTelemetry Exporter - OStream Logs"
  "Exports log records to output stream."
  "opentelemetry_logs")  -> Logs-specific dependency

We would need to specify a description along with dependencies for each target when calling otel_add_component. From my point of view, it's better to not consolidate these functions. What do you think?

@lalitb
Copy link
Member

lalitb commented Jan 30, 2026

Thanks for the PR.

Could you also update ci/verify_packages.sh to validate the new exporter pkgconfig files? Without this, we can't verify the changes are working correctly in CI.
Since not all exporters are built in every CI configuration (depending on flags like WITH_OTLP_GRPC, WITH_PROMETHEUS, etc.), you could use pkg-config --exists to check if the package is present before validating it. This way it validates packages that were built while skipping those not included in the build configuration.

for protocol in grpc http file; do
validate_package "opentelemetry_exporter_otlp_${protocol}"
for variant in client builder log log_builder metrics metric_builder; do
validate_package "opentelemetry_exporter_otlp_${protocol}_${variant}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks for opentelemetry_exporter_otlp_http_metrics but the actual package is opentelemetry_exporter_otlp_http_metric. The script is successful as "--exists" check will filter it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed this by splitting it into two different loops as the grpc library ends with _metrics, but http and file end with _metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exporters are missing opentelemetry_add_pkgconfig instruction

4 participants