opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

Cannot create PushController for metrics with an http exporter instead of a grpc one

Open bnjjj opened this issue 3 years ago • 3 comments

With opentelemtry-oltp for now we can't create a PushController with an http exporter. Here is the version I have for GRPC:

let push_ctrl = opentelemetry_otlp::new_pipeline()
                    .metrics(tokio::spawn, delayed_interval)
                    .with_exporter(
                        opentelemetry_otlp::new_exporter()
                            .tonic()
                            .with_export_config(export_config),
                    )
                    .with_aggregator_selector(selectors::simple::Selector::Exact)
                    .build()?;

Here is the version I would like for the http but it doesn't work for now. (Mainly because MetricsExporter::new takes a TonicConfig and then we can't create a MetricsExporter with something else than a Grpc mode.

let push_ctrl = opentelemetry_otlp::new_pipeline()
                    .metrics(tokio::spawn, delayed_interval)
                    .with_exporter(
                        opentelemetry_otlp::new_exporter()
                            .http()
                            .with_export_config(export_config),
                    )
                    .with_aggregator_selector(selectors::simple::Selector::Exact)
                    .build()?;

bnjjj avatar Apr 04 '22 15:04 bnjjj

Currently, we only have tonic based implementation for metrics exporters. http-proto support will be added later

TommyCpp avatar Apr 05 '22 03:04 TommyCpp

Hi, thx for working on this issue! After #1020 has been merged, does this mean that this issue here could be closed? Or are there still things to do in order to achieve full support for HTTP metric export? :)

MatthiasJReisinger avatar Jul 19 '23 11:07 MatthiasJReisinger

Hi, thx for working on this issue! After #1020 has been merged, does this mean that this issue here could be closed? Or are there still things to do in order to achieve full support for HTTP metric export? :)

I think this can be closed now.

cijothomas avatar Feb 22 '24 04:02 cijothomas