Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish wiring exemplars into metrics SDK #3599

Merged
merged 24 commits into from
Sep 24, 2021

Conversation

jsuereth
Copy link
Contributor

@jsuereth jsuereth commented Sep 10, 2021

Finishes wiring the public-facing API of Exemplar sampling into the SDK. After this PR exemplars should begin flowing through the metrics SDK, with configuration exposed to enable/disable. Not all desired customizations are exposed.

  • Remove ExemplarSampler interface pending further spec discussion.
  • Expose ExemplarFilter configuration on the SDK
  • Tie ExemplarReservoir directly to the aggregator.

Follow-on (post SDK public facing API complete)

  • Update metric benchmarks to include heavier "collect"-path tests
  • Better end-to-end testing w/ exemplars (e.g. OTLP exporter)
  • Propose clarifications to SDK specification.
    • Clarify correspondence between "Aggregation" and "Reservoir" creation. Specifically how should customization work here. This PR removes some customization for a cleaner initial implementation/prototype.
    • Clarify when exemplar reservoirs are instantiated/what they are tied to (specifically, 1-reservoir "concept" per metric stream, not per instrument / metric name).

Current benchmark

API_ONLY = no sdk wired
SDK_NO_EXEMPLARS = neverSample() filter on exemplars
SDK = ALL measurements include a sampled trace (worst case scenario)

