-
Notifications
You must be signed in to change notification settings - Fork 1k
/
resource.go
2577 lines (2340 loc) · 101 KB
/
resource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.23.1"
import "go.opentelemetry.io/otel/attribute"
// A cloud environment (e.g. GCP, Azure, AWS).
const (
// CloudAccountIDKey is the attribute Key conforming to the
// "cloud.account.id" semantic conventions. It represents the cloud account
// ID the resource is assigned to.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: '111111111111', 'opentelemetry'
CloudAccountIDKey = attribute.Key("cloud.account.id")
// CloudAvailabilityZoneKey is the attribute Key conforming to the
// "cloud.availability_zone" semantic conventions. It represents the cloud
// regions often have multiple, isolated locations known as zones to
// increase availability. Availability zone represents the zone where the
// resource is running.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'us-east-1c'
// Note: Availability zones are called "zones" on Alibaba Cloud and Google
// Cloud.
CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
// CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
// semantic conventions. It represents the cloud platform in use.
//
// Type: Enum
// RequirementLevel: Optional
// Stability: experimental
// Note: The prefix of the service SHOULD match the one specified in
// `cloud.provider`.
CloudPlatformKey = attribute.Key("cloud.platform")
// CloudProviderKey is the attribute Key conforming to the "cloud.provider"
// semantic conventions. It represents the name of the cloud provider.
//
// Type: Enum
// RequirementLevel: Optional
// Stability: experimental
CloudProviderKey = attribute.Key("cloud.provider")
// CloudRegionKey is the attribute Key conforming to the "cloud.region"
// semantic conventions. It represents the geographical region the resource
// is running.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'us-central1', 'us-east-1'
// Note: Refer to your provider's docs to see the available regions, for
// example [Alibaba Cloud
// regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS
// regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/),
// [Azure
// regions](https://azure.microsoft.com/global-infrastructure/geographies/),
// [Google Cloud regions](https://cloud.google.com/about/locations), or
// [Tencent Cloud
// regions](https://www.tencentcloud.com/document/product/213/6091).
CloudRegionKey = attribute.Key("cloud.region")
// CloudResourceIDKey is the attribute Key conforming to the
// "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource
// (e.g. an
// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// on AWS, a [fully qualified resource
// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id)
// on Azure, a [full resource
// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
// on GCP)
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
// '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
// '/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>'
// Note: On some cloud providers, it may not be possible to determine the
// full ID at startup,
// so it may be necessary to set `cloud.resource_id` as a span attribute
// instead.
//
// The exact value to use for `cloud.resource_id` depends on the cloud
// provider.
// The following well-known definitions MUST be used if you set this
// attribute and they apply:
//
// * **AWS Lambda:** The function
// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
// Take care not to use the "invoked ARN" directly but replace any
// [alias
// suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
// with the resolved function version, as the same runtime instance may
// be invokable with
// multiple different aliases.
// * **GCP:** The [URI of the
// resource](https://cloud.google.com/iam/docs/full-resource-names)
// * **Azure:** The [Fully Qualified Resource
// ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id)
// of the invoked function,
// *not* the function app, having the form
// `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
// This means that a span attribute MUST be used, as an Azure function
// app can host multiple functions that would usually share
// a TracerProvider.
CloudResourceIDKey = attribute.Key("cloud.resource_id")
)
var (
// Alibaba Cloud Elastic Compute Service
CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
// Alibaba Cloud Function Compute
CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
// Red Hat OpenShift on Alibaba Cloud
CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
// AWS Elastic Compute Cloud
CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
// AWS Elastic Container Service
CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
// AWS Elastic Kubernetes Service
CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
// AWS Lambda
CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
// AWS Elastic Beanstalk
CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
// AWS App Runner
CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
// Red Hat OpenShift on AWS (ROSA)
CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
// Azure Virtual Machines
CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
// Azure Container Instances
CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances")
// Azure Kubernetes Service
CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks")
// Azure Functions
CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
// Azure App Service
CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
// Azure Red Hat OpenShift
CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
// Google Bare Metal Solution (BMS)
CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
// Google Cloud Compute Engine (GCE)
CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
// Google Cloud Run
CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
// Google Cloud Kubernetes Engine (GKE)
CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
// Google Cloud Functions (GCF)
CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
// Google Cloud App Engine (GAE)
CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
// Red Hat OpenShift on Google Cloud
CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
// Red Hat OpenShift on IBM Cloud
CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
// Tencent Cloud Cloud Virtual Machine (CVM)
CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
// Tencent Cloud Elastic Kubernetes Service (EKS)
CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
// Tencent Cloud Serverless Cloud Function (SCF)
CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf")
)
var (
// Alibaba Cloud
CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
// Amazon Web Services
CloudProviderAWS = CloudProviderKey.String("aws")
// Microsoft Azure
CloudProviderAzure = CloudProviderKey.String("azure")
// Google Cloud Platform
CloudProviderGCP = CloudProviderKey.String("gcp")
// Heroku Platform as a Service
CloudProviderHeroku = CloudProviderKey.String("heroku")
// IBM Cloud
CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
// Tencent Cloud
CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
)
// CloudAccountID returns an attribute KeyValue conforming to the
// "cloud.account.id" semantic conventions. It represents the cloud account ID
// the resource is assigned to.
func CloudAccountID(val string) attribute.KeyValue {
return CloudAccountIDKey.String(val)
}
// CloudAvailabilityZone returns an attribute KeyValue conforming to the
// "cloud.availability_zone" semantic conventions. It represents the cloud
// regions often have multiple, isolated locations known as zones to increase
// availability. Availability zone represents the zone where the resource is
// running.
func CloudAvailabilityZone(val string) attribute.KeyValue {
return CloudAvailabilityZoneKey.String(val)
}
// CloudRegion returns an attribute KeyValue conforming to the
// "cloud.region" semantic conventions. It represents the geographical region
// the resource is running.
func CloudRegion(val string) attribute.KeyValue {
return CloudRegionKey.String(val)
}
// CloudResourceID returns an attribute KeyValue conforming to the
// "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// on AWS, a [fully qualified resource
// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on
// Azure, a [full resource
// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
// on GCP)
func CloudResourceID(val string) attribute.KeyValue {
return CloudResourceIDKey.String(val)
}
// A container instance.
const (
// ContainerCommandKey is the attribute Key conforming to the
// "container.command" semantic conventions. It represents the command used
// to run the container (i.e. the command name).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'otelcontribcol'
// Note: If using embedded credentials or sensitive data, it is recommended
// to remove them to prevent potential leakage.
ContainerCommandKey = attribute.Key("container.command")
// ContainerCommandArgsKey is the attribute Key conforming to the
// "container.command_args" semantic conventions. It represents the all the
// command arguments (including the command/executable itself) run by the
// container. [2]
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'otelcontribcol, --config, config.yaml'
ContainerCommandArgsKey = attribute.Key("container.command_args")
// ContainerCommandLineKey is the attribute Key conforming to the
// "container.command_line" semantic conventions. It represents the full
// command run by the container as a single string representing the full
// command. [2]
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'otelcontribcol --config config.yaml'
ContainerCommandLineKey = attribute.Key("container.command_line")
// ContainerIDKey is the attribute Key conforming to the "container.id"
// semantic conventions. It represents the container ID. Usually a UUID, as
// for example used to [identify Docker
// containers](https://docs.docker.com/engine/reference/run/#container-identification).
// The UUID might be abbreviated.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'a3bf90e006b2'
ContainerIDKey = attribute.Key("container.id")
// ContainerImageIDKey is the attribute Key conforming to the
// "container.image.id" semantic conventions. It represents the runtime
// specific image identifier. Usually a hash algorithm followed by a UUID.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
// Note: Docker defines a sha256 of the image id; `container.image.id`
// corresponds to the `Image` field from the Docker container inspect
// [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
// endpoint.
// K8S defines a link to the container registry repository with digest
// `"imageID": "registry.azurecr.io
// /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
// The ID is assinged by the container runtime and can vary in different
// environments. Consider using `oci.manifest.digest` if it is important to
// identify the same image in different environments/runtimes.
ContainerImageIDKey = attribute.Key("container.image.id")
// ContainerImageNameKey is the attribute Key conforming to the
// "container.image.name" semantic conventions. It represents the name of
// the image the container was built on.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'gcr.io/opentelemetry/operator'
ContainerImageNameKey = attribute.Key("container.image.name")
// ContainerImageRepoDigestsKey is the attribute Key conforming to the
// "container.image.repo_digests" semantic conventions. It represents the
// repo digests of the container image as provided by the container
// runtime.
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb',
// 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578'
// Note:
// [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect)
// and
// [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238)
// report those under the `RepoDigests` field.
ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
// ContainerImageTagsKey is the attribute Key conforming to the
// "container.image.tags" semantic conventions. It represents the container
// image tags. An example can be found in [Docker Image
// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
// Should be only the `<tag>` section of the full name for example from
// `registry.example.com/my-org/my-image:<tag>`.
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'v1.27.1', '3.5.7-0'
ContainerImageTagsKey = attribute.Key("container.image.tags")
// ContainerNameKey is the attribute Key conforming to the "container.name"
// semantic conventions. It represents the container name used by container
// runtime.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'opentelemetry-autoconf'
ContainerNameKey = attribute.Key("container.name")
// ContainerRuntimeKey is the attribute Key conforming to the
// "container.runtime" semantic conventions. It represents the container
// runtime managing this container.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'docker', 'containerd', 'rkt'
ContainerRuntimeKey = attribute.Key("container.runtime")
)
// ContainerCommand returns an attribute KeyValue conforming to the
// "container.command" semantic conventions. It represents the command used to
// run the container (i.e. the command name).
func ContainerCommand(val string) attribute.KeyValue {
return ContainerCommandKey.String(val)
}
// ContainerCommandArgs returns an attribute KeyValue conforming to the
// "container.command_args" semantic conventions. It represents the all the
// command arguments (including the command/executable itself) run by the
// container. [2]
func ContainerCommandArgs(val ...string) attribute.KeyValue {
return ContainerCommandArgsKey.StringSlice(val)
}
// ContainerCommandLine returns an attribute KeyValue conforming to the
// "container.command_line" semantic conventions. It represents the full
// command run by the container as a single string representing the full
// command. [2]
func ContainerCommandLine(val string) attribute.KeyValue {
return ContainerCommandLineKey.String(val)
}
// ContainerID returns an attribute KeyValue conforming to the
// "container.id" semantic conventions. It represents the container ID. Usually
// a UUID, as for example used to [identify Docker
// containers](https://docs.docker.com/engine/reference/run/#container-identification).
// The UUID might be abbreviated.
func ContainerID(val string) attribute.KeyValue {
return ContainerIDKey.String(val)
}
// ContainerImageID returns an attribute KeyValue conforming to the
// "container.image.id" semantic conventions. It represents the runtime
// specific image identifier. Usually a hash algorithm followed by a UUID.
func ContainerImageID(val string) attribute.KeyValue {
return ContainerImageIDKey.String(val)
}
// ContainerImageName returns an attribute KeyValue conforming to the
// "container.image.name" semantic conventions. It represents the name of the
// image the container was built on.
func ContainerImageName(val string) attribute.KeyValue {
return ContainerImageNameKey.String(val)
}
// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
// "container.image.repo_digests" semantic conventions. It represents the repo
// digests of the container image as provided by the container runtime.
func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
return ContainerImageRepoDigestsKey.StringSlice(val)
}
// ContainerImageTags returns an attribute KeyValue conforming to the
// "container.image.tags" semantic conventions. It represents the container
// image tags. An example can be found in [Docker Image
// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
// Should be only the `<tag>` section of the full name for example from
// `registry.example.com/my-org/my-image:<tag>`.
func ContainerImageTags(val ...string) attribute.KeyValue {
return ContainerImageTagsKey.StringSlice(val)
}
// ContainerName returns an attribute KeyValue conforming to the
// "container.name" semantic conventions. It represents the container name used
// by container runtime.
func ContainerName(val string) attribute.KeyValue {
return ContainerNameKey.String(val)
}
// ContainerRuntime returns an attribute KeyValue conforming to the
// "container.runtime" semantic conventions. It represents the container
// runtime managing this container.
func ContainerRuntime(val string) attribute.KeyValue {
return ContainerRuntimeKey.String(val)
}
// An OCI image manifest.
const (
// OciManifestDigestKey is the attribute Key conforming to the
// "oci.manifest.digest" semantic conventions. It represents the digest of
// the OCI image manifest. For container images specifically is the digest
// by which the container image is known.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4'
// Note: Follows [OCI Image Manifest
// Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md),
// and specifically the [Digest
// property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
// An example can be found in [Example Image
// Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest).
OciManifestDigestKey = attribute.Key("oci.manifest.digest")
)
// OciManifestDigest returns an attribute KeyValue conforming to the
// "oci.manifest.digest" semantic conventions. It represents the digest of the
// OCI image manifest. For container images specifically is the digest by which
// the container image is known.
func OciManifestDigest(val string) attribute.KeyValue {
return OciManifestDigestKey.String(val)
}
// The Android platform on which the Android application is running.
const (
// AndroidOSAPILevelKey is the attribute Key conforming to the
// "android.os.api_level" semantic conventions. It represents the uniquely
// identifies the framework API revision offered by a version
// (`os.version`) of the android operating system. More information can be
// found
// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: '33', '32'
AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
)
// AndroidOSAPILevel returns an attribute KeyValue conforming to the
// "android.os.api_level" semantic conventions. It represents the uniquely
// identifies the framework API revision offered by a version (`os.version`) of
// the android operating system. More information can be found
// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
func AndroidOSAPILevel(val string) attribute.KeyValue {
return AndroidOSAPILevelKey.String(val)
}
// The web browser in which the application represented by the resource is
// running. The `browser.*` attributes MUST be used only for resources that
// represent applications running in a web browser (regardless of whether
// running on a mobile or desktop device).
const (
// BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
// semantic conventions. It represents the array of brand name and version
// separated by a space
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
// Note: This value is intended to be taken from the [UA client hints
// API](https://wicg.github.io/ua-client-hints/#interface)
// (`navigator.userAgentData.brands`).
BrowserBrandsKey = attribute.Key("browser.brands")
// BrowserLanguageKey is the attribute Key conforming to the
// "browser.language" semantic conventions. It represents the preferred
// language of the user using the browser
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'en', 'en-US', 'fr', 'fr-FR'
// Note: This value is intended to be taken from the Navigator API
// `navigator.language`.
BrowserLanguageKey = attribute.Key("browser.language")
// BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
// semantic conventions. It represents a boolean that is true if the
// browser is running on a mobile device
//
// Type: boolean
// RequirementLevel: Optional
// Stability: experimental
// Note: This value is intended to be taken from the [UA client hints
// API](https://wicg.github.io/ua-client-hints/#interface)
// (`navigator.userAgentData.mobile`). If unavailable, this attribute
// SHOULD be left unset.
BrowserMobileKey = attribute.Key("browser.mobile")
// BrowserPlatformKey is the attribute Key conforming to the
// "browser.platform" semantic conventions. It represents the platform on
// which the browser is running
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'Windows', 'macOS', 'Android'
// Note: This value is intended to be taken from the [UA client hints
// API](https://wicg.github.io/ua-client-hints/#interface)
// (`navigator.userAgentData.platform`). If unavailable, the legacy
// `navigator.platform` API SHOULD NOT be used instead and this attribute
// SHOULD be left unset in order for the values to be consistent.
// The list of possible values is defined in the [W3C User-Agent Client
// Hints
// specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
// Note that some (but not all) of these values can overlap with values in
// the [`os.type` and `os.name` attributes](./os.md). However, for
// consistency, the values in the `browser.platform` attribute should
// capture the exact value that the user agent provides.
BrowserPlatformKey = attribute.Key("browser.platform")
)
// BrowserBrands returns an attribute KeyValue conforming to the
// "browser.brands" semantic conventions. It represents the array of brand name
// and version separated by a space
func BrowserBrands(val ...string) attribute.KeyValue {
return BrowserBrandsKey.StringSlice(val)
}
// BrowserLanguage returns an attribute KeyValue conforming to the
// "browser.language" semantic conventions. It represents the preferred
// language of the user using the browser
func BrowserLanguage(val string) attribute.KeyValue {
return BrowserLanguageKey.String(val)
}
// BrowserMobile returns an attribute KeyValue conforming to the
// "browser.mobile" semantic conventions. It represents a boolean that is true
// if the browser is running on a mobile device
func BrowserMobile(val bool) attribute.KeyValue {
return BrowserMobileKey.Bool(val)
}
// BrowserPlatform returns an attribute KeyValue conforming to the
// "browser.platform" semantic conventions. It represents the platform on which
// the browser is running
func BrowserPlatform(val string) attribute.KeyValue {
return BrowserPlatformKey.String(val)
}
// Resources used by AWS Elastic Container Service (ECS).
const (
// AWSECSClusterARNKey is the attribute Key conforming to the
// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
// [ECS
// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
// AWSECSContainerARNKey is the attribute Key conforming to the
// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
// Resource Name (ARN) of an [ECS container
// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
// AWSECSLaunchtypeKey is the attribute Key conforming to the
// "aws.ecs.launchtype" semantic conventions. It represents the [launch
// type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
// for an ECS task.
//
// Type: Enum
// RequirementLevel: Optional
// Stability: experimental
AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
// AWSECSTaskARNKey is the attribute Key conforming to the
// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an
// [ECS task
// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b'
AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
// AWSECSTaskFamilyKey is the attribute Key conforming to the
// "aws.ecs.task.family" semantic conventions. It represents the task
// definition family this task definition is a member of.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'opentelemetry-family'
AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
// AWSECSTaskRevisionKey is the attribute Key conforming to the
// "aws.ecs.task.revision" semantic conventions. It represents the revision
// for this task definition.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: '8', '26'
AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
)
var (
// ec2
AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
// fargate
AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
)
// AWSECSClusterARN returns an attribute KeyValue conforming to the
// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS
// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
func AWSECSClusterARN(val string) attribute.KeyValue {
return AWSECSClusterARNKey.String(val)
}
// AWSECSContainerARN returns an attribute KeyValue conforming to the
// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
// Resource Name (ARN) of an [ECS container
// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
func AWSECSContainerARN(val string) attribute.KeyValue {
return AWSECSContainerARNKey.String(val)
}
// AWSECSTaskARN returns an attribute KeyValue conforming to the
// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS
// task
// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
func AWSECSTaskARN(val string) attribute.KeyValue {
return AWSECSTaskARNKey.String(val)
}
// AWSECSTaskFamily returns an attribute KeyValue conforming to the
// "aws.ecs.task.family" semantic conventions. It represents the task
// definition family this task definition is a member of.
func AWSECSTaskFamily(val string) attribute.KeyValue {
return AWSECSTaskFamilyKey.String(val)
}
// AWSECSTaskRevision returns an attribute KeyValue conforming to the
// "aws.ecs.task.revision" semantic conventions. It represents the revision for
// this task definition.
func AWSECSTaskRevision(val string) attribute.KeyValue {
return AWSECSTaskRevisionKey.String(val)
}
// Resources used by AWS Elastic Kubernetes Service (EKS).
const (
// AWSEKSClusterARNKey is the attribute Key conforming to the
// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an
// EKS cluster.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
)
// AWSEKSClusterARN returns an attribute KeyValue conforming to the
// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
// cluster.
func AWSEKSClusterARN(val string) attribute.KeyValue {
return AWSEKSClusterARNKey.String(val)
}
// Resources specific to Amazon Web Services.
const (
// AWSLogGroupARNsKey is the attribute Key conforming to the
// "aws.log.group.arns" semantic conventions. It represents the Amazon
// Resource Name(s) (ARN) of the AWS log group(s).
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
// Note: See the [log group ARN format
// documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
// AWSLogGroupNamesKey is the attribute Key conforming to the
// "aws.log.group.names" semantic conventions. It represents the name(s) of
// the AWS log group(s) an application is writing to.
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples: '/aws/lambda/my-function', 'opentelemetry-service'
// Note: Multiple log groups must be supported for cases like
// multi-container applications, where a single application has sidecar
// containers, and each write to their own log group.
AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
// AWSLogStreamARNsKey is the attribute Key conforming to the
// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of
// the AWS log stream(s).
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples:
// 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
// Note: See the [log stream ARN format
// documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
// One log group can contain several log streams, so these ARNs necessarily
// identify both a log group and a log stream.
AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
// AWSLogStreamNamesKey is the attribute Key conforming to the
// "aws.log.stream.names" semantic conventions. It represents the name(s)
// of the AWS log stream(s) an application is writing to.
//
// Type: string[]
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
)
// AWSLogGroupARNs returns an attribute KeyValue conforming to the
// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
// Name(s) (ARN) of the AWS log group(s).
func AWSLogGroupARNs(val ...string) attribute.KeyValue {
return AWSLogGroupARNsKey.StringSlice(val)
}
// AWSLogGroupNames returns an attribute KeyValue conforming to the
// "aws.log.group.names" semantic conventions. It represents the name(s) of the
// AWS log group(s) an application is writing to.
func AWSLogGroupNames(val ...string) attribute.KeyValue {
return AWSLogGroupNamesKey.StringSlice(val)
}
// AWSLogStreamARNs returns an attribute KeyValue conforming to the
// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
// AWS log stream(s).
func AWSLogStreamARNs(val ...string) attribute.KeyValue {
return AWSLogStreamARNsKey.StringSlice(val)
}
// AWSLogStreamNames returns an attribute KeyValue conforming to the
// "aws.log.stream.names" semantic conventions. It represents the name(s) of
// the AWS log stream(s) an application is writing to.
func AWSLogStreamNames(val ...string) attribute.KeyValue {
return AWSLogStreamNamesKey.StringSlice(val)
}
// Resource used by Google Cloud Run.
const (
// GCPCloudRunJobExecutionKey is the attribute Key conforming to the
// "gcp.cloud_run.job.execution" semantic conventions. It represents the
// name of the Cloud Run
// [execution](https://cloud.google.com/run/docs/managing/job-executions)
// being run for the Job, as set by the
// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
// environment variable.
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'job-name-xxxx', 'sample-job-mdw84'
GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
// GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
// "gcp.cloud_run.job.task_index" semantic conventions. It represents the
// index for a task within an execution as provided by the
// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
// environment variable.
//
// Type: int
// RequirementLevel: Optional
// Stability: experimental
// Examples: 0, 1
GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
)
// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
// of the Cloud Run
// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
// run for the Job, as set by the
// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
// environment variable.
func GCPCloudRunJobExecution(val string) attribute.KeyValue {
return GCPCloudRunJobExecutionKey.String(val)
}
// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
// for a task within an execution as provided by the
// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
// environment variable.
func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
return GCPCloudRunJobTaskIndexKey.Int(val)
}
// Resources used by Google Compute Engine (GCE).
const (
// GCPGceInstanceHostnameKey is the attribute Key conforming to the
// "gcp.gce.instance.hostname" semantic conventions. It represents the
// hostname of a GCE instance. This is the full value of the default or
// [custom
// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'my-host1234.example.com',
// 'sample-vm.us-west1-b.c.my-project.internal'
GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
// GCPGceInstanceNameKey is the attribute Key conforming to the
// "gcp.gce.instance.name" semantic conventions. It represents the instance
// name of a GCE instance. This is the value provided by `host.name`, the
// visible name of the instance in the Cloud Console UI, and the prefix for
// the default hostname of the instance as defined by the [default internal
// DNS
// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'instance-1', 'my-vm-name'
GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
)
// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
// of a GCE instance. This is the full value of the default or [custom
// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
func GCPGceInstanceHostname(val string) attribute.KeyValue {
return GCPGceInstanceHostnameKey.String(val)
}
// GCPGceInstanceName returns an attribute KeyValue conforming to the
// "gcp.gce.instance.name" semantic conventions. It represents the instance
// name of a GCE instance. This is the value provided by `host.name`, the
// visible name of the instance in the Cloud Console UI, and the prefix for the
// default hostname of the instance as defined by the [default internal DNS
// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
func GCPGceInstanceName(val string) attribute.KeyValue {
return GCPGceInstanceNameKey.String(val)
}
// Heroku dyno metadata
const (
// HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
// semantic conventions. It represents the unique identifier for the
// application
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
HerokuAppIDKey = attribute.Key("heroku.app.id")
// HerokuReleaseCommitKey is the attribute Key conforming to the
// "heroku.release.commit" semantic conventions. It represents the commit
// hash for the current release
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
// HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
// "heroku.release.creation_timestamp" semantic conventions. It represents
// the time and date the release was created
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: '2022-10-23T18:00:42Z'
HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
)
// HerokuAppID returns an attribute KeyValue conforming to the
// "heroku.app.id" semantic conventions. It represents the unique identifier
// for the application
func HerokuAppID(val string) attribute.KeyValue {
return HerokuAppIDKey.String(val)
}
// HerokuReleaseCommit returns an attribute KeyValue conforming to the
// "heroku.release.commit" semantic conventions. It represents the commit hash
// for the current release
func HerokuReleaseCommit(val string) attribute.KeyValue {
return HerokuReleaseCommitKey.String(val)
}
// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
// to the "heroku.release.creation_timestamp" semantic conventions. It
// represents the time and date the release was created
func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
return HerokuReleaseCreationTimestampKey.String(val)
}
// The software deployment.
const (
// DeploymentEnvironmentKey is the attribute Key conforming to the
// "deployment.environment" semantic conventions. It represents the name of
// the [deployment
// environment](https://wikipedia.org/wiki/Deployment_environment) (aka
// deployment tier).
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: 'staging', 'production'
DeploymentEnvironmentKey = attribute.Key("deployment.environment")
)
// DeploymentEnvironment returns an attribute KeyValue conforming to the
// "deployment.environment" semantic conventions. It represents the name of the
// [deployment environment](https://wikipedia.org/wiki/Deployment_environment)
// (aka deployment tier).
func DeploymentEnvironment(val string) attribute.KeyValue {
return DeploymentEnvironmentKey.String(val)
}
// The device on which the process represented by this resource is running.
const (
// DeviceIDKey is the attribute Key conforming to the "device.id" semantic
// conventions. It represents a unique identifier representing the device
//
// Type: string
// RequirementLevel: Optional
// Stability: experimental
// Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
// Note: The device identifier MUST only be defined using the values
// outlined below. This value is not an advertising identifier and MUST NOT
// be used as such. On iOS (Swift or Objective-C), this value MUST be equal
// to the [vendor
// identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
// On Android (Java or Kotlin), this value MUST be equal to the Firebase
// Installation ID or a globally unique UUID which is persisted across
// sessions in your application. More information can be found
// [here](https://developer.android.com/training/articles/user-data-ids) on
// best practices and exact implementation details. Caution should be taken
// when storing personal data or anything which can identify a user. GDPR
// and data protection laws may apply, ensure you do your own due
// diligence.
DeviceIDKey = attribute.Key("device.id")
// DeviceManufacturerKey is the attribute Key conforming to the
// "device.manufacturer" semantic conventions. It represents the name of