You've already forked opentelemetry-go
							
							
				mirror of
				https://github.com/open-telemetry/opentelemetry-go.git
				synced 2025-10-31 00:07:40 +02:00 
			
		
		
		
	Update function docs in sdk.go (#1826)
* Made copy of attribute.KeyValue * Add comments and test * move test to sdk/metric * Update CHANGELOG.md Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> * Add label order assertions for final results * Update CHANGELOG PR number * Revert code changes and update docs Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
		| @@ -282,10 +282,12 @@ func (s *syncInstrument) acquireHandle(kvs []attribute.KeyValue, labelPtr *attri | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // The order of the input array `kvs` may be sorted after the function is called. | ||||
| func (s *syncInstrument) Bind(kvs []attribute.KeyValue) metric.BoundSyncImpl { | ||||
| 	return s.acquireHandle(kvs, nil) | ||||
| } | ||||
|  | ||||
| // The order of the input array `kvs` may be sorted after the function is called. | ||||
| func (s *syncInstrument) RecordOne(ctx context.Context, num number.Number, kvs []attribute.KeyValue) { | ||||
| 	h := s.acquireHandle(kvs, nil) | ||||
| 	defer h.Unbind() | ||||
| @@ -396,6 +398,7 @@ func (m *Accumulator) collectSyncInstruments() int { | ||||
| } | ||||
|  | ||||
| // CollectAsync implements internal.AsyncCollector. | ||||
| // The order of the input array `kvs` may be sorted after the function is called. | ||||
| func (m *Accumulator) CollectAsync(kv []attribute.KeyValue, obs ...metric.Observation) { | ||||
| 	labels := attribute.NewSetWithSortable(kv, &m.asyncSortSlice) | ||||
|  | ||||
| @@ -472,6 +475,7 @@ func (m *Accumulator) checkpointAsync(a *asyncInstrument) int { | ||||
| } | ||||
|  | ||||
| // RecordBatch enters a batch of metric events. | ||||
| // The order of the input array `kvs` may be sorted after the function is called. | ||||
| func (m *Accumulator) RecordBatch(ctx context.Context, kvs []attribute.KeyValue, measurements ...metric.Measurement) { | ||||
| 	// Labels will be computed the first time acquireHandle is | ||||
| 	// called.  Subsequent calls to acquireHandle will re-use the | ||||
|   | ||||
		Reference in New Issue
	
	Block a user