Benchmark                                                                                            (opBuilder)             (sdk)  Mode  Cnt    Score    Error   Units
MetricsBenchmarks.eightThreadsBound                                                               LongCounterAdd          API_ONLY  avgt   10    1.546 ▒  0.038   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                                LongCounterAdd          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                           LongCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                     LongCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                               LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   17.344 ▒  0.362   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                                LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                           LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                     LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                               LongCounterAdd               SDK  avgt   10   38.268 ▒  0.989   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                                LongCounterAdd               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                           LongCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                     LongCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                             DoubleCounterAdd          API_ONLY  avgt   10    1.528 ▒  0.032   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                              DoubleCounterAdd          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                         DoubleCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                   DoubleCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                             DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   17.533 ▒  0.428   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                              DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                         DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                   DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                             DoubleCounterAdd               SDK  avgt   10   36.637 ▒  0.712   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                              DoubleCounterAdd               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                         DoubleCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                   DoubleCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                        DoubleHistogramRecord          API_ONLY  avgt   10    4.869 ▒  0.046   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                         DoubleHistogramRecord          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                    DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                              DoubleHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                        DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   42.435 ▒  3.172   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                         DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                    DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                              DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                        DoubleHistogramRecord               SDK  avgt   10  105.891 ▒  6.803   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                         DoubleHistogramRecord               SDK  avgt   10    0.002 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                    DoubleHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                              DoubleHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                          LongHistogramRecord          API_ONLY  avgt   10    4.984 ▒  0.417   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                           LongHistogramRecord          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                      LongHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                LongHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                          LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   43.165 ▒  1.037   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                           LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                      LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsBound                                                          LongHistogramRecord               SDK  avgt   10  101.624 ▒  1.448   ns/op
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate                                           LongHistogramRecord               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsBound:╖gc.alloc.rate.norm                                      LongHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsBound:╖gc.count                                                LongHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                      LongCounterAdd          API_ONLY  avgt   10    1.897 ▒  0.049   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                       LongCounterAdd          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                                  LongCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                            LongCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                      LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   42.606 ▒  1.039   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                       LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                                  LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                            LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                      LongCounterAdd               SDK  avgt   10   59.645 ▒  0.881   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                       LongCounterAdd               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                                  LongCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                            LongCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                    DoubleCounterAdd          API_ONLY  avgt   10    1.879 ▒  0.055   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                     DoubleCounterAdd          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                                DoubleCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                          DoubleCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                    DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   40.585 ▒  0.727   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                     DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                                DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                          DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                    DoubleCounterAdd               SDK  avgt   10   70.735 ▒  0.859   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                     DoubleCounterAdd               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                                DoubleCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                          DoubleCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                               DoubleHistogramRecord          API_ONLY  avgt   10    5.029 ▒  0.360   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                DoubleHistogramRecord          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                           DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                     DoubleHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                               DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   76.616 ▒  1.737   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10    0.002 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                           DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                     DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                               DoubleHistogramRecord               SDK  avgt   10  142.144 ▒  1.878   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                DoubleHistogramRecord               SDK  avgt   10    0.002 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                           DoubleHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                     DoubleHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                 LongHistogramRecord          API_ONLY  avgt   10    4.625 ▒  0.406   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                  LongHistogramRecord          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                             LongHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                       LongHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                 LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   66.510 ▒  0.809   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                  LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10    0.002 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                             LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                       LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsCommonLabelSet                                                 LongHistogramRecord               SDK  avgt   10  146.920 ▒  6.775   ns/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate                                  LongHistogramRecord               SDK  avgt   10    0.002 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.alloc.rate.norm                             LongHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsCommonLabelSet:╖gc.count                                       LongHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                                   LongCounterAdd          API_ONLY  avgt   10    2.049 ▒  0.131   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                                    LongCounterAdd          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                               LongCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                         LongCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                                   LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   43.628 ▒  0.695   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                                    LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                               LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                         LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                                   LongCounterAdd               SDK  avgt   10   61.147 ▒  1.098   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                                    LongCounterAdd               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                               LongCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                         LongCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                                 DoubleCounterAdd          API_ONLY  avgt   10    1.976 ▒  0.074   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                                  DoubleCounterAdd          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                             DoubleCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                       DoubleCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                                 DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   41.758 ▒  0.369   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                                  DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                             DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                       DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                                 DoubleCounterAdd               SDK  avgt   10   65.359 ▒  2.840   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                                  DoubleCounterAdd               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                             DoubleCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                       DoubleCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                            DoubleHistogramRecord          API_ONLY  avgt   10    4.934 ▒  0.048   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                             DoubleHistogramRecord          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                        DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                  DoubleHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                            DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   75.984 ▒  1.347   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                             DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                        DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                  DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                            DoubleHistogramRecord               SDK  avgt   10  127.985 ▒  2.864   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                             DoubleHistogramRecord               SDK  avgt   10    0.002 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                        DoubleHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                  DoubleHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                              LongHistogramRecord          API_ONLY  avgt   10    4.528 ▒  0.116   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                               LongHistogramRecord          API_ONLY  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                          LongHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                    LongHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                              LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   68.789 ▒  2.679   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                               LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                          LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                    LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.eightThreadsSeparateLabelSets                                              LongHistogramRecord               SDK  avgt   10  133.267 ▒ 12.236   ns/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate                               LongHistogramRecord               SDK  avgt   10    0.003 ▒  0.001  MB/sec
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.alloc.rate.norm                          LongHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.eightThreadsSeparateLabelSets:╖gc.count                                    LongHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                       LongCounterAdd          API_ONLY  avgt   10    1.255 ▒  0.051   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                        LongCounterAdd          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                                   LongCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                             LongCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                       LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   30.950 ▒  0.972   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                        LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                                   LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                             LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                       LongCounterAdd               SDK  avgt   10   50.153 ▒  2.380   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                        LongCounterAdd               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                                   LongCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                             LongCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                     DoubleCounterAdd          API_ONLY  avgt   10    1.243 ▒  0.051   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                      DoubleCounterAdd          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                                 DoubleCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                           DoubleCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                     DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   32.034 ▒  1.561   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                      DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                                 DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                           DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                     DoubleCounterAdd               SDK  avgt   10   47.275 ▒  1.760   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                      DoubleCounterAdd               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                                 DoubleCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                           DoubleCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                DoubleHistogramRecord          API_ONLY  avgt   10    3.983 ▒  0.181   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                 DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                            DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                      DoubleHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   46.260 ▒  1.722   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                 DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                            DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                      DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                DoubleHistogramRecord               SDK  avgt   10  104.122 ▒  1.578   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                 DoubleHistogramRecord               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                            DoubleHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                      DoubleHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                  LongHistogramRecord          API_ONLY  avgt   10    2.974 ▒  0.079   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                   LongHistogramRecord          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                              LongHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                        LongHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                  LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   46.334 ▒  1.757   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                   LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                              LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                        LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThread                                                                  LongHistogramRecord               SDK  avgt   10  104.901 ▒  5.240   ns/op
MetricsBenchmarks.oneThread:╖gc.alloc.rate                                                   LongHistogramRecord               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThread:╖gc.alloc.rate.norm                                              LongHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThread:╖gc.count                                                        LongHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                                  LongCounterAdd          API_ONLY  avgt   10    0.992 ▒  0.028   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                                   LongCounterAdd          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                              LongCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                        LongCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                                  LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   11.731 ▒  0.196   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                                   LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                              LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                        LongCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                                  LongCounterAdd               SDK  avgt   10   27.601 ▒  0.540   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                                   LongCounterAdd               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                              LongCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                        LongCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                                DoubleCounterAdd          API_ONLY  avgt   10    1.002 ▒  0.036   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                                 DoubleCounterAdd          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                            DoubleCounterAdd          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                      DoubleCounterAdd          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                                DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   12.200 ▒  0.118   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                                 DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                            DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                      DoubleCounterAdd  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                                DoubleCounterAdd               SDK  avgt   10   27.193 ▒  0.746   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                                 DoubleCounterAdd               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                            DoubleCounterAdd               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                      DoubleCounterAdd               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                           DoubleHistogramRecord          API_ONLY  avgt   10    4.038 ▒  0.116   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                            DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                       DoubleHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                 DoubleHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                           DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   30.773 ▒  1.175   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                            DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                       DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                 DoubleHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                           DoubleHistogramRecord               SDK  avgt   10   86.102 ▒  2.944   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                            DoubleHistogramRecord               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                       DoubleHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                 DoubleHistogramRecord               SDK  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                             LongHistogramRecord          API_ONLY  avgt   10    3.321 ▒  0.166   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                              LongHistogramRecord          API_ONLY  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                         LongHistogramRecord          API_ONLY  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                   LongHistogramRecord          API_ONLY  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                             LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   36.118 ▒  1.483   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                              LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                         LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                   LongHistogramRecord  SDK_NO_EXEMPLARS  avgt   10      ? 0           counts
MetricsBenchmarks.oneThreadBound                                                             LongHistogramRecord               SDK  avgt   10   85.517 ▒  3.395   ns/op
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate                                              LongHistogramRecord               SDK  avgt   10   ? 10??           MB/sec
MetricsBenchmarks.oneThreadBound:╖gc.alloc.rate.norm                                         LongHistogramRecord               SDK  avgt   10   ? 10??             B/op
MetricsBenchmarks.oneThreadBound:╖gc.count                                                   LongHistogramRecord               SDK  avgt   10      ? 0           counts

