Skip to content

CreateDoubleHistogram with no buckets #3222

Answered by malkia
ashley-b asked this question in Q&A
Discussion options

You must be logged in to vote

You can add a view, for example:

  {
      using namespace opentelemetry::sdk::metrics;
      auto aggr_conf = std::make_unique<HistogramAggregationConfig>();  
      aggr_conf->boundaries_ = std::vector<double>{0.0f};
      aggr_conf->record_min_max_ = false;
      provider->AddView(
        InstrumentSelectorFactory::Create(InstrumentType::kHistogram, "*", ""), 
        MeterSelectorFactory::Create("", "", ""),
        ViewFactory::Create( "", "", "", AggregationType::kHistogram, std::move( aggr_conf ) )
      );
  }

This creates only two buckets - 0.0, and inf+

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ashley-b
Comment options

Answer selected by ashley-b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants