mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-10-28 10:45:18 +08:00
[chore]: fix article and word typos in doc comments (#8972)
A sweep of doc-comment typos on exported (and internal production) APIs: - `trace/tracestate.go:286`: "more members **then** is allowed" → "than" - `codes/codes.go:35` and 6 sibling sites (`metric/meter.go`, `sdk/metric/exemplar/value.go`, `sdk/metric/aggregation.go` ×2, `sdk/metric/metricdata/data.go`, `sdk/metric/view.go`, `sdk/trace/snapshot.go`): "an 32-bit/token/float64/histogram/slice/Stream/record" → "a …" - `trace/internal/telemetry/value.go:330`: "a slog.Kind is is not handled" → "is not handled" Comment-only, no code or API change — hence the `[chore]` title instead of a changelog entry. Every replacement verified with grep (word-boundary) against the tree. Assisted-By: GLM (ZCode agent), per the OTel Generative AI contribution policy; human-reviewed. Co-authored-by: Robert Pająk <pellared@hotmail.com> Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
9 files changed
+11
-11
No files matched your search
+1
-1
@@ -32,7 +32,7 @@ const (
|
||||
maxCode = 3
|
||||
)
|
||||
|
||||
// Code is an 32-bit representation of a status state.
|
||||
// Code is a 32-bit representation of a status state.
|
||||
type Code uint32
|
||||
|
||||
var codeToStr = map[Code]string{
|
||||
|
||||
+1
-1
@@ -320,7 +320,7 @@ type Observer interface {
|
||||
ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption)
|
||||
}
|
||||
|
||||
// Registration is an token representing the unique registration of a callback
|
||||
// Registration is a token representing the unique registration of a callback
|
||||
// for a set of instruments with a Meter.
|
||||
//
|
||||
// Warning: Methods may be added to this interface in minor releases. See
|
||||
|
||||
@@ -79,7 +79,7 @@ func (l AggregationLastValue) copy() Aggregation { return l }
|
||||
func (AggregationLastValue) err() error { return nil }
|
||||
|
||||
// AggregationExplicitBucketHistogram is an Aggregation that summarizes a set of
|
||||
// measurements as an histogram with explicitly defined buckets.
|
||||
// measurements as a histogram with explicitly defined buckets.
|
||||
type AggregationExplicitBucketHistogram struct {
|
||||
// Boundaries are the increasing bucket boundary values. Boundary values
|
||||
// define bucket upper bounds. Buckets are exclusive of their lower
|
||||
@@ -138,7 +138,7 @@ func (h AggregationExplicitBucketHistogram) copy() Aggregation {
|
||||
}
|
||||
|
||||
// AggregationBase2ExponentialHistogram is an Aggregation that summarizes a set of
|
||||
// measurements as an histogram with bucket widths that grow exponentially.
|
||||
// measurements as a histogram with bucket widths that grow exponentially.
|
||||
type AggregationBase2ExponentialHistogram struct {
|
||||
// MaxSize is the maximum number of buckets to use for the histogram.
|
||||
MaxSize int32
|
||||
|
||||
@@ -49,8 +49,8 @@ func (v Value) Int64() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Float64 returns the value of v as an float64. If the ValueType of v is not
|
||||
// an Float64ValueType, 0 is returned.
|
||||
// Float64 returns the value of v as a float64. If the ValueType of v is not
|
||||
// a Float64ValueType, 0 is returned.
|
||||
func (v Value) Float64() float64 {
|
||||
if v.t == Float64ValueType {
|
||||
return math.Float64frombits(v.val)
|
||||
|
||||
@@ -190,7 +190,7 @@ type ExponentialHistogramDataPoint[N int64 | float64] struct {
|
||||
type ExponentialBucket struct {
|
||||
// Offset is the bucket index of the first entry in the Counts slice.
|
||||
Offset int32
|
||||
// Counts is an slice where Counts[i] carries the count of the bucket at
|
||||
// Counts is a slice where Counts[i] carries the count of the bucket at
|
||||
// index (Offset+i). Counts[i] is the count of values greater than
|
||||
// base^(Offset+i) and less than or equal to base^(Offset+i+1).
|
||||
Counts []uint64
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ type View func(Instrument) (Stream, bool)
|
||||
// the Instrument the View matches against will be use for the Name,
|
||||
// Description, and Unit of the returned Stream and no Aggregation or
|
||||
// AttributeFilter are set. All non-zero-value fields of mask are used instead
|
||||
// of the default. If you need to zero out an Stream field returned from a
|
||||
// of the default. If you need to zero out a Stream field returned from a
|
||||
// View, create a View directly.
|
||||
func NewView(criteria Instrument, mask Stream) View {
|
||||
if criteria.IsEmpty() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// snapshot is an record of a spans state at a particular checkpointed time.
|
||||
// snapshot is a record of a span's state at a particular checkpointed time.
|
||||
// It is used as a read-only representation of that state.
|
||||
type snapshot struct {
|
||||
name string
|
||||
|
||||
@@ -327,7 +327,7 @@ func (v Value) String() string {
|
||||
// Try to handle this as gracefully as possible.
|
||||
//
|
||||
// Don't panic here. The goal here is to have developers find this
|
||||
// first if a slog.Kind is is not handled. It is
|
||||
// first if a slog.Kind is not handled. It is
|
||||
// preferable to have user's open issue asking why their attributes
|
||||
// have a "unhandled: " prefix than say that their code is panicking.
|
||||
return fmt.Sprintf("<unhandled telemetry.ValueKind: %s>", v.Kind())
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@ func (ts TraceState) Walk(f func(key, value string) bool) {
|
||||
// specification an error is returned with the original TraceState.
|
||||
//
|
||||
// If adding a new list-member means the TraceState would have more members
|
||||
// then is allowed, the new list-member will be inserted and the right-most
|
||||
// than is allowed, the new list-member will be inserted and the right-most
|
||||
// list-member will be dropped in the returned TraceState.
|
||||
func (ts TraceState) Insert(key, value string) (TraceState, error) {
|
||||
m, err := newMember(key, value)
|
||||
|
||||
Reference in new issue
Block a user