Optimisations included:

  • Reducing to simple object locks
  • fragmenting contention to single-cell-in-reservoir vs. global reservoir lock
  • preallocating memory and writing to mutable cells.

Follow up benchmark work:

  • Look into alternative clock usage to improve performance when recording timestamps.
  • Remove re-allocation of bucket array when creating new metric stream for histogram bucket exemplar reservoir
  • Directly unify exemplar reservoir w/ aggregation-handle implementation (e.g. histograms already lock, just join with it).

Failed optimisations:

  • Attempting to only look up histogram bucket index once for both aggregator + exemplar
  • using CAS vs. simple lock for measurement cells in abstract reservoir

jsuereth and others added 10 commits September 13, 2021 16:49
- Add an implementation of naive fixed-bucket reservoir sampling
- Add an implementation of FixedSizeHistogram reservoir sampling where latest-measurement per-histogram-bucket is kept.
- Add assertions for exemplars.
- Create new random holder abstraction that allows
  - ThreadLocalRandom when efficient
  - simple detection of Android + workaround for TLR
  - Overridable with mocked random for testing.
- Update tracing RandomIdGenerator to leverage new RnadomHolder
- Expand exemplar reservoir tests to use new random holder
- Remove android-only random id generator test
- Expose classes for aggregation configuration that are visible in exemplar sampler
- Create default exemplar sampler that samples w/ traces
- Expand metric benchmarks to include exemplar + no-exemplar to check overhead.
@jsuereth jsuereth force-pushed the wip-exemplar-complete branch from a0126d7 to abb302d Compare September 16, 2021 17:37
jsuereth and others added 4 commits September 16, 2021 14:37
- Expose classes for aggregation configuration that are visible in exemplar sampler
- Create default exemplar sampler that samples w/ traces
- Expand metric benchmarks to include exemplar + no-exemplar to check overhead.
@jsuereth jsuereth force-pushed the wip-exemplar-complete branch from 0f79ce9 to a2f22bb Compare September 17, 2021 12:56
@codecov
Copy link

codecov bot commented Sep 18, 2021

Codecov Report

Merging #3599 (e1d1565) into main (b1e1c47) will increase coverage by 1.30%.
The diff coverage is 69.84%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3599      +/-   ##
============================================
+ Coverage     87.63%   88.94%   +1.30%     
- Complexity     3678     3691      +13     
============================================
  Files           438      442       +4     
  Lines         11707    11562     -145     
  Branches       1128     1113      -15     
