-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
otlpmetric not able to export delta histograms with metric SDK #2868
Comments
Could you provide more information abount variable For example, how are those two variables initialized ? |
@fatsheep9146 you can actually ignore these 2. Full code available here https://github.com/pragmaticivan/otel-pipeline-client-go/blob/main/pipelines/metrics.go I ended up finding a workaround to use something else, but deltas are still not available, and that seems to be a known issue. Some folks created their own selectors or recommended using a collector to convert cumulative data. Which is weird, because a lot of players only accept deltas nowadays. |
I just ran into this too. otResource, err := resource.New(ctx, resource.WithAttributes(keyValues...))
metricClient := otlpmetricgrpc.NewClient()
metricsExporter := otlpmetric.NewUnstarted(metricClient, otlpmetric.WithMetricAggregationTemporalitySelector(aggregation.DeltaTemporalitySelector()))
metricsController := controller.New(
processor.NewFactory(
simple.NewWithHistogramDistribution(),
metricsExporter,
),
controller.WithResource(otResource),
controller.WithExporter(metricsExporter),
controller.WithCollectPeriod(metricsCollectionPeriod),
)
global.SetMeterProvider(metricsController)
metricsExporter.Start(ctx)
metricsController.Start(ctx)
meter := global.Meter("mypackage")
thingHist, err := meter.SyncFloat64().Histogram("thething")
startT := time.Now()
thing()
thingHist.Record(ctx, time.Now().Sub(startT).Seconds()) Gets me lots of these errors: |
@jmacd I saw you did PR #2350 , and I am wondering where it was decided that Open Telemetry histograms wouldn't support delta temporality, and why you made the decision to remove that from this repo describing it as 'no great loss'? Per New Relic's docs, they don't support cumulative https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-best-practices-metrics I've also tried switching to cumulative temporality, but my histogram metrics don't come through (new relic says there are errors), and my sum (counter) metrics all get turned into Gauges, which is not what I want at all. |
I'm not sure how I thought this was caused by histograms. Maybe it was the title of this ticket, after I google searched the type newRelicTemporalitySelector struct{}
func (s newRelicTemporalitySelector) TemporalityFor(desc *sdkapi.Descriptor, kind aggregation.Kind) aggregation.Temporality {
if desc.InstrumentKind() == sdkapi.CounterInstrumentKind ||
desc.InstrumentKind() == sdkapi.HistogramInstrumentKind {
return aggregation.DeltaTemporality
}
return aggregation.CumulativeTemporality
} Consider this resolved for me at least. Not sure about @pragmaticivan |
The SDK should support exporting delta |
Closing, stale. This should be resolved by the new SDK merged in #3175 |
Description
Currently trying to instrument a go app by having multiple data examples for metrics.
One of the examples is a histogram. The vendor (otlp receiver) only accepts deltas for histograms.
Environment
Steps To Reproduce
When using a histogram.
Error: 2022/04/27 17:32:24 error: cumulative to delta not implemented
Expected behavior
It should be able to send OTLP histogram to a remote OTLP API
Note:
I've also tried that with
aggregation.CumulativeTemporalitySelector
but not data gets sent.The text was updated successfully, but these errors were encountered: