Debian Codegraph @

semconv/v1.32.0/messagingconv/metric.go

raw
1 // Code generated from semantic convention specification. DO NOT EDIT.
2
3 // Copyright The OpenTelemetry Authors
4 // SPDX-License-Identifier: Apache-2.0
5
6 // Package messagingconv provides types and functionality for OpenTelemetry semantic
7 // conventions in the "messaging" namespace.
8 package messagingconv
9
10 import (
11 "context"
12 "sync"
13
14 "go.opentelemetry.io/otel/attribute"
15 "go.opentelemetry.io/otel/metric"
16 "go.opentelemetry.io/otel/metric/noop"
17 )
18
19 var (
20 addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }}
21 recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }}
22 )
23
24 // ErrorTypeAttr is an attribute conforming to the error.type semantic
25 // conventions. It represents the describes a class of error the operation ended
26 // with.
27 type ErrorTypeAttr string
28
29 var (
30 // ErrorTypeOther is a fallback error value to be used when the instrumentation
31 // doesn't define a custom value.
32 ErrorTypeOther ErrorTypeAttr = "_OTHER"
33 )
34
35 // OperationTypeAttr is an attribute conforming to the messaging.operation.type
36 // semantic conventions. It represents a string identifying the type of the
37 // messaging operation.
38 type OperationTypeAttr string
39
40 var (
41 // OperationTypeCreate is a message is created. "Create" spans always refer to a
42 // single message and are used to provide a unique creation context for messages
43 // in batch sending scenarios.
44 OperationTypeCreate OperationTypeAttr = "create"
45 // OperationTypeSend is the one or more messages are provided for sending to an
46 // intermediary. If a single message is sent, the context of the "Send" span can
47 // be used as the creation context and no "Create" span needs to be created.
48 OperationTypeSend OperationTypeAttr = "send"
49 // OperationTypeReceive is the one or more messages are requested by a consumer.
50 // This operation refers to pull-based scenarios, where consumers explicitly
51 // call methods of messaging SDKs to receive messages.
52 OperationTypeReceive OperationTypeAttr = "receive"
53 // OperationTypeProcess is the one or more messages are processed by a consumer.
54 OperationTypeProcess OperationTypeAttr = "process"
55 // OperationTypeSettle is the one or more messages are settled.
56 OperationTypeSettle OperationTypeAttr = "settle"
57 )
58
59 // SystemAttr is an attribute conforming to the messaging.system semantic
60 // conventions. It represents the messaging system as identified by the client
61 // instrumentation.
62 type SystemAttr string
63
64 var (
65 // SystemActiveMQ is the apache ActiveMQ.
66 SystemActiveMQ SystemAttr = "activemq"
67 // SystemAWSSQS is the amazon Simple Queue Service (SQS).
68 SystemAWSSQS SystemAttr = "aws_sqs"
69 // SystemEventGrid is the azure Event Grid.
70 SystemEventGrid SystemAttr = "eventgrid"
71 // SystemEventHubs is the azure Event Hubs.
72 SystemEventHubs SystemAttr = "eventhubs"
73 // SystemServiceBus is the azure Service Bus.
74 SystemServiceBus SystemAttr = "servicebus"
75 // SystemGCPPubSub is the google Cloud Pub/Sub.
76 SystemGCPPubSub SystemAttr = "gcp_pubsub"
77 // SystemJMS is the java Message Service.
78 SystemJMS SystemAttr = "jms"
79 // SystemKafka is the apache Kafka.
80 SystemKafka SystemAttr = "kafka"
81 // SystemRabbitMQ is the rabbitMQ.
82 SystemRabbitMQ SystemAttr = "rabbitmq"
83 // SystemRocketMQ is the apache RocketMQ.
84 SystemRocketMQ SystemAttr = "rocketmq"
85 // SystemPulsar is the apache Pulsar.
86 SystemPulsar SystemAttr = "pulsar"
87 )
88
89 // ClientConsumedMessages is an instrument used to record metric values
90 // conforming to the "messaging.client.consumed.messages" semantic conventions.
91 // It represents the number of messages that were delivered to the application.
92 type ClientConsumedMessages struct {
93 metric.Int64Counter
94 }
95
96 // NewClientConsumedMessages returns a new ClientConsumedMessages instrument.
97 func NewClientConsumedMessages(
98 m metric.Meter,
99 opt ...metric.Int64CounterOption,
100 ) (ClientConsumedMessages, error) {
101 // Check if the meter is nil.
102 if m == nil {
103 return ClientConsumedMessages{noop.Int64Counter{}}, nil
104 }
105
106 i, err := m.Int64Counter(
107 "messaging.client.consumed.messages",
108 append([]metric.Int64CounterOption{
109 metric.WithDescription("Number of messages that were delivered to the application."),
110 metric.WithUnit("{message}"),
111 }, opt...)...,
112 )
113 if err != nil {
114 return ClientConsumedMessages{noop.Int64Counter{}}, err
115 }
116 return ClientConsumedMessages{i}, nil
117 }
118
119 // Inst returns the underlying metric instrument.
120 func (m ClientConsumedMessages) Inst() metric.Int64Counter {
121 return m.Int64Counter
122 }
123
124 // Name returns the semantic convention name of the instrument.
125 func (ClientConsumedMessages) Name() string {
126 return "messaging.client.consumed.messages"
127 }
128
129 // Unit returns the semantic convention unit of the instrument
130 func (ClientConsumedMessages) Unit() string {
131 return "{message}"
132 }
133
134 // Description returns the semantic convention description of the instrument
135 func (ClientConsumedMessages) Description() string {
136 return "Number of messages that were delivered to the application."
137 }
138
139 // Add adds incr to the existing count.
140 //
141 // The operationName is the the system-specific name of the messaging operation.
142 //
143 // The system is the the messaging system as identified by the client
144 // instrumentation.
145 //
146 // All additional attrs passed are included in the recorded value.
147 //
148 // Records the number of messages pulled from the broker or number of messages
149 // dispatched to the application in push-based scenarios.
150 // The metric SHOULD be reported once per message delivery. For example, if
151 // receiving and processing operations are both instrumented for a single message
152 // delivery, this counter is incremented when the message is received and not
153 // reported when it is processed.
154 func (m ClientConsumedMessages) Add(
155 ctx context.Context,
156 incr int64,
157 operationName string,
158 system SystemAttr,
159 attrs ...attribute.KeyValue,
160 ) {
161 o := addOptPool.Get().(*[]metric.AddOption)
162 defer func() {
163 *o = (*o)[:0]
164 addOptPool.Put(o)
165 }()
166
167 *o = append(
168 *o,
169 metric.WithAttributes(
170 append(
171 attrs,
172 attribute.String("messaging.operation.name", operationName),
173 attribute.String("messaging.system", string(system)),
174 )...,
175 ),
176 )
177
178 m.Int64Counter.Add(ctx, incr, *o...)
179 }
180
181 // AttrErrorType returns an optional attribute for the "error.type" semantic
182 // convention. It represents the describes a class of error the operation ended
183 // with.
184 func (ClientConsumedMessages) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
185 return attribute.String("error.type", string(val))
186 }
187
188 // AttrConsumerGroupName returns an optional attribute for the
189 // "messaging.consumer.group.name" semantic convention. It represents the name of
190 // the consumer group with which a consumer is associated.
191 func (ClientConsumedMessages) AttrConsumerGroupName(val string) attribute.KeyValue {
192 return attribute.String("messaging.consumer.group.name", val)
193 }
194
195 // AttrDestinationName returns an optional attribute for the
196 // "messaging.destination.name" semantic convention. It represents the message
197 // destination name.
198 func (ClientConsumedMessages) AttrDestinationName(val string) attribute.KeyValue {
199 return attribute.String("messaging.destination.name", val)
200 }
201
202 // AttrDestinationSubscriptionName returns an optional attribute for the
203 // "messaging.destination.subscription.name" semantic convention. It represents
204 // the name of the destination subscription from which a message is consumed.
205 func (ClientConsumedMessages) AttrDestinationSubscriptionName(val string) attribute.KeyValue {
206 return attribute.String("messaging.destination.subscription.name", val)
207 }
208
209 // AttrDestinationTemplate returns an optional attribute for the
210 // "messaging.destination.template" semantic convention. It represents the low
211 // cardinality representation of the messaging destination name.
212 func (ClientConsumedMessages) AttrDestinationTemplate(val string) attribute.KeyValue {
213 return attribute.String("messaging.destination.template", val)
214 }
215
216 // AttrServerAddress returns an optional attribute for the "server.address"
217 // semantic convention. It represents the server domain name if available without
218 // reverse DNS lookup; otherwise, IP address or Unix domain socket name.
219 func (ClientConsumedMessages) AttrServerAddress(val string) attribute.KeyValue {
220 return attribute.String("server.address", val)
221 }
222
223 // AttrDestinationPartitionID returns an optional attribute for the
224 // "messaging.destination.partition.id" semantic convention. It represents the
225 // identifier of the partition messages are sent to or received from, unique
226 // within the `messaging.destination.name`.
227 func (ClientConsumedMessages) AttrDestinationPartitionID(val string) attribute.KeyValue {
228 return attribute.String("messaging.destination.partition.id", val)
229 }
230
231 // AttrServerPort returns an optional attribute for the "server.port" semantic
232 // convention. It represents the server port number.
233 func (ClientConsumedMessages) AttrServerPort(val int) attribute.KeyValue {
234 return attribute.Int("server.port", val)
235 }
236
237 // ClientOperationDuration is an instrument used to record metric values
238 // conforming to the "messaging.client.operation.duration" semantic conventions.
239 // It represents the duration of messaging operation initiated by a producer or
240 // consumer client.
241 type ClientOperationDuration struct {
242 metric.Float64Histogram
243 }
244
245 // NewClientOperationDuration returns a new ClientOperationDuration instrument.
246 func NewClientOperationDuration(
247 m metric.Meter,
248 opt ...metric.Float64HistogramOption,
249 ) (ClientOperationDuration, error) {
250 // Check if the meter is nil.
251 if m == nil {
252 return ClientOperationDuration{noop.Float64Histogram{}}, nil
253 }
254
255 i, err := m.Float64Histogram(
256 "messaging.client.operation.duration",
257 append([]metric.Float64HistogramOption{
258 metric.WithDescription("Duration of messaging operation initiated by a producer or consumer client."),
259 metric.WithUnit("s"),
260 }, opt...)...,
261 )
262 if err != nil {
263 return ClientOperationDuration{noop.Float64Histogram{}}, err
264 }
265 return ClientOperationDuration{i}, nil
266 }
267
268 // Inst returns the underlying metric instrument.
269 func (m ClientOperationDuration) Inst() metric.Float64Histogram {
270 return m.Float64Histogram
271 }
272
273 // Name returns the semantic convention name of the instrument.
274 func (ClientOperationDuration) Name() string {
275 return "messaging.client.operation.duration"
276 }
277
278 // Unit returns the semantic convention unit of the instrument
279 func (ClientOperationDuration) Unit() string {
280 return "s"
281 }
282
283 // Description returns the semantic convention description of the instrument
284 func (ClientOperationDuration) Description() string {
285 return "Duration of messaging operation initiated by a producer or consumer client."
286 }
287
288 // Record records val to the current distribution.
289 //
290 // The operationName is the the system-specific name of the messaging operation.
291 //
292 // The system is the the messaging system as identified by the client
293 // instrumentation.
294 //
295 // All additional attrs passed are included in the recorded value.
296 //
297 // This metric SHOULD NOT be used to report processing duration - processing
298 // duration is reported in `messaging.process.duration` metric.
299 func (m ClientOperationDuration) Record(
300 ctx context.Context,
301 val float64,
302 operationName string,
303 system SystemAttr,
304 attrs ...attribute.KeyValue,
305 ) {
306 o := recOptPool.Get().(*[]metric.RecordOption)
307 defer func() {
308 *o = (*o)[:0]
309 recOptPool.Put(o)
310 }()
311
312 *o = append(
313 *o,
314 metric.WithAttributes(
315 append(
316 attrs,
317 attribute.String("messaging.operation.name", operationName),
318 attribute.String("messaging.system", string(system)),
319 )...,
320 ),
321 )
322
323 m.Float64Histogram.Record(ctx, val, *o...)
324 }
325
326 // AttrErrorType returns an optional attribute for the "error.type" semantic
327 // convention. It represents the describes a class of error the operation ended
328 // with.
329 func (ClientOperationDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
330 return attribute.String("error.type", string(val))
331 }
332
333 // AttrConsumerGroupName returns an optional attribute for the
334 // "messaging.consumer.group.name" semantic convention. It represents the name of
335 // the consumer group with which a consumer is associated.
336 func (ClientOperationDuration) AttrConsumerGroupName(val string) attribute.KeyValue {
337 return attribute.String("messaging.consumer.group.name", val)
338 }
339
340 // AttrDestinationName returns an optional attribute for the
341 // "messaging.destination.name" semantic convention. It represents the message
342 // destination name.
343 func (ClientOperationDuration) AttrDestinationName(val string) attribute.KeyValue {
344 return attribute.String("messaging.destination.name", val)
345 }
346
347 // AttrDestinationSubscriptionName returns an optional attribute for the
348 // "messaging.destination.subscription.name" semantic convention. It represents
349 // the name of the destination subscription from which a message is consumed.
350 func (ClientOperationDuration) AttrDestinationSubscriptionName(val string) attribute.KeyValue {
351 return attribute.String("messaging.destination.subscription.name", val)
352 }
353
354 // AttrDestinationTemplate returns an optional attribute for the
355 // "messaging.destination.template" semantic convention. It represents the low
356 // cardinality representation of the messaging destination name.
357 func (ClientOperationDuration) AttrDestinationTemplate(val string) attribute.KeyValue {
358 return attribute.String("messaging.destination.template", val)
359 }
360
361 // AttrOperationType returns an optional attribute for the
362 // "messaging.operation.type" semantic convention. It represents a string
363 // identifying the type of the messaging operation.
364 func (ClientOperationDuration) AttrOperationType(val OperationTypeAttr) attribute.KeyValue {
365 return attribute.String("messaging.operation.type", string(val))
366 }
367
368 // AttrServerAddress returns an optional attribute for the "server.address"
369 // semantic convention. It represents the server domain name if available without
370 // reverse DNS lookup; otherwise, IP address or Unix domain socket name.
371 func (ClientOperationDuration) AttrServerAddress(val string) attribute.KeyValue {
372 return attribute.String("server.address", val)
373 }
374
375 // AttrDestinationPartitionID returns an optional attribute for the
376 // "messaging.destination.partition.id" semantic convention. It represents the
377 // identifier of the partition messages are sent to or received from, unique
378 // within the `messaging.destination.name`.
379 func (ClientOperationDuration) AttrDestinationPartitionID(val string) attribute.KeyValue {
380 return attribute.String("messaging.destination.partition.id", val)
381 }
382
383 // AttrServerPort returns an optional attribute for the "server.port" semantic
384 // convention. It represents the server port number.
385 func (ClientOperationDuration) AttrServerPort(val int) attribute.KeyValue {
386 return attribute.Int("server.port", val)
387 }
388
389 // ClientSentMessages is an instrument used to record metric values conforming to
390 // the "messaging.client.sent.messages" semantic conventions. It represents the
391 // number of messages producer attempted to send to the broker.
392 type ClientSentMessages struct {
393 metric.Int64Counter
394 }
395
396 // NewClientSentMessages returns a new ClientSentMessages instrument.
397 func NewClientSentMessages(
398 m metric.Meter,
399 opt ...metric.Int64CounterOption,
400 ) (ClientSentMessages, error) {
401 // Check if the meter is nil.
402 if m == nil {
403 return ClientSentMessages{noop.Int64Counter{}}, nil
404 }
405
406 i, err := m.Int64Counter(
407 "messaging.client.sent.messages",
408 append([]metric.Int64CounterOption{
409 metric.WithDescription("Number of messages producer attempted to send to the broker."),
410 metric.WithUnit("{message}"),
411 }, opt...)...,
412 )
413 if err != nil {
414 return ClientSentMessages{noop.Int64Counter{}}, err
415 }
416 return ClientSentMessages{i}, nil
417 }
418
419 // Inst returns the underlying metric instrument.
420 func (m ClientSentMessages) Inst() metric.Int64Counter {
421 return m.Int64Counter
422 }
423
424 // Name returns the semantic convention name of the instrument.
425 func (ClientSentMessages) Name() string {
426 return "messaging.client.sent.messages"
427 }
428
429 // Unit returns the semantic convention unit of the instrument
430 func (ClientSentMessages) Unit() string {
431 return "{message}"
432 }
433
434 // Description returns the semantic convention description of the instrument
435 func (ClientSentMessages) Description() string {
436 return "Number of messages producer attempted to send to the broker."
437 }
438
439 // Add adds incr to the existing count.
440 //
441 // The operationName is the the system-specific name of the messaging operation.
442 //
443 // The system is the the messaging system as identified by the client
444 // instrumentation.
445 //
446 // All additional attrs passed are included in the recorded value.
447 //
448 // This metric MUST NOT count messages that were created but haven't yet been
449 // sent.
450 func (m ClientSentMessages) Add(
451 ctx context.Context,
452 incr int64,
453 operationName string,
454 system SystemAttr,
455 attrs ...attribute.KeyValue,
456 ) {
457 o := addOptPool.Get().(*[]metric.AddOption)
458 defer func() {
459 *o = (*o)[:0]
460 addOptPool.Put(o)
461 }()
462
463 *o = append(
464 *o,
465 metric.WithAttributes(
466 append(
467 attrs,
468 attribute.String("messaging.operation.name", operationName),
469 attribute.String("messaging.system", string(system)),
470 )...,
471 ),
472 )
473
474 m.Int64Counter.Add(ctx, incr, *o...)
475 }
476
477 // AttrErrorType returns an optional attribute for the "error.type" semantic
478 // convention. It represents the describes a class of error the operation ended
479 // with.
480 func (ClientSentMessages) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
481 return attribute.String("error.type", string(val))
482 }
483
484 // AttrDestinationName returns an optional attribute for the
485 // "messaging.destination.name" semantic convention. It represents the message
486 // destination name.
487 func (ClientSentMessages) AttrDestinationName(val string) attribute.KeyValue {
488 return attribute.String("messaging.destination.name", val)
489 }
490
491 // AttrDestinationTemplate returns an optional attribute for the
492 // "messaging.destination.template" semantic convention. It represents the low
493 // cardinality representation of the messaging destination name.
494 func (ClientSentMessages) AttrDestinationTemplate(val string) attribute.KeyValue {
495 return attribute.String("messaging.destination.template", val)
496 }
497
498 // AttrServerAddress returns an optional attribute for the "server.address"
499 // semantic convention. It represents the server domain name if available without
500 // reverse DNS lookup; otherwise, IP address or Unix domain socket name.
501 func (ClientSentMessages) AttrServerAddress(val string) attribute.KeyValue {
502 return attribute.String("server.address", val)
503 }
504
505 // AttrDestinationPartitionID returns an optional attribute for the
506 // "messaging.destination.partition.id" semantic convention. It represents the
507 // identifier of the partition messages are sent to or received from, unique
508 // within the `messaging.destination.name`.
509 func (ClientSentMessages) AttrDestinationPartitionID(val string) attribute.KeyValue {
510 return attribute.String("messaging.destination.partition.id", val)
511 }
512
513 // AttrServerPort returns an optional attribute for the "server.port" semantic
514 // convention. It represents the server port number.
515 func (ClientSentMessages) AttrServerPort(val int) attribute.KeyValue {
516 return attribute.Int("server.port", val)
517 }
518
519 // ProcessDuration is an instrument used to record metric values conforming to
520 // the "messaging.process.duration" semantic conventions. It represents the
521 // duration of processing operation.
522 type ProcessDuration struct {
523 metric.Float64Histogram
524 }
525
526 // NewProcessDuration returns a new ProcessDuration instrument.
527 func NewProcessDuration(
528 m metric.Meter,
529 opt ...metric.Float64HistogramOption,
530 ) (ProcessDuration, error) {
531 // Check if the meter is nil.
532 if m == nil {
533 return ProcessDuration{noop.Float64Histogram{}}, nil
534 }
535
536 i, err := m.Float64Histogram(
537 "messaging.process.duration",
538 append([]metric.Float64HistogramOption{
539 metric.WithDescription("Duration of processing operation."),
540 metric.WithUnit("s"),
541 }, opt...)...,
542 )
543 if err != nil {
544 return ProcessDuration{noop.Float64Histogram{}}, err
545 }
546 return ProcessDuration{i}, nil
547 }
548
549 // Inst returns the underlying metric instrument.
550 func (m ProcessDuration) Inst() metric.Float64Histogram {
551 return m.Float64Histogram
552 }
553
554 // Name returns the semantic convention name of the instrument.
555 func (ProcessDuration) Name() string {
556 return "messaging.process.duration"
557 }
558
559 // Unit returns the semantic convention unit of the instrument
560 func (ProcessDuration) Unit() string {
561 return "s"
562 }
563
564 // Description returns the semantic convention description of the instrument
565 func (ProcessDuration) Description() string {
566 return "Duration of processing operation."
567 }
568
569 // Record records val to the current distribution.
570 //
571 // The operationName is the the system-specific name of the messaging operation.
572 //
573 // The system is the the messaging system as identified by the client
574 // instrumentation.
575 //
576 // All additional attrs passed are included in the recorded value.
577 //
578 // This metric MUST be reported for operations with `messaging.operation.type`
579 // that matches `process`.
580 func (m ProcessDuration) Record(
581 ctx context.Context,
582 val float64,
583 operationName string,
584 system SystemAttr,
585 attrs ...attribute.KeyValue,
586 ) {
587 o := recOptPool.Get().(*[]metric.RecordOption)
588 defer func() {
589 *o = (*o)[:0]
590 recOptPool.Put(o)
591 }()
592
593 *o = append(
594 *o,
595 metric.WithAttributes(
596 append(
597 attrs,
598 attribute.String("messaging.operation.name", operationName),
599 attribute.String("messaging.system", string(system)),
600 )...,
601 ),
602 )
603
604 m.Float64Histogram.Record(ctx, val, *o...)
605 }
606
607 // AttrErrorType returns an optional attribute for the "error.type" semantic
608 // convention. It represents the describes a class of error the operation ended
609 // with.
610 func (ProcessDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
611 return attribute.String("error.type", string(val))
612 }
613
614 // AttrConsumerGroupName returns an optional attribute for the
615 // "messaging.consumer.group.name" semantic convention. It represents the name of
616 // the consumer group with which a consumer is associated.
617 func (ProcessDuration) AttrConsumerGroupName(val string) attribute.KeyValue {
618 return attribute.String("messaging.consumer.group.name", val)
619 }
620
621 // AttrDestinationName returns an optional attribute for the
622 // "messaging.destination.name" semantic convention. It represents the message
623 // destination name.
624 func (ProcessDuration) AttrDestinationName(val string) attribute.KeyValue {
625 return attribute.String("messaging.destination.name", val)
626 }
627
628 // AttrDestinationSubscriptionName returns an optional attribute for the
629 // "messaging.destination.subscription.name" semantic convention. It represents
630 // the name of the destination subscription from which a message is consumed.
631 func (ProcessDuration) AttrDestinationSubscriptionName(val string) attribute.KeyValue {
632 return attribute.String("messaging.destination.subscription.name", val)
633 }
634
635 // AttrDestinationTemplate returns an optional attribute for the
636 // "messaging.destination.template" semantic convention. It represents the low
637 // cardinality representation of the messaging destination name.
638 func (ProcessDuration) AttrDestinationTemplate(val string) attribute.KeyValue {
639 return attribute.String("messaging.destination.template", val)
640 }
641
642 // AttrServerAddress returns an optional attribute for the "server.address"
643 // semantic convention. It represents the server domain name if available without
644 // reverse DNS lookup; otherwise, IP address or Unix domain socket name.
645 func (ProcessDuration) AttrServerAddress(val string) attribute.KeyValue {
646 return attribute.String("server.address", val)
647 }
648
649 // AttrDestinationPartitionID returns an optional attribute for the
650 // "messaging.destination.partition.id" semantic convention. It represents the
651 // identifier of the partition messages are sent to or received from, unique
652 // within the `messaging.destination.name`.
653 func (ProcessDuration) AttrDestinationPartitionID(val string) attribute.KeyValue {
654 return attribute.String("messaging.destination.partition.id", val)
655 }
656
657 // AttrServerPort returns an optional attribute for the "server.port" semantic
658 // convention. It represents the server port number.
659 func (ProcessDuration) AttrServerPort(val int) attribute.KeyValue {
660 return attribute.Int("server.port", val)
661 }