============================================
+ Hits          10260    10284      +24     
+ Misses         1078      900     -178     
- Partials        369      378       +9     
Impacted Files Coverage Δ
...emetry/sdk/metrics/exemplar/ExemplarReservoir.java 66.66% <0.00%> (+16.66%) ⬆️
.../opentelemetry/sdk/metrics/view/NoAggregation.java 0.00% <0.00%> (ø)
...k/metrics/internal/aggregator/EmptyAggregator.java 25.00% <25.00%> (ø)
...toconfigure/OpenTelemetrySdkAutoConfiguration.java 82.85% <33.33%> (-17.15%) ⬇️
...sdk/metrics/internal/state/EmptyMetricStorage.java 45.45% <45.45%> (ø)
...rics/internal/state/AsynchronousMetricStorage.java 88.00% <55.55%> (-7.56%) ⬇️
...trics/internal/state/SynchronousMetricStorage.java 77.77% <60.00%> (-8.16%) ⬇️
...telemetry/sdk/metrics/view/DefaultAggregation.java 66.66% <66.66%> (ø)
...io/opentelemetry/sdk/metrics/view/Aggregation.java 70.00% <70.00%> (-2.42%) ⬇️
...lemetry/sdk/metrics/view/LastValueAggregation.java 75.00% <75.00%> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1e1c47...e1d1565. Read the comment docs.

@jsuereth jsuereth marked this pull request as ready for review September 18, 2021 15:51
@jsuereth jsuereth requested a review from a user September 18, 2021 15:51
@jsuereth jsuereth requested a review from Oberon00 as a code owner September 18, 2021 15:51

| System property | Environment variable | Description |
|--------------------------|--------------------------|-----------------------------------------------------------------------------------|
| otel.metrics.exemplar.filter | OTEL_METRICS_EXEMPLAR_FILTER | The filter for exemplar sampling. Can be `NONE`, `ALL` or `WITH_SAMPLED_TRACE`. Default is `WITH_SAMPLED_TRACE`.|
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR since we're correctly reflecting the spec, but all of our other enum-type SDK config uses lowercase, not uppercase, would be nice if it can be fixed @jsuereth I don't know if we have time before the release though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a reasonable thing to fix. If all other spec uses lower case, that's an easy bugfix. We're only in feature-freeze right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's ok, I'll fix this in a follow up PR once this is submitted.

@@ -23,4 +23,6 @@ dependencies {
testImplementation(project(":sdk:metrics-testing"))
testImplementation(project(":sdk:testing"))
testImplementation("com.google.guava:guava")

jmh(project(":sdk:trace"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be better to put the benchmarks in sdk:all if possible this looks like an unexpected coupling of the SDK projects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

JMH for trace also uses metrics sdk right now: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/build.gradle.kts#L37

This is in-line with our status-quo, but if you want to change that, I'd suggest outside this PR and we do it consistently.

@@ -42,9 +42,9 @@
private final MeterProviderSharedState sharedState;

SdkMeterProvider(
Clock clock, Resource resource, ViewRegistry viewRegistry, ExemplarSampler exemplarSampler) {
Clock clock, Resource resource, ViewRegistry viewRegistry, ExemplarFilter exemplarFilter) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, I like Filter a lot better since we apply reservoir sampling after it anyways. Perhaps it allows renaming what we have as ExemplarReservoir to ExemplarFilter :-D

@@ -99,8 +136,8 @@ public static Aggregation explictBucketHistogram() {
*
* @param temporality Whether to report DELTA or CUMULATIVE metrics.
*/
public static Aggregation explictBucketHistogram(AggregationTemporality temporality) {
return explictBucketHistogram(
public static Aggregation explicitBucketHistogram(AggregationTemporality temporality) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need all of these options out of the box for v1? Could we limit the number of options we expose a bit more to start with? I see 4 methods for creating explicit bucket histograms which seems a tad excessive to start with.

eg. histogram() and explicitBucketHistogram() are the same thing. Seems like we don't necessarily need both of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

histogram is specified as "the best possible histogram" and is allowed to change for the exponential in the future.

Regarding explicit bucket, I was matching the optional parameters of the spec.

Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

I would like to see the classloading deadlock issues cleared up before merging. Thanks!

@jkwatson jkwatson self-requested a review September 22, 2021 16:09
@jkwatson jkwatson merged commit 95551db into open-telemetry:main Sep 24, 2021
@jsuereth jsuereth deleted the wip-exemplar-complete branch September 24, 2021 21:11
This was referenced Dec 19, 2021
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.

3 participants