diff --git a/go.mod b/go.mod index 552f4acfe..ba2a3cbcb 100644 --- a/go.mod +++ b/go.mod @@ -35,15 +35,15 @@ require ( go.mongodb.org/mongo-driver/v2 v2.2.2 go.opentelemetry.io/auto/sdk v1.1.0 go.opentelemetry.io/collector/component v1.36.1 - go.opentelemetry.io/collector/config/configgrpc v0.128.0 - go.opentelemetry.io/collector/config/confighttp v0.128.0 + go.opentelemetry.io/collector/config/configgrpc v0.130.1 + go.opentelemetry.io/collector/config/confighttp v0.130.1 go.opentelemetry.io/collector/config/configopaque v1.36.1 - go.opentelemetry.io/collector/config/configretry v1.34.0 - go.opentelemetry.io/collector/config/configtls v1.34.0 - go.opentelemetry.io/collector/consumer v1.34.0 - go.opentelemetry.io/collector/exporter v0.128.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.128.0 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.128.0 + go.opentelemetry.io/collector/config/configretry v1.36.1 + go.opentelemetry.io/collector/config/configtls v1.36.1 + go.opentelemetry.io/collector/consumer v1.36.1 + go.opentelemetry.io/collector/exporter v0.130.1 + go.opentelemetry.io/collector/exporter/otlpexporter v0.130.1 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.130.1 go.opentelemetry.io/collector/pdata v1.36.1 go.opentelemetry.io/contrib/detectors/aws/ec2 v1.28.0 go.opentelemetry.io/contrib/detectors/aws/eks v1.28.0 @@ -103,7 +103,7 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.20.0 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/go-viper/mapstructure/v2 v2.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v1.0.0 // indirect github.com/google/btree v1.1.3 // indirect @@ -118,7 +118,7 @@ require ( github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/knadh/koanf/maps v0.1.2 // indirect github.com/knadh/koanf/providers/confmap v1.0.0 // indirect - github.com/knadh/koanf/v2 v2.2.0 // indirect + github.com/knadh/koanf/v2 v2.2.1 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -146,30 +146,32 @@ require ( github.com/vishvananda/netns v0.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector v0.128.0 // indirect - go.opentelemetry.io/collector/client v1.34.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.128.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.34.0 // indirect - go.opentelemetry.io/collector/config/configmiddleware v0.128.0 // indirect - go.opentelemetry.io/collector/config/confignet v1.34.0 // indirect - go.opentelemetry.io/collector/confmap v1.34.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.128.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.128.0 // indirect - go.opentelemetry.io/collector/consumer/xconsumer v0.128.0 // indirect - go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.128.0 // indirect - go.opentelemetry.io/collector/exporter/xexporter v0.128.0 // indirect - go.opentelemetry.io/collector/extension v1.34.0 // indirect - go.opentelemetry.io/collector/extension/extensionauth v1.34.0 // indirect - go.opentelemetry.io/collector/extension/extensionmiddleware v0.128.0 // indirect - go.opentelemetry.io/collector/extension/xextension v0.128.0 // indirect + go.opentelemetry.io/collector v0.130.1 // indirect + go.opentelemetry.io/collector/client v1.36.1 // indirect + go.opentelemetry.io/collector/config/configauth v0.130.1 // indirect + go.opentelemetry.io/collector/config/configcompression v1.36.1 // indirect + go.opentelemetry.io/collector/config/configmiddleware v0.130.1 // indirect + go.opentelemetry.io/collector/config/confignet v1.36.1 // indirect + go.opentelemetry.io/collector/config/configoptional v0.130.1 // indirect + go.opentelemetry.io/collector/confmap v1.36.1 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.130.1 // indirect + go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.130.1 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.130.1 // indirect + go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.130.1 // indirect + go.opentelemetry.io/collector/exporter/xexporter v0.130.1 // indirect + go.opentelemetry.io/collector/extension v1.36.1 // indirect + go.opentelemetry.io/collector/extension/extensionauth v1.36.1 // indirect + go.opentelemetry.io/collector/extension/extensionmiddleware v0.130.1 // indirect + go.opentelemetry.io/collector/extension/xextension v0.130.1 // indirect go.opentelemetry.io/collector/featuregate v1.36.1 // indirect go.opentelemetry.io/collector/internal/telemetry v0.130.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.128.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.130.1 // indirect + go.opentelemetry.io/collector/pdata/xpdata v0.130.1 // indirect go.opentelemetry.io/collector/pipeline v0.130.1 // indirect - go.opentelemetry.io/collector/pipeline/xpipeline v0.128.0 // indirect + go.opentelemetry.io/collector/pipeline/xpipeline v0.130.1 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect @@ -183,7 +185,7 @@ require ( golang.org/x/time v0.9.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect k8s.io/apiextensions-apiserver v0.33.0 // indirect diff --git a/go.sum b/go.sum index b32a08642..efd44a3a3 100644 --- a/go.sum +++ b/go.sum @@ -87,8 +87,8 @@ github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6 h1:teYtXy9B7y5 github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6/go.mod h1:p4lGIVX+8Wa6ZPNDvqcxq36XpUDLh42FLetFU7odllI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= +github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= @@ -157,8 +157,8 @@ github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpb github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v1.0.0 h1:mHKLJTE7iXEys6deO5p6olAiZdG5zwp8Aebir+/EaRE= github.com/knadh/koanf/providers/confmap v1.0.0/go.mod h1:txHYHiI2hAtF0/0sCmcuol4IDcuQbKTybiB1nOcUo1A= -github.com/knadh/koanf/v2 v2.2.0 h1:FZFwd9bUjpb8DyCWARUBy5ovuhDs1lI87dOEn2K8UVU= -github.com/knadh/koanf/v2 v2.2.0/go.mod h1:PSFru3ufQgTsI7IF+95rf9s8XA1+aHxKuO/W+dPoHEY= +github.com/knadh/koanf/v2 v2.2.1 h1:jaleChtw85y3UdBnI0wCqcg1sj1gPoz6D3caGNHtrNE= +github.com/knadh/koanf/v2 v2.2.1/go.mod h1:PSFru3ufQgTsI7IF+95rf9s8XA1+aHxKuO/W+dPoHEY= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -275,94 +275,96 @@ go.mongodb.org/mongo-driver/v2 v2.2.2 h1:9cYuS3fl1Xhqwpfazso10V7BHQD58kCgtzhfAmJ go.mongodb.org/mongo-driver/v2 v2.2.2/go.mod h1:qQkDMhCGWl3FN509DfdPd4GRBLU/41zqF/k8eTRceps= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/collector v0.128.0 h1:HtOLtsKpGnTwicdXRk98/XyIe8MJvvmQvv2nICEPirU= -go.opentelemetry.io/collector v0.128.0/go.mod h1:OFW6Zbs4prxfO0JBYE0xw2W+i6JVyFXYjnYze6EQ3HE= -go.opentelemetry.io/collector/client v1.34.0 h1:u0s/veXnajFOuxgBCvASeEjl4KhjM3ZLcCtsrZowOJ4= -go.opentelemetry.io/collector/client v1.34.0/go.mod h1:lSm836uOWXKMZ9VlbevcwY6wLJEl7l9xqhEySNcmtL8= +go.opentelemetry.io/collector v0.130.1 h1:b8LooHSKcabDuSu+Ch4OALpNdnzi/DQ8OOQ2qgxA3sg= +go.opentelemetry.io/collector v0.130.1/go.mod h1:xK+smJWmW4NKMjLAe5/nNIhnZji0T8B0QXKTMz79YPY= +go.opentelemetry.io/collector/client v1.36.1 h1:3A2m3yPd86+xuT/9OtzkI7bQ4c21UnT8KJnXiv+gZtU= +go.opentelemetry.io/collector/client v1.36.1/go.mod h1:VITlg33x2jkeJmYMjLnNlpClt76iE8pJzKdYEtEOiQA= go.opentelemetry.io/collector/component v1.36.1 h1:Xcji++1ANq31KuG6/YTn4vPmFZw1n/vJ+eBaFx+zVZU= go.opentelemetry.io/collector/component v1.36.1/go.mod h1:d/nPfiO3ebliIJkONUZrLAHzXpRNlNt/FHGXaDenVhM= -go.opentelemetry.io/collector/component/componenttest v0.128.0 h1:MGNh5lQQ0Qmz2SmNwOqLJYaWMDkMLYj/51wjMzTBR34= -go.opentelemetry.io/collector/component/componenttest v0.128.0/go.mod h1:hALNxcacqOaX/Gm/dE7sNOxAEFj41SbRqtvF57Yd6gs= -go.opentelemetry.io/collector/config/configauth v0.128.0 h1:YVUgEWq05IFbzanJKKl6vk+AgIQhmxfMmBDis9LX4/I= -go.opentelemetry.io/collector/config/configauth v0.128.0/go.mod h1:VJHJBe/CrJ3MevPv1snPYjNZZHTzPPD0hfzVKXnMG3s= -go.opentelemetry.io/collector/config/configcompression v1.34.0 h1:QA6PbCtLZipspTomCl3ev4yhf7q3tlLSV5BH3Leeka0= -go.opentelemetry.io/collector/config/configcompression v1.34.0/go.mod h1:QwbNpaOl6Me+wd0EdFuEJg0Cc+WR42HNjJtdq4TwE6w= -go.opentelemetry.io/collector/config/configgrpc v0.128.0 h1:DtnN9fhcUXDXIyczSw0lx+2l6VR2NDFLTMcWP8bZXtY= -go.opentelemetry.io/collector/config/configgrpc v0.128.0/go.mod h1:X0BqYRIJhcmNf+ff3LF2XnDHNUZuRbZq6YW4T6oey28= -go.opentelemetry.io/collector/config/confighttp v0.128.0 h1:6Vdb49BJdFMdavZK1SzpsHs9Jh29L+ztILBoe0F6eao= -go.opentelemetry.io/collector/config/confighttp v0.128.0/go.mod h1:jfnhLajGunKwssD8Um3Mxwr0u+3lSooPBVY0mAB8QeY= -go.opentelemetry.io/collector/config/configmiddleware v0.128.0 h1:lA4m7owk1vemLHMO9Robgz70adm8Aophj6kkU6rcAdY= -go.opentelemetry.io/collector/config/configmiddleware v0.128.0/go.mod h1:Zj9uYmuUbYOEP+Y4nakW77+YA25Xdk53ClfQuKfe8I8= -go.opentelemetry.io/collector/config/confignet v1.34.0 h1:SX0q5IuuK8k/K7++t7aglvfdSXRL92LOqnA33y/RlHk= -go.opentelemetry.io/collector/config/confignet v1.34.0/go.mod h1:HgpLwdRLzPTwbjpUXR0Wdt6pAHuYzaIr8t4yECKrEvo= -go.opentelemetry.io/collector/config/configopaque v1.34.0 h1:nGEW5IiKwfsRcA5Shyd1/4pjlxSdK9OXYq0DeGN08Oo= -go.opentelemetry.io/collector/config/configopaque v1.34.0/go.mod h1:rw0/X78O8cOk0dhACqNbdiKk1PF7z7mwq9wgSpWoqgs= +go.opentelemetry.io/collector/component/componenttest v0.130.1 h1:dWgl3zE1v6LbP97Mx7Feh5KBV2pxHpQGmmX0LhkSd0Y= +go.opentelemetry.io/collector/component/componenttest v0.130.1/go.mod h1:LyNOhxRbztVmmBtYmiDcCzmUcgQW7OKJ+y8n+Co7Prk= +go.opentelemetry.io/collector/config/configauth v0.130.1 h1:aaEgZuA0XIO/eeA5tpQL0N8K3Dl13ZcwU8KxN9bwIoc= +go.opentelemetry.io/collector/config/configauth v0.130.1/go.mod h1:F9fj9Wd4ahzNC/JBrzfy2huVTSfynfW3Q92wXSEA3A0= +go.opentelemetry.io/collector/config/configcompression v1.36.1 h1:d2DNhfatM79mCs4sh+faVIiG0qWAHb2DAW55a4B3FQE= +go.opentelemetry.io/collector/config/configcompression v1.36.1/go.mod h1:QwbNpaOl6Me+wd0EdFuEJg0Cc+WR42HNjJtdq4TwE6w= +go.opentelemetry.io/collector/config/configgrpc v0.130.1 h1:forODlU6dNCnV+ND3x38GKoBn/twPsoPzMA+OGGeFCQ= +go.opentelemetry.io/collector/config/configgrpc v0.130.1/go.mod h1:TRkmjkIcH6ein3lnEAkAcqHAi+DYbt2aKurJHU5dDP8= +go.opentelemetry.io/collector/config/confighttp v0.130.1 h1:h0D3yaKO2782xQg15oqkyei7ZYaJzrcJUeYIiITAwjo= +go.opentelemetry.io/collector/config/confighttp v0.130.1/go.mod h1:5uQmDBhW/vOiT82nrLI8LETwO0/o/W/p5ETxQMF1qsA= +go.opentelemetry.io/collector/config/configmiddleware v0.130.1 h1:HEbGEtMp/2LCHYiKqZU0U5tV95oEkRHZoUed4w6l8YY= +go.opentelemetry.io/collector/config/configmiddleware v0.130.1/go.mod h1:ohGuhJJv3lWCVSM7pRAnhX1Uxfj1+96ROfN5fx4uJmY= +go.opentelemetry.io/collector/config/confignet v1.36.1 h1:lPXkemqgCWJzg9JvW3Ufmykaj4ljR1G61siGBEcGjH8= +go.opentelemetry.io/collector/config/confignet v1.36.1/go.mod h1:HgpLwdRLzPTwbjpUXR0Wdt6pAHuYzaIr8t4yECKrEvo= go.opentelemetry.io/collector/config/configopaque v1.36.1 h1:obuLRtK16jnRe6a3deCahYFgFz3r75Kpffe0EZK5lFI= go.opentelemetry.io/collector/config/configopaque v1.36.1/go.mod h1:aAOmM/mSWE2F3A58x4MUw1bYW8TIjVxn5/WfgxRgMu0= -go.opentelemetry.io/collector/config/configretry v1.34.0 h1:ixezwJ2Y0pZiETbXq5lDmQfRDH7AKzaBjRsobxhcDl8= -go.opentelemetry.io/collector/config/configretry v1.34.0/go.mod h1:QNnb+MCk7aS1k2EuGJMtlNCltzD7b8uC7Xel0Dxm1wQ= -go.opentelemetry.io/collector/config/configtls v1.34.0 h1:1y87S3dH7sAD7WoDMfCQpQ69vWJr3Ml5aOJls8BBlhs= -go.opentelemetry.io/collector/config/configtls v1.34.0/go.mod h1:Rrvz1sQSDRsmqsX9J8M7v6NoC/R5F+LP+YsnDhLbvdI= -go.opentelemetry.io/collector/confmap v1.34.0 h1:PG4sYlLxgCMnA5F7daKXZV+NKjU1IzXBzVQeyvcwyh0= -go.opentelemetry.io/collector/confmap v1.34.0/go.mod h1:BbAit8+hAJg5vyFBQoDh9vOXOH8UzCdNu91jCh+b72E= -go.opentelemetry.io/collector/confmap/xconfmap v0.128.0 h1:hcVKU45pjC+PLz7xUc8kwSlR5wsN2w8hs9midZ3ez10= -go.opentelemetry.io/collector/confmap/xconfmap v0.128.0/go.mod h1:2928x4NAAu1CysfzLbEJE6MSSDB/gOYVq6YRGWY9LmM= -go.opentelemetry.io/collector/consumer v1.34.0 h1:oBhHH6mgViOGhVDPozE+sUdt7jFBo2Hh32lsSr2L3Tc= -go.opentelemetry.io/collector/consumer v1.34.0/go.mod h1:DVMCb56ZBlPNcmo0lSJKn3rp18oyZQCedRE4GKIMI+Q= -go.opentelemetry.io/collector/consumer/consumererror v0.128.0 h1:3htkWoHwXZ801ORmGeORdcMGqJHEbwdjaWhIj4LNbxw= -go.opentelemetry.io/collector/consumer/consumererror v0.128.0/go.mod h1:v3eUnvuIBSV2yBWiWoZELV1jki7HFMttWeBF311XIU0= -go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.128.0 h1:ik3q+Lc3a27cuqwQEbaBYjltOQjH6o36rXrduWgbogw= -go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.128.0/go.mod h1:mL3nBJzYiJCidzfyOMvOy0gTbiN9+mYg8RNlsZshgNI= -go.opentelemetry.io/collector/consumer/consumertest v0.128.0 h1:x50GB0I/QvU3sQuNCap5z/P2cnq2yHoRJ/8awkiT87w= -go.opentelemetry.io/collector/consumer/consumertest v0.128.0/go.mod h1:Wb3IAbMY/DOIwJPy81PuBiW2GnKoNIz4THE7wfJwovE= -go.opentelemetry.io/collector/consumer/xconsumer v0.128.0 h1:4E+KTdCjkRS3SIw0bsv5kpv9XFXHf8x9YiPEuxBVEHY= -go.opentelemetry.io/collector/consumer/xconsumer v0.128.0/go.mod h1:OmzilL/qbjCzPMHay+WEA7/cPe5xuX7Jbj5WPIpqaMo= -go.opentelemetry.io/collector/exporter v0.128.0 h1:pakG0S7pYNrsn6BekK+65lW3Nwk8+RSEfImJ4yRnm20= -go.opentelemetry.io/collector/exporter v0.128.0/go.mod h1:tm//SthYM/wi4ytmZi952E3TaL0pt3PUmEZrtTOszP4= -go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.128.0 h1:7Y8XIEtfBSbuQcoOKxU51jTarwlEJxS5FXvDC42QiKM= -go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.128.0/go.mod h1:AQYR1OqioODfrIAbKFoS18HbOeAyw3/mbHBB5Ue9rgI= -go.opentelemetry.io/collector/exporter/exportertest v0.128.0 h1:0fFdDuZZe5Fw4VvuzSSFx/WVoYZc9bQHJqds9IwA6O8= -go.opentelemetry.io/collector/exporter/exportertest v0.128.0/go.mod h1:yu7HDFG00f25I6EhvxHm9JmDZiuF6fyNwtqBhyjdFX8= -go.opentelemetry.io/collector/exporter/otlpexporter v0.128.0 h1:njMh1mjJimM/ctyECLRbBX9DmwM8FIikiMMg5hQHnmk= -go.opentelemetry.io/collector/exporter/otlpexporter v0.128.0/go.mod h1:iv/ttkJ6p2kbAVY1D5r8qqCO278QDyBxidgIh3ldWWM= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.128.0 h1:57HjnnCm7DLKOahB5/v7fwDEW+fn+Xy+2TE4k0r5fyc= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.128.0/go.mod h1:JovnIiCbmVmxMrl4vEqQPyYNKozoX46J+2qF+VXF4EY= -go.opentelemetry.io/collector/exporter/xexporter v0.128.0 h1:Dpa8J2ERD/qUjW993b9+g5K+zg1Nw6UaZg0GcuRJW/E= -go.opentelemetry.io/collector/exporter/xexporter v0.128.0/go.mod h1:fZF/9KkxT744S04YYzIZ5F/fo9l6i8Q5VHgLIi0UCWU= -go.opentelemetry.io/collector/extension v1.34.0 h1:mWJH1XKojCl1Y8htfk3LumyywjQPsG0Ay+7cZdPAfA8= -go.opentelemetry.io/collector/extension v1.34.0/go.mod h1:hIw5M0Ops3iHDORmPE9FnFFzNByth+YzFeUiW06cfpk= -go.opentelemetry.io/collector/extension/extensionauth v1.34.0 h1:vyVYuZCoulRNCwm5RcJNg+IHLI3glz3/Vra9q62otIE= -go.opentelemetry.io/collector/extension/extensionauth v1.34.0/go.mod h1:m2fCMKOwJkj1/NNNh8PioCc6SgvjHpnsBFk9pR5XFZM= -go.opentelemetry.io/collector/extension/extensionauth/extensionauthtest v0.128.0 h1:WS9OGBiWw3BOBKAIgzvKo73RvGO5GO7UqReH7bVG73w= -go.opentelemetry.io/collector/extension/extensionauth/extensionauthtest v0.128.0/go.mod h1:Cy/uT2lk4xRyd/mlUPwZaEBwLy/xiTcd8tLtRMsMjbA= -go.opentelemetry.io/collector/extension/extensionmiddleware v0.128.0 h1:WqXFWdepDvb+D7s9upaJNG5OmZPWyTw0Ww5CqSRhPk8= -go.opentelemetry.io/collector/extension/extensionmiddleware v0.128.0/go.mod h1:QgNPIB0EK6u06YmILuuT+CejXZNeRMEBtLpbInh45+w= -go.opentelemetry.io/collector/extension/extensionmiddleware/extensionmiddlewaretest v0.128.0 h1:glt5Lg/dhhyOF/JkrMgwqCFcI/Lc55HuI8yQmxaPKZw= -go.opentelemetry.io/collector/extension/extensionmiddleware/extensionmiddlewaretest v0.128.0/go.mod h1:sRivd8Edtsh0gbzsTFTqKokJi0HyZMwuCMZVkbNPD3s= -go.opentelemetry.io/collector/extension/extensiontest v0.128.0 h1:ghvMDdP6EeXXyB4pFOzQL4jdtfSQ5uSDYVL2FMNREoI= -go.opentelemetry.io/collector/extension/extensiontest v0.128.0/go.mod h1:NKaPm41Tl23QZzHPLDItYP9GaVGeV9yE8GQzEpW2qhw= -go.opentelemetry.io/collector/extension/xextension v0.128.0 h1:4Hih4QiPsXz5RdFAaa57yanTTdkWNLHilq/XwAe/iuA= -go.opentelemetry.io/collector/extension/xextension v0.128.0/go.mod h1:9QQDN6M1ffx/+z6NKlnxAIBa2EBTAv//BpShkeWce1I= +go.opentelemetry.io/collector/config/configoptional v0.130.1 h1:zpZHon8X0gu4OnHI0nMRvL4rP3bL3t2qz1K8wLtaCEA= +go.opentelemetry.io/collector/config/configoptional v0.130.1/go.mod h1:XfTo/57KIeaoP8S9yKL1YEmgVx/fdpe2yLjHGtp/XH0= +go.opentelemetry.io/collector/config/configretry v1.36.1 h1:y/iP9Z4BqxoGOE6T0tHneJI/iAaGexTecK5V/yPnkbM= +go.opentelemetry.io/collector/config/configretry v1.36.1/go.mod h1:QNnb+MCk7aS1k2EuGJMtlNCltzD7b8uC7Xel0Dxm1wQ= +go.opentelemetry.io/collector/config/configtls v1.36.1 h1:YkuW9p+8QK8iD0WayL+gDJPrhSR11gIlFGsyjDCGaIo= +go.opentelemetry.io/collector/config/configtls v1.36.1/go.mod h1:VP1hlkYEB5JM4U9FSAFo4fxWNLFJhrcINhxNfcGeHKY= +go.opentelemetry.io/collector/confmap v1.36.1 h1:N2aBXvyXqVI+XYosMGZxCXyj6atFdbToXM8m9x3nooo= +go.opentelemetry.io/collector/confmap v1.36.1/go.mod h1:u6QC2nwM6QGPzQdMvnUVbDrSjQ97PaYg0eAXg5ZsS+w= +go.opentelemetry.io/collector/confmap/xconfmap v0.130.1 h1:+gUicmuxq6O5KyQbapsmC19BXnUWb4awR0JejAv0ofc= +go.opentelemetry.io/collector/confmap/xconfmap v0.130.1/go.mod h1:5z3P2HAvNCDCF/vslNRb7b2GVvDRHXWLyHmbUDwQ02g= +go.opentelemetry.io/collector/consumer v1.36.1 h1:3CDT0ULrz5pubILy6gw60cwbQk6zYT/MDurpHiTiGBs= +go.opentelemetry.io/collector/consumer v1.36.1/go.mod h1:Rg8uh3HaCCx62pD7S1flAzhTdScxRQTMJ/wheQo7GZo= +go.opentelemetry.io/collector/consumer/consumererror v0.130.1 h1:HnU8S2QovWw434sTlDk+pwcOkQFtSO76tICArcs/zHk= +go.opentelemetry.io/collector/consumer/consumererror v0.130.1/go.mod h1:pyGcuNGLZyffwQhmRUuf16AzM0NUElZvBdgj2ZhVYMA= +go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.130.1 h1:KeZNaVYdHwd/zyxkQ1w3tWrJ5zHvcw3coft2g/5KNZg= +go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.130.1/go.mod h1:b511xy1FeU1NAFKIyLVNGJyZTNMeQn3qxvJMX8y8Zls= +go.opentelemetry.io/collector/consumer/consumertest v0.130.1 h1:MndLog7rcAFISUaDt3lmDfUdUG+F2WVmSJVsDBYzQho= +go.opentelemetry.io/collector/consumer/consumertest v0.130.1/go.mod h1:eK9TDF/wboD6jZoxHObOHs/Kblqz1GcMqdtcV5BWNOM= +go.opentelemetry.io/collector/consumer/xconsumer v0.130.1 h1:XTDy++sUTE1GSkawMcJRssiEm5gQCERb/JXsDqn9pAM= +go.opentelemetry.io/collector/consumer/xconsumer v0.130.1/go.mod h1:YJDjstWRLGeUwHi5Dev+OmnKDns4HBbrfrAj1qP1ZmU= +go.opentelemetry.io/collector/exporter v0.130.1 h1:hzJA1/DTylDCREeCRKAozmyh8rODaB9f1RbXROO+aKA= +go.opentelemetry.io/collector/exporter v0.130.1/go.mod h1:eZoSQLz5lnyyHgyBTOXhabvmyawP50frsYyfyvKT9EY= +go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.130.1 h1:dxBTJPd6Y2uTRjQKBaKzA5FsPfhb3PErC32R5waWvqs= +go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.130.1/go.mod h1:nElfMQuLbbs92cs1yNleCS49zsh+B5eun4JFJT2n3jc= +go.opentelemetry.io/collector/exporter/exportertest v0.130.1 h1:cCG38CzE0IYnAbs+5L3vUjieO0wAU+zDABKhPFGd0yI= +go.opentelemetry.io/collector/exporter/exportertest v0.130.1/go.mod h1:AVMi+ZW9hOC2LkbXsVIQ6t7GDVeKyBSgaQO9yxmvuqg= +go.opentelemetry.io/collector/exporter/otlpexporter v0.130.1 h1:TM1lbvai7NUpvnFebhY/ZF9vGQvLKIQF0u+AJJ2/7tw= +go.opentelemetry.io/collector/exporter/otlpexporter v0.130.1/go.mod h1:rAuL1DjVX2URdTxQjWcJe75jQSdsOohiBWLV51H8Lj8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.130.1 h1:jF9GClXAoTIBQJHw2EAf9CrhQYryvk8Npa7/T9o5yQ4= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.130.1/go.mod h1:mOE4DkGKAvKcg+7eA/kTHsKI7uSHfWoz9b7+DjDfSzs= +go.opentelemetry.io/collector/exporter/xexporter v0.130.1 h1:IcNFpAGywDXJiYNgffjpgqCrICTkvpT14c+wLTykFwU= +go.opentelemetry.io/collector/exporter/xexporter v0.130.1/go.mod h1:Wnlxqh1WNPpsSd6wdHv+X7nj/rXq9wEJ+eK31t7jTBA= +go.opentelemetry.io/collector/extension v1.36.1 h1:7ggGDCQ3Tqo+X4DXX0ho7e7w/41XzpQL+fsYnK3soYk= +go.opentelemetry.io/collector/extension v1.36.1/go.mod h1:Y8inyfw2dgxuQz4r5da2iEJMBx99O+mD4JvS/7qQceM= +go.opentelemetry.io/collector/extension/extensionauth v1.36.1 h1:SP36WJ7obbF1JXNEqE8j7RE3+BbfW29PF/bmsOnWt0s= +go.opentelemetry.io/collector/extension/extensionauth v1.36.1/go.mod h1:bjGAFwd0pjtPbevALtgazGWfHAoOzGr+e/oP5NjAGv4= +go.opentelemetry.io/collector/extension/extensionauth/extensionauthtest v0.130.1 h1:QymPzU4jrVpNTrCyAk0Iws3dixNCcd+phJYIA7Qb2so= +go.opentelemetry.io/collector/extension/extensionauth/extensionauthtest v0.130.1/go.mod h1:IhlK/Eyh3X8jPFWW2+soKB7wXnkKOluUeUafh8hgRKs= +go.opentelemetry.io/collector/extension/extensionmiddleware v0.130.1 h1:Q7sPCLM786IhRJEohRSKsnGBYuX/+lnLvifqysDUY9M= +go.opentelemetry.io/collector/extension/extensionmiddleware v0.130.1/go.mod h1:xc1VLLUebuxPAdKCDopohorTZifokuwFfdvPINmx/GQ= +go.opentelemetry.io/collector/extension/extensionmiddleware/extensionmiddlewaretest v0.130.1 h1:l5R281ydhl21RAaaAZCr4haQnU0zb5Yhi8TPCMFUcK8= +go.opentelemetry.io/collector/extension/extensionmiddleware/extensionmiddlewaretest v0.130.1/go.mod h1:rClshWvVxQBmtcHKUqlgkfxSbMP/UOLXdTXj04WWjPU= +go.opentelemetry.io/collector/extension/extensiontest v0.130.1 h1:nr8iF7JTDmceAGQ5N+GHpjgMmm8L0N2JC1W6MmV4SY8= +go.opentelemetry.io/collector/extension/extensiontest v0.130.1/go.mod h1:K6U2Nyz8apDvETf7SfDgLNHKjjhaasLbFRmIx9HCiqI= +go.opentelemetry.io/collector/extension/xextension v0.130.1 h1:ygEs3vS+m05zAxJtfy876jOPkJWLN7LZof5lqH3tvw0= +go.opentelemetry.io/collector/extension/xextension v0.130.1/go.mod h1:xLkHn8OjenNZR+AN17/zYokORmX+yz5M3gOZijSmi4Q= go.opentelemetry.io/collector/featuregate v1.36.1 h1:E/Fo8pkmlZlolwWKZxT1uuybHPiLem0TWHNUwt/a7v4= go.opentelemetry.io/collector/featuregate v1.36.1/go.mod h1:Y/KsHbvREENKvvN9RlpiWk/IGBK+CATBYzIIpU7nccc= go.opentelemetry.io/collector/internal/telemetry v0.130.1 h1:IWCkiA2bjR1HzWjX7zgUxfQo4Z5DbO65p4JqbOL2MSM= go.opentelemetry.io/collector/internal/telemetry v0.130.1/go.mod h1:QWpQOh7Xm0gF8GojWc0PXFFtSP0VSRFpQb0nIsRk0rA= go.opentelemetry.io/collector/pdata v1.36.1 h1:aE8TWqjrVbJE8ExayBwJrNaLejYKDjsYs1uG4zSRPWc= go.opentelemetry.io/collector/pdata v1.36.1/go.mod h1:pttpb089864qG1k0DMeXLgwwTFLk+o3fAW9I6MF9tzw= -go.opentelemetry.io/collector/pdata/pprofile v0.128.0 h1:6DEtzs/liqv/ukz2EHbC5OMaj2V6K2pzuj/LaRg2YmY= -go.opentelemetry.io/collector/pdata/pprofile v0.128.0/go.mod h1:bVVRpz+zKFf1UCCRUFqy8LvnO3tHlXKkdqW2d+Wi/iA= -go.opentelemetry.io/collector/pdata/testdata v0.128.0 h1:5xcsMtyzvb18AnS2skVtWreQP1nl6G3PiXaylKCZ6pA= -go.opentelemetry.io/collector/pdata/testdata v0.128.0/go.mod h1:9/VYVgzv3JMuIyo19KsT3FwkVyxbh3Eg5QlabQEUczA= +go.opentelemetry.io/collector/pdata/pprofile v0.130.1 h1:JHas1hUr36jhMCsGZ/EPLxBFeVnov3CWOqsdp8znUng= +go.opentelemetry.io/collector/pdata/pprofile v0.130.1/go.mod h1:9xniy+zXcGfzAydAPju8rx4orG6sXup2k1smsGI06e8= +go.opentelemetry.io/collector/pdata/testdata v0.130.1 h1:JFoGD2GSeLS+bBy3BBz+INm+lR3S09TZnpoGaXqwkg4= +go.opentelemetry.io/collector/pdata/testdata v0.130.1/go.mod h1:PXhFHhRA6ndyODxIf4tg73Np6sG6e2x5l/b6WXmZQCw= +go.opentelemetry.io/collector/pdata/xpdata v0.130.1 h1:x34+r46FyKUHYjzFZYqrsFp52RUTPgZCTL8YzCrDN7w= +go.opentelemetry.io/collector/pdata/xpdata v0.130.1/go.mod h1:QW//7bmm97lI5kaYlOvXbVNtm9Fc3BIlvf3rT4moo8k= go.opentelemetry.io/collector/pipeline v0.130.1 h1:LgcvTvaVYQ1RUfrJHTdo+Oh3ydnzGBwaFvHgCMx9wKQ= go.opentelemetry.io/collector/pipeline v0.130.1/go.mod h1:TO02zju/K6E+oFIOdi372Wk0MXd+Szy72zcTsFQwXl4= -go.opentelemetry.io/collector/pipeline/xpipeline v0.128.0 h1:PYVPnPYW5PUC52fNGvRvDq5HfuZz9DsUsq8hETq+J/8= -go.opentelemetry.io/collector/pipeline/xpipeline v0.128.0/go.mod h1:WAATwF9T15iI/TLp1A50Od/dQ0SD2aN0iVIAVYd9SnU= -go.opentelemetry.io/collector/receiver v1.34.0 h1:un6iRBXZBz1zacEmyfDCVDDaBY4GP3TQLwor894fywg= -go.opentelemetry.io/collector/receiver v1.34.0/go.mod h1:4J9xhbXJiI/rYlvlMTskXRGbwFeczJiCkW5R2YfTe88= -go.opentelemetry.io/collector/receiver/receivertest v0.128.0 h1:lIWzLAeo7EssZ9d1t6CJvCN2imoM4Fj+9HSbEZ54fBw= -go.opentelemetry.io/collector/receiver/receivertest v0.128.0/go.mod h1:1aX38R6cYe2nfw5rYW6dbHwjtUjs8z2MxrfHbXBddx8= -go.opentelemetry.io/collector/receiver/xreceiver v0.128.0 h1:1C5vlkyacvuGJkn5J78FpnuF3AlVYMmA0TGF3LPfcZI= -go.opentelemetry.io/collector/receiver/xreceiver v0.128.0/go.mod h1:kut2p3qChyX8K/qhsokae1vgLQAn53i2J5ddsvxJ81s= +go.opentelemetry.io/collector/pipeline/xpipeline v0.130.1 h1:jhtdrRSTPBPU8gf720YrEdo/tJZiafwXW5oHSZ0oWPo= +go.opentelemetry.io/collector/pipeline/xpipeline v0.130.1/go.mod h1:wDOyK1D1yhbndHglr27DLPw2+CLSPRz0EOnpPOvYwog= +go.opentelemetry.io/collector/receiver v1.36.1 h1:ZbICeR+3QtcnEjne7zZr20Ckply+NfojSCG2w6dSyjQ= +go.opentelemetry.io/collector/receiver v1.36.1/go.mod h1:GH2kVvYQLDCJpSMHVHRuaKT35YLPGcRfyYKNeUjjvqU= +go.opentelemetry.io/collector/receiver/receivertest v0.130.1 h1:psTbKMn/Xl+p+Vr2IaMg9T/MEyh/YJ9Luj9JJLbAwac= +go.opentelemetry.io/collector/receiver/receivertest v0.130.1/go.mod h1:gEW9dpBWvCu6lrcHW+73T32wZCGdYt4F+URmZZf2dzU= +go.opentelemetry.io/collector/receiver/xreceiver v0.130.1 h1:hYHGAPLpfYUkpqV83QXytui/+E3n56uKIDK+GZQrPAg= +go.opentelemetry.io/collector/receiver/xreceiver v0.130.1/go.mod h1:Al/3Vz1O33PDA9zO+TiqmyLM7h7pIvApXC1fwDwBxqw= go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 h1:FGre0nZh5BSw7G73VpT3xs38HchsfPsa2aZtMp0NPOs= go.opentelemetry.io/contrib/bridges/otelzap v0.12.0/go.mod h1:X2PYPViI2wTPIMIOBjG17KNybTzsrATnvPJ02kkz7LM= go.opentelemetry.io/contrib/detectors/aws/ec2 v1.28.0 h1:d+y/wygENfwEbVpo7c3A9GfnMhoTiepQcthQSh+Mc9g= @@ -373,10 +375,10 @@ go.opentelemetry.io/contrib/detectors/azure/azurevm v0.0.1 h1:hgKJ88bL5cTomIlP7V go.opentelemetry.io/contrib/detectors/azure/azurevm v0.0.1/go.mod h1:nmQyKaRlFYOboU/JGyRb1/9eLpuKYmTFd+rDjrIZTKk= go.opentelemetry.io/contrib/detectors/gcp v1.35.0 h1:bGvFt68+KTiAKFlacHW6AhA56GF2rS0bdD3aJYEnmzA= go.opentelemetry.io/contrib/detectors/gcp v1.35.0/go.mod h1:qGWP8/+ILwMRIUf9uIVLloR1uo5ZYAslM4O6OqUi1DA= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 h1:rbRJ8BBoVMsQShESYZ0FkvcITu8X8QNwJogcLUmDNNw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0/go.mod h1:ru6KHrNtNHxM4nD/vd6QrLVWgKhxPYgblq4VAtNawTQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY= go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 h1:ajl4QczuJVA2TU9W9AGw++86Xga/RKt//16z/yxPgdk= @@ -413,8 +415,6 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= -go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE= -go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -477,8 +477,8 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 h1:cJfm9zPbe1e873mHJzmQ1nwVEeRDU/T1wXDK2kUSU34= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= diff --git a/pkg/components/pipe/instrumenter_test.go b/pkg/components/pipe/instrumenter_test.go index 97bde1e96..f95b4895d 100644 --- a/pkg/components/pipe/instrumenter_test.go +++ b/pkg/components/pipe/instrumenter_test.go @@ -153,6 +153,7 @@ func TestTracerPipeline(t *testing.T) { gb := newGraphBuilder(&obi.Config{ Traces: otel.TracesConfig{ BatchTimeout: 10 * time.Millisecond, + MaxQueueSize: 10, TracesEndpoint: tc.ServerEndpoint, ReportersCacheLen: 16, Instrumentations: []string{instrumentations.InstrumentationALL}, @@ -168,7 +169,7 @@ func TestTracerPipeline(t *testing.T) { done := pipe.Start(ctx) - event := testutil.ReadChannel(t, tc.TraceRecords(), testTimeout) + event := testutil.ReadChannel(t, tc.TraceRecords(), 5000*testTimeout) matchInnerTraceEvent(t, "in queue", event) event = testutil.ReadChannel(t, tc.TraceRecords(), testTimeout) matchInnerTraceEvent(t, "processing", event) diff --git a/pkg/export/otel/traces.go b/pkg/export/otel/traces.go index 50634a00c..9eff20b8d 100644 --- a/pkg/export/otel/traces.go +++ b/pkg/export/otel/traces.go @@ -1,9 +1,6 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// TODO: remove this after batching API becomes stable -// -//nolint:staticcheck package otel import ( @@ -20,6 +17,8 @@ import ( "strings" "time" + "go.opentelemetry.io/collector/config/configoptional" + expirable2 "github.com/hashicorp/golang-lru/v2/expirable" "go.opentelemetry.io/otel/attribute" @@ -83,9 +82,8 @@ type TracesConfig struct { // Configuration options below this line will remain undocumented at the moment, // but can be useful for performance-tuning of some customers. - MaxExportBatchSize int `yaml:"max_export_batch_size" env:"OTEL_EBPF_OTLP_TRACES_MAX_EXPORT_BATCH_SIZE"` - MaxQueueSize int `yaml:"max_queue_size" env:"OTEL_EBPF_OTLP_TRACES_MAX_QUEUE_SIZE"` - BatchTimeout time.Duration `yaml:"batch_timeout" env:"OTEL_EBPF_OTLP_TRACES_BATCH_TIMEOUT"` + MaxQueueSize int `yaml:"max_queue_size" env:"OTEL_EBPF_OTLP_TRACES_MAX_QUEUE_SIZE"` + BatchTimeout time.Duration `yaml:"batch_timeout" env:"OTEL_EBPF_OTLP_TRACES_BATCH_TIMEOUT"` // Configuration options for BackOffConfig of the traces exporter. // See https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configretry/backoff.go @@ -355,15 +353,22 @@ func getTracesExporter(ctx context.Context, cfg TracesConfig) (exporter.Traces, } factory := otlphttpexporter.NewFactory() config := factory.CreateDefaultConfig().(*otlphttpexporter.Config) - // Experimental API for batching - // See: https://github.com/open-telemetry/opentelemetry-collector/issues/8122 - batchCfg := exporterhelper.NewDefaultBatcherConfig() + queueConfig := exporterhelper.NewDefaultQueueConfig() + queueConfig.Sizer = exporterhelper.RequestSizerTypeItems + batchCfg := exporterhelper.BatchConfig{ + Sizer: queueConfig.Sizer, + } + if cfg.MaxQueueSize > 0 || cfg.BatchTimeout > 0 { + queueConfig.Enabled = true + } if cfg.MaxQueueSize > 0 { - batchCfg.SizeConfig.MaxSize = int64(cfg.MaxExportBatchSize) + batchCfg.MaxSize = int64(cfg.MaxQueueSize) } if cfg.BatchTimeout > 0 { batchCfg.FlushTimeout = cfg.BatchTimeout } + queueConfig.Batch = configoptional.Some(batchCfg) + config.QueueConfig = queueConfig config.RetryConfig = getRetrySettings(cfg) config.ClientConfig = confighttp.ClientConfig{ Endpoint: opts.Scheme + "://" + opts.Endpoint + opts.BaseURLPath, @@ -387,7 +392,6 @@ func getTracesExporter(ctx context.Context, cfg TracesConfig) (exporter.Traces, exporterhelper.WithShutdown(exporter.Shutdown), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), exporterhelper.WithQueue(config.QueueConfig), - exporterhelper.WithBatcher(batchCfg), exporterhelper.WithRetry(config.RetryConfig)) case ProtocolGRPC: slog.Debug("instantiating GRPC TracesReporter", "protocol", proto) @@ -404,15 +408,22 @@ func getTracesExporter(ctx context.Context, cfg TracesConfig) (exporter.Traces, } factory := otlpexporter.NewFactory() config := factory.CreateDefaultConfig().(*otlpexporter.Config) - // Experimental API for batching - // See: https://github.com/open-telemetry/opentelemetry-collector/issues/8122 - if cfg.MaxExportBatchSize > 0 { - config.BatcherConfig.Enabled = true - config.BatcherConfig.SizeConfig.MaxSize = int64(cfg.MaxExportBatchSize) + queueConfig := exporterhelper.NewDefaultQueueConfig() + queueConfig.Sizer = exporterhelper.RequestSizerTypeItems + batchCfg := exporterhelper.BatchConfig{ + Sizer: queueConfig.Sizer, + } + if cfg.MaxQueueSize > 0 || cfg.BatchTimeout > 0 { + queueConfig.Enabled = true + } + if cfg.MaxQueueSize > 0 { + batchCfg.MaxSize = int64(cfg.MaxQueueSize) } if cfg.BatchTimeout > 0 { - config.BatcherConfig.FlushTimeout = cfg.BatchTimeout + batchCfg.FlushTimeout = cfg.BatchTimeout } + queueConfig.Batch = configoptional.Some(batchCfg) + config.QueueConfig = queueConfig config.RetryConfig = getRetrySettings(cfg) config.ClientConfig = configgrpc.ClientConfig{ Endpoint: endpoint.String(), diff --git a/pkg/obi/config.go b/pkg/obi/config.go index 377df39c4..121e0d042 100644 --- a/pkg/obi/config.go +++ b/pkg/obi/config.go @@ -101,11 +101,10 @@ var DefaultConfig = Config{ TTL: defaultMetricsTTL, }, Traces: otel.TracesConfig{ - Protocol: otel.ProtocolUnset, - TracesProtocol: otel.ProtocolUnset, - MaxQueueSize: 4096, - MaxExportBatchSize: 4096, - ReportersCacheLen: ReporterLRUSize, + Protocol: otel.ProtocolUnset, + TracesProtocol: otel.ProtocolUnset, + MaxQueueSize: 4096, + ReportersCacheLen: ReporterLRUSize, Instrumentations: []string{ instrumentations.InstrumentationALL, }, diff --git a/pkg/obi/config_test.go b/pkg/obi/config_test.go index 229fe6c3b..ce7e49491 100644 --- a/pkg/obi/config_test.go +++ b/pkg/obi/config_test.go @@ -158,12 +158,11 @@ discovery: TTL: 5 * time.Minute, }, Traces: otel.TracesConfig{ - Protocol: otel.ProtocolUnset, - CommonEndpoint: "localhost:3131", - TracesEndpoint: "localhost:3232", - MaxQueueSize: 4096, - MaxExportBatchSize: 4096, - ReportersCacheLen: ReporterLRUSize, + Protocol: otel.ProtocolUnset, + CommonEndpoint: "localhost:3131", + TracesEndpoint: "localhost:3232", + MaxQueueSize: 4096, + ReportersCacheLen: ReporterLRUSize, Instrumentations: []string{ instrumentations.InstrumentationALL, }, diff --git a/third_party_licenses.csv b/third_party_licenses.csv index e4e447e90..33b08ed8d 100644 --- a/third_party_licenses.csv +++ b/third_party_licenses.csv @@ -104,6 +104,7 @@ go.opentelemetry.io/collector/config/confighttp,https://github.com/open-telemetr go.opentelemetry.io/collector/config/configmiddleware,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/config/configmiddleware/LICENSE,Apache-2.0 go.opentelemetry.io/collector/config/confignet,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/config/confignet/LICENSE,Apache-2.0 go.opentelemetry.io/collector/config/configopaque,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/config/configopaque/LICENSE,Apache-2.0 +go.opentelemetry.io/collector/config/configoptional,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/config/configoptional/LICENSE,Apache-2.0 go.opentelemetry.io/collector/config/configretry,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/config/configretry/LICENSE,Apache-2.0 go.opentelemetry.io/collector/config/configtls,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/config/configtls/LICENSE,Apache-2.0 go.opentelemetry.io/collector/confmap,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/confmap/LICENSE,Apache-2.0 @@ -125,6 +126,7 @@ go.opentelemetry.io/collector/internal/statusutil,https://github.com/open-teleme go.opentelemetry.io/collector/internal/telemetry,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/internal/telemetry/LICENSE,Apache-2.0 go.opentelemetry.io/collector/pdata,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/pdata/LICENSE,Apache-2.0 go.opentelemetry.io/collector/pdata/pprofile,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/pdata/pprofile/LICENSE,Apache-2.0 +go.opentelemetry.io/collector/pdata/xpdata/request,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/pdata/xpdata/LICENSE,Apache-2.0 go.opentelemetry.io/collector/pipeline,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/pipeline/LICENSE,Apache-2.0 go.opentelemetry.io/collector/pipeline/xpipeline,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/collector/pipeline/xpipeline/LICENSE,Apache-2.0 go.opentelemetry.io/contrib/bridges/otelzap,https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/HEAD/vendor/go.opentelemetry.io/contrib/bridges/otelzap/LICENSE,Apache-2.0 diff --git a/vendor/github.com/go-viper/mapstructure/v2/.editorconfig b/vendor/github.com/go-viper/mapstructure/v2/.editorconfig index 1f664d13a..faef0c91e 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/.editorconfig +++ b/vendor/github.com/go-viper/mapstructure/v2/.editorconfig @@ -16,3 +16,6 @@ indent_style = tab [*.nix] indent_size = 2 + +[.golangci.yaml] +indent_size = 2 diff --git a/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml b/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml index 763143aa7..ec1680b3a 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml +++ b/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml @@ -1,23 +1,39 @@ -run: - timeout: 5m +version: "2" -linters-settings: - gci: - sections: - - standard - - default - - prefix(github.com/go-viper/mapstructure) - golint: - min-confidence: 0 - goimports: - local-prefixes: github.com/go-viper/maptstructure +run: + timeout: 10m linters: - disable-all: true + enable: + - govet + - ineffassign + # - misspell + - nolintlint + # - revive + + disable: + - errcheck + - staticcheck + - unused + + settings: + misspell: + locale: US + nolintlint: + allow-unused: false # report any unused nolint directives + require-specific: false # don't require nolint directives to be specific about which linter is being skipped + +formatters: enable: - gci - gofmt - gofumpt - goimports - - staticcheck - # - stylecheck + # - golines + + settings: + gci: + sections: + - standard + - default + - localmodule diff --git a/vendor/github.com/go-viper/mapstructure/v2/README.md b/vendor/github.com/go-viper/mapstructure/v2/README.md index dd5ec69dd..bc4be08e6 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/README.md +++ b/vendor/github.com/go-viper/mapstructure/v2/README.md @@ -1,8 +1,9 @@ # mapstructure -[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/go-viper/mapstructure/ci.yaml?branch=main&style=flat-square)](https://github.com/go-viper/mapstructure/actions?query=workflow%3ACI) -[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/go-viper/mapstructure/v2) -![Go Version](https://img.shields.io/badge/go%20version-%3E=1.18-61CFDD.svg?style=flat-square) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/go-viper/mapstructure/ci.yaml?style=flat-square)](https://github.com/go-viper/mapstructure/actions/workflows/ci.yaml) +[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/go-viper/mapstructure) +![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/go-viper/mapstructure?style=flat-square&color=61CFDD) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-viper/mapstructure/badge?style=flat-square)](https://deps.dev/go/github.com%252Fgo-viper%252Fmapstructure%252Fv2) mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling. @@ -29,7 +30,7 @@ The API is the same, so you don't need to change anything else. Here is a script that can help you with the migration: ```shell -sed -i 's/github.com\/mitchellh\/mapstructure/github.com\/go-viper\/mapstructure\/v2/g' $(find . -type f -name '*.go') +sed -i 's|github.com/mitchellh/mapstructure|github.com/go-viper/mapstructure/v2|g' $(find . -type f -name '*.go') ``` If you need more time to migrate your code, that is absolutely fine. diff --git a/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go b/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go index 1f3c69d4b..57c6de69d 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go +++ b/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go @@ -100,7 +100,11 @@ func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { if err != nil { return nil, err } - newFrom = reflect.ValueOf(data) + if v, ok := data.(reflect.Value); ok { + newFrom = v + } else { + newFrom = reflect.ValueOf(data) + } } return data, nil @@ -386,6 +390,26 @@ func StringToNetIPAddrPortHookFunc() DecodeHookFunc { } } +// StringToNetIPPrefixHookFunc returns a DecodeHookFunc that converts +// strings to netip.Prefix. +func StringToNetIPPrefixHookFunc() DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}, + ) (interface{}, error) { + if f.Kind() != reflect.String { + return data, nil + } + if t != reflect.TypeOf(netip.Prefix{}) { + return data, nil + } + + // Convert it by parsing + return netip.ParsePrefix(data.(string)) + } +} + // StringToBasicTypeHookFunc returns a DecodeHookFunc that converts // strings to basic types. // int8, uint8, int16, uint16, int32, uint32, int64, uint64, int, uint, float32, float64, bool, byte, rune, complex64, complex128 diff --git a/vendor/github.com/go-viper/mapstructure/v2/errors.go b/vendor/github.com/go-viper/mapstructure/v2/errors.go new file mode 100644 index 000000000..31a3edfb0 --- /dev/null +++ b/vendor/github.com/go-viper/mapstructure/v2/errors.go @@ -0,0 +1,74 @@ +package mapstructure + +import ( + "fmt" + "reflect" +) + +// Error interface is implemented by all errors emitted by mapstructure. +// +// Use [errors.As] to check if an error implements this interface. +type Error interface { + error + + mapstructure() +} + +// DecodeError is a generic error type that holds information about +// a decoding error together with the name of the field that caused the error. +type DecodeError struct { + name string + err error +} + +func newDecodeError(name string, err error) *DecodeError { + return &DecodeError{ + name: name, + err: err, + } +} + +func (e *DecodeError) Name() string { + return e.name +} + +func (e *DecodeError) Unwrap() error { + return e.err +} + +func (e *DecodeError) Error() string { + return fmt.Sprintf("'%s' %s", e.name, e.err) +} + +func (*DecodeError) mapstructure() {} + +// ParseError is an error type that indicates a value could not be parsed +// into the expected type. +type ParseError struct { + Expected reflect.Value + Value any + Err error +} + +func (e *ParseError) Error() string { + return fmt.Sprintf("cannot parse value as '%s': %s", e.Expected.Type(), e.Err) +} + +func (*ParseError) mapstructure() {} + +// UnconvertibleTypeError is an error type that indicates a value could not be +// converted to the expected type. +type UnconvertibleTypeError struct { + Expected reflect.Value + Value any +} + +func (e *UnconvertibleTypeError) Error() string { + return fmt.Sprintf( + "expected type '%s', got unconvertible type '%s'", + e.Expected.Type(), + reflect.TypeOf(e.Value), + ) +} + +func (*UnconvertibleTypeError) mapstructure() {} diff --git a/vendor/github.com/go-viper/mapstructure/v2/flake.lock b/vendor/github.com/go-viper/mapstructure/v2/flake.lock index 4bea8154e..5e67bdd6b 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/flake.lock +++ b/vendor/github.com/go-viper/mapstructure/v2/flake.lock @@ -2,30 +2,28 @@ "nodes": { "cachix": { "inputs": { - "devenv": "devenv_2", + "devenv": [ + "devenv" + ], "flake-compat": [ - "devenv", - "flake-compat" + "devenv" ], - "nixpkgs": [ - "devenv", - "nixpkgs" + "git-hooks": [ + "devenv" ], - "pre-commit-hooks": [ - "devenv", - "pre-commit-hooks" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1712055811, - "narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=", + "lastModified": 1742042642, + "narHash": "sha256-D0gP8srrX0qj+wNYNPdtVJsQuFzIng3q43thnHXQ/es=", "owner": "cachix", "repo": "cachix", - "rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30", + "rev": "a624d3eaf4b1d225f918de8543ed739f2f574203", "type": "github" }, "original": { "owner": "cachix", + "ref": "latest", "repo": "cachix", "type": "github" } @@ -33,52 +31,21 @@ "devenv": { "inputs": { "cachix": "cachix", - "flake-compat": "flake-compat_2", - "nix": "nix_2", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks": "pre-commit-hooks" - }, - "locked": { - "lastModified": 1717245169, - "narHash": "sha256-+mW3rTBjGU8p1THJN0lX/Dd/8FbnF+3dB+mJuSaxewE=", - "owner": "cachix", - "repo": "devenv", - "rev": "c3f9f053c077c6f88a3de5276d9178c62baa3fc3", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "devenv_2": { - "inputs": { - "flake-compat": [ - "devenv", - "cachix", - "flake-compat" - ], + "flake-compat": "flake-compat", + "git-hooks": "git-hooks", "nix": "nix", - "nixpkgs": "nixpkgs", - "poetry2nix": "poetry2nix", - "pre-commit-hooks": [ - "devenv", - "cachix", - "pre-commit-hooks" - ] + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1708704632, - "narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=", + "lastModified": 1744876578, + "narHash": "sha256-8MTBj2REB8t29sIBLpxbR0+AEGJ7f+RkzZPAGsFd40c=", "owner": "cachix", "repo": "devenv", - "rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196", + "rev": "7ff7c351bba20d0615be25ecdcbcf79b57b85fe1", "type": "github" }, "original": { "owner": "cachix", - "ref": "python-rewrite", "repo": "devenv", "type": "github" } @@ -86,27 +53,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -117,14 +68,18 @@ }, "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "devenv", + "nix", + "nixpkgs" + ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", "type": "github" }, "original": { @@ -133,39 +88,46 @@ "type": "github" } }, - "flake-utils": { + "flake-parts_2": { "inputs": { - "systems": "systems" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, - "flake-utils_2": { + "git-hooks": { "inputs": { - "systems": "systems_2" + "flake-compat": [ + "devenv" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "devenv", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, @@ -173,7 +135,7 @@ "inputs": { "nixpkgs": [ "devenv", - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, @@ -191,166 +153,109 @@ "type": "github" } }, - "nix": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "nixpkgs" - ], - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1712911606, - "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", - "owner": "domenkozar", - "repo": "nix", - "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", - "type": "github" - }, - "original": { - "owner": "domenkozar", - "ref": "devenv-2.21", - "repo": "nix", - "type": "github" - } - }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "poetry2nix", - "nixpkgs" - ] - }, + "libgit2": { + "flake": false, "locked": { - "lastModified": 1688870561, - "narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "165b1650b753316aa7f1787f3005a8d2da0f5301", + "lastModified": 1697646580, + "narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=", + "owner": "libgit2", + "repo": "libgit2", + "rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nix-github-actions", + "owner": "libgit2", + "repo": "libgit2", "type": "github" } }, - "nix_2": { + "nix": { "inputs": { "flake-compat": [ - "devenv", - "flake-compat" + "devenv" ], - "nixpkgs": [ - "devenv", - "nixpkgs" + "flake-parts": "flake-parts", + "libgit2": "libgit2", + "nixpkgs": "nixpkgs_2", + "nixpkgs-23-11": [ + "devenv" + ], + "nixpkgs-regression": [ + "devenv" ], - "nixpkgs-regression": "nixpkgs-regression_2" + "pre-commit-hooks": [ + "devenv" + ] }, "locked": { - "lastModified": 1712911606, - "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", + "lastModified": 1741798497, + "narHash": "sha256-E3j+3MoY8Y96mG1dUIiLFm2tZmNbRvSiyN7CrSKuAVg=", "owner": "domenkozar", "repo": "nix", - "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", + "rev": "f3f44b2baaf6c4c6e179de8cbb1cc6db031083cd", "type": "github" }, "original": { "owner": "domenkozar", - "ref": "devenv-2.21", + "ref": "devenv-2.24", "repo": "nix", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1692808169, - "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=", + "lastModified": 1733212471, + "narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9201b5ff357e781bf014d0330d18555695df7ba8", + "rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-lib": { "locked": { - "lastModified": 1717284937, - "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs-regression_2": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", "type": "github" }, "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "owner": "nix-community", + "repo": "nixpkgs.lib", "type": "github" } }, - "nixpkgs-stable": { + "nixpkgs_2": { "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "lastModified": 1717432640, + "narHash": "sha256-+f9c4/ZX5MWDOuB1rKoWj+lBNm0z0rs4CK47HBLxy1o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "rev": "88269ab3044128b7c2f4c7d68448b2fb50456870", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "release-24.05", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { - "lastModified": 1713361204, - "narHash": "sha256-TA6EDunWTkc5FvDCqU3W2T3SFn0gRZqh6D/hJnM02MM=", + "lastModified": 1733477122, + "narHash": "sha256-qamMCz5mNpQmgBwc8SB5tVMlD5sbwVIToVZtSxMph9s=", "owner": "cachix", "repo": "devenv-nixpkgs", - "rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6", + "rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857", "type": "github" }, "original": { @@ -360,13 +265,13 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1717112898, - "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", "type": "github" }, "original": { @@ -376,94 +281,11 @@ "type": "github" } }, - "poetry2nix": { - "inputs": { - "flake-utils": "flake-utils", - "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1692876271, - "narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": [ - "devenv", - "flake-compat" - ], - "flake-utils": "flake-utils_2", - "gitignore": "gitignore", - "nixpkgs": [ - "devenv", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1713775815, - "narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "devenv": "devenv", - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_3" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_4" } } }, diff --git a/vendor/github.com/go-viper/mapstructure/v2/flake.nix b/vendor/github.com/go-viper/mapstructure/v2/flake.nix index 4ed0f5331..3b116f426 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/flake.nix +++ b/vendor/github.com/go-viper/mapstructure/v2/flake.nix @@ -5,35 +5,42 @@ devenv.url = "github:cachix/devenv"; }; - outputs = inputs@{ flake-parts, ... }: + outputs = + inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { imports = [ inputs.devenv.flakeModule ]; - systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; + systems = [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; - perSystem = { config, self', inputs', pkgs, system, ... }: rec { - devenv.shells = { - default = { - languages = { - go.enable = true; - }; + perSystem = + { pkgs, ... }: + rec { + devenv.shells = { + default = { + languages = { + go.enable = true; + }; - pre-commit.hooks = { - nixpkgs-fmt.enable = true; - }; + pre-commit.hooks = { + nixpkgs-fmt.enable = true; + }; - packages = with pkgs; [ - golangci-lint - ]; + packages = with pkgs; [ + golangci-lint + ]; - # https://github.com/cachix/devenv/issues/528#issuecomment-1556108767 - containers = pkgs.lib.mkForce { }; - }; + # https://github.com/cachix/devenv/issues/528#issuecomment-1556108767 + containers = pkgs.lib.mkForce { }; + }; - ci = devenv.shells.default; + ci = devenv.shells.default; + }; }; - }; }; } diff --git a/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go b/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go index e77e63ba3..4b738a3a9 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go +++ b/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go @@ -115,15 +115,36 @@ // // When decoding from a struct to any other value, you may use the // ",omitempty" suffix on your tag to omit that value if it equates to -// the zero value. The zero value of all types is specified in the Go -// specification. +// the zero value, or a zero-length element. The zero value of all types is +// specified in the Go specification. // // For example, the zero type of a numeric type is zero ("0"). If the struct // field value is zero and a numeric type, the field is empty, and it won't -// be encoded into the destination type. +// be encoded into the destination type. And likewise for the URLs field, if the +// slice is nil or empty, it won't be encoded into the destination type. // // type Source struct { -// Age int `mapstructure:",omitempty"` +// Age int `mapstructure:",omitempty"` +// URLs []string `mapstructure:",omitempty"` +// } +// +// # Omit Zero Values +// +// When decoding from a struct to any other value, you may use the +// ",omitzero" suffix on your tag to omit that value if it equates to the zero +// value. The zero value of all types is specified in the Go specification. +// +// For example, the zero type of a numeric type is zero ("0"). If the struct +// field value is zero and a numeric type, the field is empty, and it won't +// be encoded into the destination type. And likewise for the URLs field, if the +// slice is nil, it won't be encoded into the destination type. +// +// Note that if the field is a slice, and it is empty but not nil, it will +// still be encoded into the destination type. +// +// type Source struct { +// Age int `mapstructure:",omitzero"` +// URLs []string `mapstructure:",omitzero"` // } // // # Unexported fields @@ -222,6 +243,12 @@ type DecoderConfig struct { // will affect all nested structs as well. ErrorUnset bool + // AllowUnsetPointer, if set to true, will prevent fields with pointer types + // from being reported as unset, even if ErrorUnset is true and the field was + // not present in the input data. This allows pointer fields to be optional + // without triggering an error when they are missing. + AllowUnsetPointer bool + // ZeroFields, if set to true, will zero fields before writing them. // For example, a map will be emptied before decoded values are put in // it. If this is false, a map will be merged. @@ -504,7 +531,7 @@ func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) e var err error input, err = d.cachedDecodeHook(inputVal, outVal) if err != nil { - return fmt.Errorf("error decoding '%s': %w", name, err) + return newDecodeError(name, err) } } if isNil(input) { @@ -542,7 +569,7 @@ func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) e err = d.decodeFunc(name, input, outVal) default: // If we reached this point then we weren't able to decode it - return fmt.Errorf("%s: unsupported type: %s", name, outputKind) + return newDecodeError(name, fmt.Errorf("unsupported type: %s", outputKind)) } // If we reached here, then we successfully decoded SOMETHING, so @@ -603,9 +630,10 @@ func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) dataValType := dataVal.Type() if !dataValType.AssignableTo(val.Type()) { - return fmt.Errorf( - "'%s' expected type '%s', got '%s'", - name, val.Type(), dataValType) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } val.Set(dataVal) @@ -656,9 +684,10 @@ func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) } if !converted { - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", - name, val.Type(), dataVal.Type(), data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } return nil @@ -692,20 +721,28 @@ func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) er if err == nil { val.SetInt(i) } else { - return fmt.Errorf("cannot parse '%s' as int: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": jn := data.(json.Number) i, err := jn.Int64() if err != nil { - return fmt.Errorf( - "error decoding json.Number into %s: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } val.SetInt(i) default: - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", - name, val.Type(), dataVal.Type(), data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } return nil @@ -720,8 +757,11 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e case dataKind == reflect.Int: i := dataVal.Int() if i < 0 && !d.config.WeaklyTypedInput { - return fmt.Errorf("cannot parse '%s', %d overflows uint", - name, i) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: fmt.Errorf("%d overflows uint", i), + }) } val.SetUint(uint64(i)) case dataKind == reflect.Uint: @@ -729,8 +769,11 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e case dataKind == reflect.Float32: f := dataVal.Float() if f < 0 && !d.config.WeaklyTypedInput { - return fmt.Errorf("cannot parse '%s', %f overflows uint", - name, f) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: fmt.Errorf("%f overflows uint", f), + }) } val.SetUint(uint64(f)) case dataKind == reflect.Bool && d.config.WeaklyTypedInput: @@ -749,20 +792,28 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e if err == nil { val.SetUint(i) } else { - return fmt.Errorf("cannot parse '%s' as uint: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": jn := data.(json.Number) i, err := strconv.ParseUint(string(jn), 0, 64) if err != nil { - return fmt.Errorf( - "error decoding json.Number into %s: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } val.SetUint(i) default: - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", - name, val.Type(), dataVal.Type(), data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } return nil @@ -788,12 +839,17 @@ func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) e } else if dataVal.String() == "" { val.SetBool(false) } else { - return fmt.Errorf("cannot parse '%s' as bool: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } default: - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%#v', value: '%#v'", - name, val, dataVal, data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } return nil @@ -827,20 +883,28 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) if err == nil { val.SetFloat(f) } else { - return fmt.Errorf("cannot parse '%s' as float: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": jn := data.(json.Number) i, err := jn.Float64() if err != nil { - return fmt.Errorf( - "error decoding json.Number into %s: %s", name, err) + return newDecodeError(name, &ParseError{ + Expected: val, + Value: data, + Err: err, + }) } val.SetFloat(i) default: - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", - name, val.Type(), dataVal.Type(), data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } return nil @@ -854,9 +918,10 @@ func (d *Decoder) decodeComplex(name string, data interface{}, val reflect.Value case dataKind == reflect.Complex64: val.SetComplex(dataVal.Complex()) default: - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", - name, val.Type(), dataVal.Type(), data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } return nil @@ -900,7 +965,10 @@ func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) er fallthrough default: - return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } } @@ -986,7 +1054,10 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re // to the map value. v := dataVal.Field(i) if !v.Type().AssignableTo(valMap.Type().Elem()) { - return fmt.Errorf("cannot assign type '%s' to map value field of type '%s'", v.Type(), valMap.Type().Elem()) + return newDecodeError( + name+"."+f.Name, + fmt.Errorf("cannot assign type %q to map value field of type %q", v.Type(), valMap.Type().Elem()), + ) } tagValue := f.Tag.Get(d.config.TagName) @@ -1011,6 +1082,11 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re continue } + // If "omitzero" is specified in the tag, it ignores zero values. + if strings.Index(tagValue[index+1:], "omitzero") != -1 && v.IsZero() { + continue + } + // If "squash" is specified in the tag, we squash the field down. squash = squash || strings.Contains(tagValue[index+1:], d.config.SquashTagOption) if squash { @@ -1021,12 +1097,18 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re // The final type must be a struct if v.Kind() != reflect.Struct { - return fmt.Errorf("cannot squash non-struct type '%s'", v.Type()) + return newDecodeError( + name+"."+f.Name, + fmt.Errorf("cannot squash non-struct type %q", v.Type()), + ) } } else { if strings.Index(tagValue[index+1:], "remain") != -1 { if v.Kind() != reflect.Map { - return fmt.Errorf("error remain-tag field with invalid type: '%s'", v.Type()) + return newDecodeError( + name+"."+f.Name, + fmt.Errorf("error remain-tag field with invalid type: %q", v.Type()), + ) } ptr := v.MapRange() @@ -1146,9 +1228,10 @@ func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) e // into that. Then set the value of the pointer to this type. dataVal := reflect.Indirect(reflect.ValueOf(data)) if val.Type() != dataVal.Type() { - return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", - name, val.Type(), dataVal.Type(), data) + return newDecodeError(name, &UnconvertibleTypeError{ + Expected: val, + Value: data, + }) } val.Set(dataVal) return nil @@ -1189,8 +1272,8 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) } } - return fmt.Errorf( - "'%s': source data must be an array or slice, got %s", name, dataValKind) + return newDecodeError(name, + fmt.Errorf("source data must be an array or slice, got %s", dataValKind)) } // If the input value is nil, then don't allocate since empty != nil @@ -1257,13 +1340,13 @@ func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) } } - return fmt.Errorf( - "'%s': source data must be an array or slice, got %s", name, dataValKind) + return newDecodeError(name, + fmt.Errorf("source data must be an array or slice, got %s", dataValKind)) } if dataVal.Len() > arrayType.Len() { - return fmt.Errorf( - "'%s': expected source data to have length less or equal to %d, got %d", name, arrayType.Len(), dataVal.Len()) + return newDecodeError(name, + fmt.Errorf("expected source data to have length less or equal to %d, got %d", arrayType.Len(), dataVal.Len())) } // Make a new array to hold our result, same size as the original data. @@ -1328,16 +1411,16 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) return result default: - return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) + return newDecodeError(name, + fmt.Errorf("expected a map or struct, got %q", dataValKind)) } } func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) error { dataValType := dataVal.Type() if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface { - return fmt.Errorf( - "'%s' needs a map with string keys, has '%s' keys", - name, dataValType.Key().Kind()) + return newDecodeError(name, + fmt.Errorf("needs a map with string keys, has %q keys", kind)) } dataValKeys := make(map[reflect.Value]struct{}) @@ -1410,7 +1493,10 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e structs = append(structs, fieldVal.Elem().Elem()) } default: - errs = append(errs, fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldVal.Kind())) + errs = append(errs, newDecodeError( + name+"."+fieldType.Name, + fmt.Errorf("unsupported type for squash: %s", fieldVal.Kind()), + )) } continue } @@ -1461,7 +1547,9 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e if !rawMapVal.IsValid() { // There was no matching key in the map for the value in // the struct. Remember it for potential errors and metadata. - targetValKeysUnused[fieldName] = struct{}{} + if !(d.config.AllowUnsetPointer && fieldValue.Kind() == reflect.Ptr) { + targetValKeysUnused[fieldName] = struct{}{} + } continue } } @@ -1517,8 +1605,10 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e } sort.Strings(keys) - err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", ")) - errs = append(errs, err) + errs = append(errs, newDecodeError( + name, + fmt.Errorf("has invalid keys: %s", strings.Join(keys, ", ")), + )) } if d.config.ErrorUnset && len(targetValKeysUnused) > 0 { @@ -1528,8 +1618,10 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e } sort.Strings(keys) - err := fmt.Errorf("'%s' has unset fields: %s", name, strings.Join(keys, ", ")) - errs = append(errs, err) + errs = append(errs, newDecodeError( + name, + fmt.Errorf("has unset fields: %s", strings.Join(keys, ", ")), + )) } if err := errors.Join(errs...); err != nil { diff --git a/vendor/github.com/knadh/koanf/v2/README.md b/vendor/github.com/knadh/koanf/v2/README.md index dbf4d7a53..0f5864dc3 100644 --- a/vendor/github.com/knadh/koanf/v2/README.md +++ b/vendor/github.com/knadh/koanf/v2/README.md @@ -673,6 +673,7 @@ Install with `go get -u github.com/knadh/koanf/providers/$provider` | consul/v2 | `consul.Provider(consul.Config{})` | Hashicorp Consul provider | | parameterstore/v2 | `parameterstore.Provider(parameterstore.Config{})` | AWS Systems Manager Parameter Store provider | | cliflagv2 | `cliflagv2.Provider(ctx *cli.Context, delimiter string)` | Reads commands and flags from urfave/cli/v2 context including global flags and nested command flags and provides a nested config map based on delim. | +| cliflagv3 | `cliflagv3.Provider(ctx *cli.Context, delimiter string)` | Reads commands and flags from urfave/cli/v3 and provides a nested config map based on delim. | ### Bundled Parsers diff --git a/vendor/github.com/knadh/koanf/v2/go.work b/vendor/github.com/knadh/koanf/v2/go.work index 8322077be..28f4fad6c 100644 --- a/vendor/github.com/knadh/koanf/v2/go.work +++ b/vendor/github.com/knadh/koanf/v2/go.work @@ -18,6 +18,7 @@ use ( ./providers/azkeyvault ./providers/basicflag ./providers/cliflagv2 + ./providers/cliflagv3 ./providers/confmap ./providers/consul ./providers/env diff --git a/vendor/github.com/knadh/koanf/v2/go.work.sum b/vendor/github.com/knadh/koanf/v2/go.work.sum index 1d6e91b62..03d00a036 100644 --- a/vendor/github.com/knadh/koanf/v2/go.work.sum +++ b/vendor/github.com/knadh/koanf/v2/go.work.sum @@ -113,6 +113,7 @@ cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VB cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY= cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= +cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8= cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= @@ -207,6 +208,7 @@ cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeet cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI= cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA= cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= @@ -239,19 +241,21 @@ cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcP cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.0/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Sereal/Sereal/Go/sereal v0.0.0-20231009093132-b9187f1a92c6/go.mod h1:JwrycNnC8+sZPDyzM3MQ86LvaGzSpfxg885KOOwFRW4= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= @@ -276,37 +280,46 @@ github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2T github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/sdk v0.13.1/go.mod h1:SW/mM4LbKfqmMvcFu8v+eiQQ7oitXEFeiBe9StxERb0= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack/v2 v2.1.1/go.mod h1:upybraOAblm4S7rx0+jeNy+CWWhzywQsSRV5033mMu4= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/mdns v1.0.5/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/lyft/protoc-gen-star/v2 v2.0.4-0.20230330145011-496ad1ac90a4/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= @@ -315,6 +328,7 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/natefinch/atomic v1.0.1/go.mod h1:N/D/ELrljoqDyT3rZrsUmtsuzvHkeB/wWjHV22AZRbM= github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= @@ -323,21 +337,25 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/ryanuber/columnize v2.1.2+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= @@ -374,7 +392,7 @@ golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= @@ -429,6 +447,7 @@ golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -454,11 +473,9 @@ google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/vmihailenco/msgpack.v2 v2.9.2/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn+AEGwNEOatn8= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/knadh/koanf/v2/koanf.go b/vendor/github.com/knadh/koanf/v2/koanf.go index bd06a2d7e..0b89e55c7 100644 --- a/vendor/github.com/knadh/koanf/v2/koanf.go +++ b/vendor/github.com/knadh/koanf/v2/koanf.go @@ -8,9 +8,9 @@ import ( "sort" "strconv" + "github.com/go-viper/mapstructure/v2" "github.com/knadh/koanf/maps" "github.com/mitchellh/copystructure" - "github.com/go-viper/mapstructure/v2" ) // Koanf is the configuration apparatus. @@ -254,11 +254,12 @@ func (ko *Koanf) UnmarshalWithConf(path string, o interface{}, c UnmarshalConf) mapstructure.StringToTimeDurationHookFunc(), textUnmarshalerHookFunc()), Metadata: nil, - Result: o, WeaklyTypedInput: true, } } + c.DecoderConfig.Result = o + if c.Tag == "" { c.DecoderConfig.TagName = "koanf" } else { diff --git a/vendor/go.opentelemetry.io/collector/config/configgrpc/configgrpc.go b/vendor/go.opentelemetry.io/collector/config/configgrpc/configgrpc.go index 8b1bb9495..04b1662e7 100644 --- a/vendor/go.opentelemetry.io/collector/config/configgrpc/configgrpc.go +++ b/vendor/go.opentelemetry.io/collector/config/configgrpc/configgrpc.go @@ -34,6 +34,7 @@ import ( "go.opentelemetry.io/collector/config/configmiddleware" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/config/configopaque" + "go.opentelemetry.io/collector/config/configoptional" "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/extension/extensionauth" ) @@ -52,8 +53,8 @@ type KeepaliveClientConfig struct { } // NewDefaultKeepaliveClientConfig returns a new instance of KeepaliveClientConfig with default values. -func NewDefaultKeepaliveClientConfig() *KeepaliveClientConfig { - return &KeepaliveClientConfig{ +func NewDefaultKeepaliveClientConfig() KeepaliveClientConfig { + return KeepaliveClientConfig{ Time: time.Second * 10, Timeout: time.Second * 10, } @@ -79,7 +80,7 @@ type ClientConfig struct { // The keepalive parameters for gRPC client. See grpc.WithKeepaliveParams. // (https://godoc.org/google.golang.org/grpc#WithKeepaliveParams). - Keepalive *KeepaliveClientConfig `mapstructure:"keepalive,omitempty"` + Keepalive configoptional.Optional[KeepaliveClientConfig] `mapstructure:"keepalive,omitempty"` // ReadBufferSize for gRPC client. See grpc.WithReadBufferSize. // (https://godoc.org/google.golang.org/grpc#WithReadBufferSize). @@ -105,17 +106,21 @@ type ClientConfig struct { Authority string `mapstructure:"authority,omitempty"` // Auth configuration for outgoing RPCs. - Auth *configauth.Config `mapstructure:"auth,omitempty"` + Auth configoptional.Optional[configauth.Config] `mapstructure:"auth,omitempty"` // Middlewares for the gRPC client. Middlewares []configmiddleware.Config `mapstructure:"middlewares,omitempty"` } +func ptr[T any](v T) *T { + return &v +} + // NewDefaultClientConfig returns a new instance of ClientConfig with default values. -func NewDefaultClientConfig() *ClientConfig { - return &ClientConfig{ +func NewDefaultClientConfig() ClientConfig { + return ClientConfig{ TLS: configtls.NewDefaultClientConfig(), - Keepalive: NewDefaultKeepaliveClientConfig(), + Keepalive: configoptional.Some(NewDefaultKeepaliveClientConfig()), BalancerName: BalancerName(), } } @@ -129,10 +134,10 @@ type KeepaliveServerConfig struct { } // NewDefaultKeepaliveServerConfig returns a new instance of KeepaliveServerConfig with default values. -func NewDefaultKeepaliveServerConfig() *KeepaliveServerConfig { - return &KeepaliveServerConfig{ - ServerParameters: NewDefaultKeepaliveServerParameters(), - EnforcementPolicy: NewDefaultKeepaliveEnforcementPolicy(), +func NewDefaultKeepaliveServerConfig() KeepaliveServerConfig { + return KeepaliveServerConfig{ + ServerParameters: ptr(NewDefaultKeepaliveServerParameters()), + EnforcementPolicy: ptr(NewDefaultKeepaliveEnforcementPolicy()), } } @@ -150,8 +155,8 @@ type KeepaliveServerParameters struct { } // NewDefaultKeepaliveServerParameters creates and returns a new instance of KeepaliveServerParameters with default settings. -func NewDefaultKeepaliveServerParameters() *KeepaliveServerParameters { - return &KeepaliveServerParameters{} +func NewDefaultKeepaliveServerParameters() KeepaliveServerParameters { + return KeepaliveServerParameters{} } // KeepaliveEnforcementPolicy allow configuration of the keepalive.EnforcementPolicy. @@ -165,8 +170,8 @@ type KeepaliveEnforcementPolicy struct { } // NewDefaultKeepaliveEnforcementPolicy creates and returns a new instance of KeepaliveEnforcementPolicy with default settings. -func NewDefaultKeepaliveEnforcementPolicy() *KeepaliveEnforcementPolicy { - return &KeepaliveEnforcementPolicy{} +func NewDefaultKeepaliveEnforcementPolicy() KeepaliveEnforcementPolicy { + return KeepaliveEnforcementPolicy{} } // ServerConfig defines common settings for a gRPC server configuration. @@ -176,7 +181,7 @@ type ServerConfig struct { // Configures the protocol to use TLS. // The default value is nil, which will cause the protocol to not use TLS. - TLS *configtls.ServerConfig `mapstructure:"tls,omitempty"` + TLS configoptional.Optional[configtls.ServerConfig] `mapstructure:"tls,omitempty"` // MaxRecvMsgSizeMiB sets the maximum size (in MiB) of messages accepted by the server. MaxRecvMsgSizeMiB int `mapstructure:"max_recv_msg_size_mib,omitempty"` @@ -194,10 +199,10 @@ type ServerConfig struct { WriteBufferSize int `mapstructure:"write_buffer_size,omitempty"` // Keepalive anchor for all the settings related to keepalive. - Keepalive *KeepaliveServerConfig `mapstructure:"keepalive,omitempty"` + Keepalive configoptional.Optional[KeepaliveServerConfig] `mapstructure:"keepalive,omitempty"` // Auth for this receiver - Auth *configauth.Config `mapstructure:"auth,omitempty"` + Auth configoptional.Optional[configauth.Config] `mapstructure:"auth,omitempty"` // Include propagates the incoming connection's metadata to downstream consumers. IncludeMetadata bool `mapstructure:"include_metadata,omitempty"` @@ -210,9 +215,9 @@ type ServerConfig struct { } // NewDefaultServerConfig returns a new instance of ServerConfig with default values. -func NewDefaultServerConfig() *ServerConfig { - return &ServerConfig{ - Keepalive: NewDefaultKeepaliveServerConfig(), +func NewDefaultServerConfig() ServerConfig { + return ServerConfig{ + Keepalive: configoptional.Some(NewDefaultKeepaliveServerConfig()), } } @@ -326,21 +331,22 @@ func (gcs *ClientConfig) getGrpcDialOptions( opts = append(opts, grpc.WithWriteBufferSize(gcs.WriteBufferSize)) } - if gcs.Keepalive != nil { + if gcs.Keepalive.HasValue() { + keepaliveConfig := gcs.Keepalive.Get() keepAliveOption := grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: gcs.Keepalive.Time, - Timeout: gcs.Keepalive.Timeout, - PermitWithoutStream: gcs.Keepalive.PermitWithoutStream, + Time: keepaliveConfig.Time, + Timeout: keepaliveConfig.Timeout, + PermitWithoutStream: keepaliveConfig.PermitWithoutStream, }) opts = append(opts, keepAliveOption) } - if gcs.Auth != nil { + if gcs.Auth.HasValue() { if host.GetExtensions() == nil { return nil, errors.New("no extensions configuration available") } - grpcAuthenticator, cerr := gcs.Auth.GetGRPCClientAuthenticator(ctx, host.GetExtensions()) + grpcAuthenticator, cerr := gcs.Auth.Get().GetGRPCClientAuthenticator(ctx, host.GetExtensions()) if cerr != nil { return nil, cerr } @@ -451,8 +457,8 @@ func (gss *ServerConfig) getGrpcServerOptions( ) ([]grpc.ServerOption, error) { var opts []grpc.ServerOption - if gss.TLS != nil { - tlsCfg, err := gss.TLS.LoadTLSConfig(context.Background()) + if gss.TLS.HasValue() { + tlsCfg, err := gss.TLS.Get().LoadTLSConfig(context.Background()) if err != nil { return nil, err } @@ -479,9 +485,10 @@ func (gss *ServerConfig) getGrpcServerOptions( // to apply them over zero/nil values before passing these as grpc.ServerOptions. // The following shows the server code for applying default grpc.ServerOptions. // https://github.com/grpc/grpc-go/blob/120728e1f775e40a2a764341939b78d666b08260/internal/transport/http2_server.go#L184-L200 - if gss.Keepalive != nil { - if gss.Keepalive.ServerParameters != nil { - svrParams := gss.Keepalive.ServerParameters + if gss.Keepalive.HasValue() { + keepaliveConfig := gss.Keepalive.Get() + if keepaliveConfig.ServerParameters != nil { + svrParams := keepaliveConfig.ServerParameters opts = append(opts, grpc.KeepaliveParams(keepalive.ServerParameters{ MaxConnectionIdle: svrParams.MaxConnectionIdle, MaxConnectionAge: svrParams.MaxConnectionAge, @@ -494,8 +501,8 @@ func (gss *ServerConfig) getGrpcServerOptions( // to apply them over zero/nil values before passing these as grpc.ServerOptions. // The following shows the server code for applying default grpc.ServerOptions. // https://github.com/grpc/grpc-go/blob/120728e1f775e40a2a764341939b78d666b08260/internal/transport/http2_server.go#L202-L205 - if gss.Keepalive.EnforcementPolicy != nil { - enfPol := gss.Keepalive.EnforcementPolicy + if keepaliveConfig.EnforcementPolicy != nil { + enfPol := keepaliveConfig.EnforcementPolicy opts = append(opts, grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ MinTime: enfPol.MinTime, PermitWithoutStream: enfPol.PermitWithoutStream, @@ -506,8 +513,8 @@ func (gss *ServerConfig) getGrpcServerOptions( var uInterceptors []grpc.UnaryServerInterceptor var sInterceptors []grpc.StreamServerInterceptor - if gss.Auth != nil { - authenticator, err := gss.Auth.GetServerAuthenticator(context.Background(), host.GetExtensions()) + if gss.Auth.HasValue() { + authenticator, err := gss.Auth.Get().GetServerAuthenticator(context.Background(), host.GetExtensions()) if err != nil { return nil, err } diff --git a/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go b/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go index 011f358d4..dff7685cf 100644 --- a/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go +++ b/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go @@ -29,6 +29,7 @@ import ( "go.opentelemetry.io/collector/config/confighttp/internal" "go.opentelemetry.io/collector/config/configmiddleware" "go.opentelemetry.io/collector/config/configopaque" + "go.opentelemetry.io/collector/config/configoptional" "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/extension/extensionauth" ) @@ -74,7 +75,7 @@ type ClientConfig struct { Headers map[string]configopaque.String `mapstructure:"headers,omitempty"` // Auth configuration for outgoing HTTP calls. - Auth *configauth.Config `mapstructure:"auth,omitempty"` + Auth configoptional.Optional[configauth.Config] `mapstructure:"auth,omitempty"` // The compression key for supported compression types within collector. Compression configcompression.Type `mapstructure:"compression,omitempty"` @@ -225,13 +226,14 @@ func (hcs *ClientConfig) ToClient(ctx context.Context, host component.Host, sett // The Auth RoundTripper should always be the innermost to ensure that // request signing-based auth mechanisms operate after compression // and header middleware modifies the request - if hcs.Auth != nil { + if hcs.Auth.HasValue() { ext := host.GetExtensions() if ext == nil { return nil, errors.New("extensions configuration not found") } - httpCustomAuthRoundTripper, aerr := hcs.Auth.GetHTTPClientAuthenticator(ctx, ext) + auth := hcs.Auth.Get() + httpCustomAuthRoundTripper, aerr := auth.GetHTTPClientAuthenticator(ctx, ext) if aerr != nil { return nil, aerr } @@ -315,13 +317,13 @@ type ServerConfig struct { Endpoint string `mapstructure:"endpoint,omitempty"` // TLS struct exposes TLS client configuration. - TLS *configtls.ServerConfig `mapstructure:"tls"` + TLS configoptional.Optional[configtls.ServerConfig] `mapstructure:"tls"` // CORS configures the server for HTTP cross-origin resource sharing (CORS). - CORS *CORSConfig `mapstructure:"cors"` + CORS configoptional.Optional[CORSConfig] `mapstructure:"cors"` // Auth for this receiver - Auth *AuthConfig `mapstructure:"auth,omitempty"` + Auth configoptional.Optional[AuthConfig] `mapstructure:"auth,omitempty"` // MaxRequestBodySize sets the maximum request body size in bytes. Default: 20MiB. MaxRequestBodySize int64 `mapstructure:"max_request_body_size,omitempty"` @@ -378,7 +380,6 @@ type ServerConfig struct { func NewDefaultServerConfig() ServerConfig { return ServerConfig{ ResponseHeaders: map[string]configopaque.String{}, - CORS: NewDefaultCORSConfig(), WriteTimeout: 30 * time.Second, ReadHeaderTimeout: 1 * time.Minute, IdleTimeout: 1 * time.Minute, @@ -403,9 +404,9 @@ func (hss *ServerConfig) ToListener(ctx context.Context) (net.Listener, error) { return nil, err } - if hss.TLS != nil { + if hss.TLS.HasValue() { var tlsCfg *tls.Config - tlsCfg, err = hss.TLS.LoadTLSConfig(ctx) + tlsCfg, err = hss.TLS.Get().LoadTLSConfig(ctx) if err != nil { return nil, err } @@ -484,25 +485,27 @@ func (hss *ServerConfig) ToServer(ctx context.Context, host component.Host, sett handler = maxRequestBodySizeInterceptor(handler, hss.MaxRequestBodySize) } - if hss.Auth != nil { - server, err := hss.Auth.GetServerAuthenticator(context.Background(), host.GetExtensions()) + if hss.Auth.HasValue() { + auth := hss.Auth.Get() + server, err := auth.GetServerAuthenticator(context.Background(), host.GetExtensions()) if err != nil { return nil, err } - handler = authInterceptor(handler, server, hss.Auth.RequestParameters, serverOpts) + handler = authInterceptor(handler, server, auth.RequestParameters, serverOpts) } - if hss.CORS != nil && len(hss.CORS.AllowedOrigins) > 0 { + if hss.CORS.HasValue() && len(hss.CORS.Get().AllowedOrigins) > 0 { + corsConfig := hss.CORS.Get() co := cors.Options{ - AllowedOrigins: hss.CORS.AllowedOrigins, + AllowedOrigins: corsConfig.AllowedOrigins, AllowCredentials: true, - AllowedHeaders: hss.CORS.AllowedHeaders, - MaxAge: hss.CORS.MaxAge, + AllowedHeaders: corsConfig.AllowedHeaders, + MaxAge: corsConfig.MaxAge, } handler = cors.New(co).Handler(handler) } - if hss.CORS != nil && len(hss.CORS.AllowedOrigins) == 0 && len(hss.CORS.AllowedHeaders) > 0 { + if hss.CORS.HasValue() && len(hss.CORS.Get().AllowedOrigins) == 0 && len(hss.CORS.Get().AllowedHeaders) > 0 { settings.Logger.Warn("The CORS configuration specifies allowed headers but no allowed origins, and is therefore ignored.") } @@ -594,8 +597,8 @@ type CORSConfig struct { } // NewDefaultCORSConfig creates a default cross-origin resource sharing (CORS) configuration. -func NewDefaultCORSConfig() *CORSConfig { - return &CORSConfig{} +func NewDefaultCORSConfig() CORSConfig { + return CORSConfig{} } func authInterceptor(next http.Handler, server extensionauth.Server, requestParams []string, serverOpts *internal.ToServerOptions) http.Handler { diff --git a/vendor/go.opentelemetry.io/collector/config/configoptional/LICENSE b/vendor/go.opentelemetry.io/collector/config/configoptional/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/config/configoptional/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/collector/config/configoptional/Makefile b/vendor/go.opentelemetry.io/collector/config/configoptional/Makefile new file mode 100644 index 000000000..ded7a3609 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/config/configoptional/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/vendor/go.opentelemetry.io/collector/config/configoptional/optional.go b/vendor/go.opentelemetry.io/collector/config/configoptional/optional.go new file mode 100644 index 000000000..b6eabafe9 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/config/configoptional/optional.go @@ -0,0 +1,191 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package configoptional // import "go.opentelemetry.io/collector/config/configoptional" + +import ( + "errors" + "fmt" + "reflect" + "strings" + + "go.opentelemetry.io/collector/confmap" +) + +type flavor int + +const ( + noneFlavor flavor = 0 + defaultFlavor flavor = 1 + someFlavor flavor = 2 +) + +// Optional represents a value that may or may not be present. +// It supports two flavors for all types: Some(value) and None. +// It supports a third flavor for struct types: Default(defaultVal). +// +// For struct types, it supports unmarshaling from a configuration source. +// The zero value of Optional is None. +type Optional[T any] struct { + // value is the value of the Optional. + value T + + // flavor indicates the flavor of the Optional. + // The zero value of flavor is noneFlavor. + flavor flavor +} + +// deref a reflect.Type to its underlying type. +func deref(t reflect.Type) reflect.Type { + for t.Kind() == reflect.Ptr { + t = t.Elem() + } + return t +} + +// assertStructKind checks if T can be dereferenced into a type with struct kind. +// +// We assert this because our unmarshaling logic currently only supports structs. +// This can be removed if we ever support scalar values. +func assertStructKind[T any]() error { + var instance T + t := deref(reflect.TypeOf(instance)) + if t.Kind() != reflect.Struct { + return fmt.Errorf("configoptional: %q does not have a struct kind", t) + } + + return nil +} + +// assertNoEnabledField checks that a struct type +// does not have a field with a mapstructure tag "enabled". +// +// We assert this because we discussed an alternative design where we have an explicit +// "enabled" field in the struct to indicate if the struct is enabled or not. +// See https://github.com/open-telemetry/opentelemetry-collector/pull/13060. +// This can be removed if we ever support such a design (or if we just want to allow +// the "enabled" field in the struct). +func assertNoEnabledField[T any]() error { + var i T + t := deref(reflect.TypeOf(i)) + if t.Kind() != reflect.Struct { + // Not a struct, no need to check for "enabled" field. + return nil + } + + // Check if the struct has a field with the name "enabled". + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + mapstructureTags := strings.SplitN(field.Tag.Get("mapstructure"), ",", 2) + if len(mapstructureTags) > 0 && mapstructureTags[0] == "enabled" { + return errors.New("configoptional: underlying type cannot have a field with mapstructure tag 'enabled'") + } + } + return nil +} + +// Some creates an Optional with a value and no factory. +// +// It panics if T has a field with the mapstructure tag "enabled". +func Some[T any](value T) Optional[T] { + if err := assertNoEnabledField[T](); err != nil { + panic(err) + } + return Optional[T]{value: value, flavor: someFlavor} +} + +// Default creates an Optional with a default value for unmarshaling. +// +// It panics if +// - T is not a struct OR +// - T has a field with the mapstructure tag "enabled". +func Default[T any](value T) Optional[T] { + err := errors.Join(assertStructKind[T](), assertNoEnabledField[T]()) + if err != nil { + panic(err) + } + return Optional[T]{value: value, flavor: defaultFlavor} +} + +// None has no value. It has the same behavior as a nil pointer when unmarshaling. +// +// The zero value of Optional[T] is None[T]. Prefer using this constructor +// for validation. +// +// It panics if T has a field with the mapstructure tag "enabled". +func None[T any]() Optional[T] { + if err := assertNoEnabledField[T](); err != nil { + panic(err) + } + return Optional[T]{} +} + +// HasValue checks if the Optional has a value. +func (o Optional[T]) HasValue() bool { + return o.flavor == someFlavor +} + +// Get returns the value of the Optional. +// If the value is not present, it returns nil. +func (o *Optional[T]) Get() *T { + if !o.HasValue() { + return nil + } + return &o.value +} + +var _ confmap.Unmarshaler = (*Optional[any])(nil) + +// Unmarshal the configuration into the Optional value. +// +// The behavior of this method depends on the state of the Optional: +// - None[T]: does nothing if the configuration is nil, otherwise it unmarshals into the zero value of T. +// - Some[T](val): equivalent to unmarshaling into a field of type T with value val. +// - Default[T](val), equivalent to unmarshaling into a field of type T with base value val, +// using val without overrides from the configuration if the configuration is nil. +// +// T must be derefenceable to a type with struct kind and not have an 'enabled' field. +// Scalar values are not supported. +func (o *Optional[T]) Unmarshal(conf *confmap.Conf) error { + if err := assertNoEnabledField[T](); err != nil { + return err + } + + if o.flavor == noneFlavor && conf.ToStringMap() == nil { + // If the Optional is None and the configuration is nil, we do nothing. + // This replicates the behavior of unmarshaling into a field with a nil pointer. + return nil + } + + if err := conf.Unmarshal(&o.value); err != nil { + return err + } + + o.flavor = someFlavor + return nil +} + +var _ confmap.Marshaler = (*Optional[any])(nil) + +// Marshal the Optional value into the configuration. +// If the Optional is None or Default, it does not marshal anything. +// If the Optional is Some, it marshals the value into the configuration. +// +// T must be derefenceable to a type with struct kind. +// Scalar values are not supported. +func (o Optional[T]) Marshal(conf *confmap.Conf) error { + if err := assertStructKind[T](); err != nil { + return err + } + + if o.flavor == noneFlavor || o.flavor == defaultFlavor { + // Optional is None or Default, do not marshal anything. + return conf.Marshal(map[string]any(nil)) + } + + if err := conf.Marshal(o.value); err != nil { + return fmt.Errorf("configoptional: failed to marshal Optional value: %w", err) + } + + return nil +} diff --git a/vendor/go.opentelemetry.io/collector/confmap/confmap.go b/vendor/go.opentelemetry.io/collector/confmap/confmap.go index b7ccf0fa1..4009cd786 100644 --- a/vendor/go.opentelemetry.io/collector/confmap/confmap.go +++ b/vendor/go.opentelemetry.io/collector/confmap/confmap.go @@ -580,11 +580,22 @@ func marshalerHookFunc(orig any) mapstructure.DecodeHookFuncValue { if !ok { return from.Interface(), nil } - conf := New() + conf := NewFromStringMap(nil) if err := marshaler.Marshal(conf); err != nil { return nil, err } - return conf.ToStringMap(), nil + + stringMap := conf.ToStringMap() + if stringMap == nil { + // If conf is still nil after marshaling, we want to encode it as an untyped nil + // instead of a map-typed nil. This ensures the value is a proper null value + // in the final marshaled output instead of an empty map. We hit this case + // when marshaling wrapper structs that have no direct representation + // in the marshaled output that aren't tagged with "squash" on the fields + // they're used on. + return nil, nil + } + return stringMap, nil }) } diff --git a/vendor/go.opentelemetry.io/collector/confmap/internal/mapstructure/encoder.go b/vendor/go.opentelemetry.io/collector/confmap/internal/mapstructure/encoder.go index 777dbd92d..100f37c4d 100644 --- a/vendor/go.opentelemetry.io/collector/confmap/internal/mapstructure/encoder.go +++ b/vendor/go.opentelemetry.io/collector/confmap/internal/mapstructure/encoder.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/go-viper/mapstructure/v2" - yaml "sigs.k8s.io/yaml/goyaml.v3" + yaml "go.yaml.in/yaml/v3" ) const ( @@ -165,7 +165,12 @@ func (e *Encoder) encodeMap(value reflect.Value) (any, error) { Kind: value.Kind(), } } - result := make(map[string]any) + + var result map[string]any + if value.Len() > 0 || !value.IsNil() { + result = make(map[string]any) + } + iterator := value.MapRange() for iterator.Next() { encoded, err := e.encode(iterator.Key()) diff --git a/vendor/go.opentelemetry.io/collector/confmap/provider.go b/vendor/go.opentelemetry.io/collector/confmap/provider.go index 7d2704fe0..68f74ab83 100644 --- a/vendor/go.opentelemetry.io/collector/confmap/provider.go +++ b/vendor/go.opentelemetry.io/collector/confmap/provider.go @@ -9,7 +9,7 @@ import ( "time" "go.uber.org/zap" - yaml "sigs.k8s.io/yaml/goyaml.v3" + yaml "go.yaml.in/yaml/v3" ) // ProviderSettings are the settings to initialize a Provider. diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumererror/error.go b/vendor/go.opentelemetry.io/collector/consumer/consumererror/error.go new file mode 100644 index 000000000..00f0ddc62 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/consumer/consumererror/error.go @@ -0,0 +1,176 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" + +import ( + "errors" + "fmt" + "net/http" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "go.opentelemetry.io/collector/consumer/consumererror/internal/statusconversion" +) + +// Error is intended to be used to encapsulate various information that can add +// context to an error that occurred within a pipeline component. Error objects +// are constructed through calling `New` with the relevant options to capture +// data around the error that occurred. +// +// Error should be obtained from a given `error` object using `errors.As`. +type Error struct { + error + httpStatus int + grpcStatus *status.Status + isRetryable bool +} + +var _ error = (*Error)(nil) + +// NewOTLPHTTPError records an HTTP status code that was received from a server +// during data submission. +// +// NOTE: This function will panic if passed an HTTP status between 200 and 299 inclusive. +// This is to reserve the behavior for handling these codes for the future. +func NewOTLPHTTPError(origErr error, httpStatus int) error { + // Matches what is considered a successful response in the OTLP/HTTP Exporter. + if httpStatus >= 200 && httpStatus <= 299 { + panic("NewOTLPHTTPError should not be called with a success code") + } + var retryable bool + switch httpStatus { + case http.StatusTooManyRequests, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout: + retryable = true + } + + return &Error{error: origErr, httpStatus: httpStatus, isRetryable: retryable} +} + +// NewOTLPGRPCError records a gRPC status code that was received from a server +// during data submission. +// +// NOTE: This function will panic if passed a *status.Status with an underlying +// code of codes.OK. This is to reserve the behavior for handling this code for +// the future. +func NewOTLPGRPCError(origErr error, status *status.Status) error { + var retryable bool + if status != nil { + switch status.Code() { + case codes.Canceled, codes.DeadlineExceeded, codes.Aborted, codes.OutOfRange, codes.Unavailable, codes.DataLoss: + retryable = true + // Matches what is considered a successful response in the OTLP Exporter. + case codes.OK: + panic("NewOTLPGRPCError should not be called with an OK code") + } + } + + return &Error{error: origErr, grpcStatus: status, isRetryable: retryable} +} + +// NewRetryableError records that this error is retryable according to OTLP specification. +func NewRetryableError(origErr error) error { + return &Error{error: origErr, isRetryable: true} +} + +// Error implements the error interface. +// +// If an error object was given, that is used. +// Otherwise, the gRPC error from the status.Status is used, +// or an error message containing the HTTP status code is given. +func (e *Error) Error() string { + if e.error != nil { + return e.error.Error() + } + + if e.grpcStatus != nil { + return e.grpcStatus.Err().Error() + } else if e.httpStatus > 0 { + return fmt.Sprintf("network error: received HTTP status %d", e.httpStatus) + } + + return "uninitialized consumererror.Error" +} + +// Unwrap returns the wrapped error for use by `errors.Is` and `errors.As`. +// +// If an error object was not passed but a gRPC `status.Status` was passed, +// the underlying error from the status is returned. +func (e *Error) Unwrap() error { + if e.error != nil { + return e.error + } + + if e.grpcStatus != nil { + return e.grpcStatus.Err() + } + + return nil +} + +// IsRetryable returns true if the error was created with NewRetryableError, if +// the HTTP status code is retryable according to OTLP, or if the gRPC status is +// retryable according to OTLP. Otherwise, returns false. +// +// See https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md for retryable +// HTTP and gRPC codes. +func (e *Error) IsRetryable() bool { + return e.isRetryable +} + +// ToHTTPStatus returns an HTTP status code either directly set by the source on +// an [Error] object, derived from a gRPC status code set by the source, or +// derived from Retryable. When deriving the value, the OTLP specification is +// used to map to HTTP. See +// https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md +// for more details. +// +// If a http status code cannot be derived from these three sources then 500 is +// returned. +func ToHTTPStatus(err error) int { + var e *Error + if errors.As(err, &e) { + if e.httpStatus != 0 { + return e.httpStatus + } + if e.grpcStatus != nil { + return statusconversion.GetHTTPStatusCodeFromStatus(e.grpcStatus) + } + if e.isRetryable { + return http.StatusServiceUnavailable + } + } + return http.StatusInternalServerError +} + +// ToGRPCStatus returns a gRPC status code either directly set by the source on +// an [Error] object, derived from an HTTP status code set by the +// source, or derived from Retryable. When deriving the value, the OTLP +// specification is used to map to gRPC. See +// https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md +// for more details. +// +// If an [Error] object is not present, then we attempt to get a status.Status from the +// error tree. +// +// If a status.Status cannot be derived from these sources then INTERNAL is +// returned. +func ToGRPCStatus(err error) *status.Status { + var e *Error + if errors.As(err, &e) { + if e.grpcStatus != nil { + return e.grpcStatus + } + if e.httpStatus != 0 { + return statusconversion.NewStatusFromMsgAndHTTPCode(e.Error(), e.httpStatus) + } + if e.isRetryable { + return status.New(codes.Unavailable, e.Error()) + } + } + if st, ok := status.FromError(err); ok { + return st + } + return status.New(codes.Unknown, e.Error()) +} diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumererror/internal/statusconversion/conversion.go b/vendor/go.opentelemetry.io/collector/consumer/consumererror/internal/statusconversion/conversion.go new file mode 100644 index 000000000..4c34cd068 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/consumer/consumererror/internal/statusconversion/conversion.go @@ -0,0 +1,64 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package statusconversion // import "go.opentelemetry.io/collector/consumer/consumererror/internal/statusconversion" + +import ( + "net/http" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func GetHTTPStatusCodeFromStatus(s *status.Status) int { + // See https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md#failures + // to see if a code is retryable. + // See https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md#failures-1 + // to see a list of retryable http status codes. + switch s.Code() { + // Retryable + case codes.Canceled, codes.DeadlineExceeded, codes.Aborted, codes.OutOfRange, codes.Unavailable, codes.DataLoss: + return http.StatusServiceUnavailable + // Retryable + case codes.ResourceExhausted: + return http.StatusTooManyRequests + // Not Retryable + case codes.InvalidArgument: + return http.StatusBadRequest + // Not Retryable + case codes.Unauthenticated: + return http.StatusUnauthorized + // Not Retryable + case codes.PermissionDenied: + return http.StatusForbidden + // Not Retryable + case codes.Unimplemented: + return http.StatusNotFound + // Not Retryable + default: + return http.StatusInternalServerError + } +} + +func NewStatusFromMsgAndHTTPCode(errMsg string, statusCode int) *status.Status { + var c codes.Code + // Mapping based on https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md + // 429 mapping to ResourceExhausted and 400 mapping to StatusBadRequest are exceptions. + switch statusCode { + case http.StatusBadRequest: + c = codes.InvalidArgument + case http.StatusUnauthorized: + c = codes.Unauthenticated + case http.StatusForbidden: + c = codes.PermissionDenied + case http.StatusNotFound: + c = codes.Unimplemented + case http.StatusTooManyRequests: + c = codes.ResourceExhausted + case http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout: + c = codes.Unavailable + default: + c = codes.Unknown + } + return status.New(c, errMsg) +} diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumererror/signalerrors.go b/vendor/go.opentelemetry.io/collector/consumer/consumererror/signalerrors.go index 69af253da..3ee068532 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/consumererror/signalerrors.go +++ b/vendor/go.opentelemetry.io/collector/consumer/consumererror/signalerrors.go @@ -20,7 +20,7 @@ type Traces struct { func NewTraces(err error, data ptrace.Traces) error { return Traces{ Retryable: internal.Retryable[ptrace.Traces]{ - Err: err, + Err: NewRetryableError(err), Value: data, }, } @@ -36,7 +36,7 @@ type Logs struct { func NewLogs(err error, data plog.Logs) error { return Logs{ Retryable: internal.Retryable[plog.Logs]{ - Err: err, + Err: NewRetryableError(err), Value: data, }, } @@ -52,7 +52,7 @@ type Metrics struct { func NewMetrics(err error, data pmetric.Metrics) error { return Metrics{ Retryable: internal.Retryable[pmetric.Metrics]{ - Err: err, + Err: NewRetryableError(err), Value: data, }, } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/README.md b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/README.md index c2a8f2e87..0149d630b 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/README.md +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/README.md @@ -27,6 +27,9 @@ The following configuration options can be modified: - `flush_timeout`: time after which a batch will be sent regardless of its size. Must be a non-zero value - `min_size`: the minimum size of a batch. - `max_size`: the maximum size of a batch, enables batch splitting. The maximum size of a batch should be greater than or equal to the minimum size of a batch. + - `sizer`: Overrides the sizer set at the `sending_queue` level for batching. Available options: + - `items`: number of the smallest parts of each signal (spans, metric data points, log records); + - `bytes`: the size of serialized data in bytes (the least performant option). - `timeout` (default = 5s): Time to wait per individual attempt to send data to a backend The `initial_interval`, `max_interval`, `max_elapsed_time`, and `timeout` options accept diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/base_exporter.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/base_exporter.go index 0742a4c04..7631699a2 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/base_exporter.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/base_exporter.go @@ -48,7 +48,6 @@ type BaseExporter struct { queueBatchSettings QueueBatchSettings[request.Request] queueCfg queuebatch.Config - batcherCfg BatcherConfig } func NewBaseExporter(set exporter.Settings, signal pipeline.Signal, pusher sender.SendFunc[request.Request], options ...Option) (*BaseExporter, error) { @@ -83,21 +82,22 @@ func NewBaseExporter(set exporter.Settings, signal pipeline.Signal, pusher sende return nil, err } - if be.batcherCfg.Enabled || be.queueCfg.Batch != nil { + if be.queueCfg.Batch.HasValue() { // Batcher mutates the data. be.ConsumerOptions = append(be.ConsumerOptions, consumer.WithCapabilities(consumer.Capabilities{MutatesData: true})) } - if be.queueCfg.Enabled || be.batcherCfg.Enabled { + if be.queueCfg.Enabled { qSet := queuebatch.Settings[request.Request]{ Signal: signal, ID: set.ID, Telemetry: set.TelemetrySettings, Encoding: be.queueBatchSettings.Encoding, - Sizers: be.queueBatchSettings.Sizers, + ItemsSizer: be.queueBatchSettings.ItemsSizer, + BytesSizer: be.queueBatchSettings.BytesSizer, Partitioner: be.queueBatchSettings.Partitioner, } - be.QueueSender, err = NewQueueSender(qSet, be.queueCfg, be.batcherCfg, be.ExportFailureMessage, be.firstSender) + be.QueueSender, err = NewQueueSender(qSet, be.queueCfg, be.ExportFailureMessage, be.firstSender) if err != nil { return nil, err } @@ -232,18 +232,6 @@ func WithCapabilities(capabilities consumer.Capabilities) Option { } } -// WithBatcher enables batching for an exporter based on custom request types. -// For now, it can be used only with the New[Traces|Metrics|Logs|Profiles]Request exporter helpers and -// WithRequestBatchFuncs provided. -// This API is at the early stage of development and may change without backward compatibility -// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. -func WithBatcher(cfg BatcherConfig) Option { - return func(o *BaseExporter) error { - o.batcherCfg = cfg - return nil - } -} - // WithQueueBatchSettings is used to set the QueueBatchSettings for the new request based exporter helper. // It must be provided as the first option when creating a new exporter helper. func WithQueueBatchSettings(set QueueBatchSettings[request.Request]) Option { diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/async_queue.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/async_queue.go similarity index 93% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/async_queue.go rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/async_queue.go index 57720cf75..675ab6cbc 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/async_queue.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/async_queue.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" import ( "context" diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/cond.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/cond.go similarity index 93% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/cond.go rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/cond.go index 707a72936..facb38aa8 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/cond.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/cond.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" import ( "context" diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/fg.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/fg.go new file mode 100644 index 000000000..a2fa3fef8 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/fg.go @@ -0,0 +1,21 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" + +import "go.opentelemetry.io/collector/featuregate" + +// PersistRequestContextFeatureGate controls whether request context should be preserved in the persistent queue. +var PersistRequestContextFeatureGate = featuregate.GlobalRegistry().MustRegister( + "exporter.PersistRequestContext", + featuregate.StageAlpha, + featuregate.WithRegisterFromVersion("v0.128.0"), + featuregate.WithRegisterDescription("controls whether context should be stored alongside requests in the persistent queue"), +) + +// assign the feature gate to separate functions to make it possible to override the behavior in tests +// on write and read paths separately. +var ( + PersistRequestContextOnRead = PersistRequestContextFeatureGate.IsEnabled + PersistRequestContextOnWrite = PersistRequestContextFeatureGate.IsEnabled +) diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/memory_queue.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/memory_queue.go similarity index 91% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/memory_queue.go rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/memory_queue.go index 1914d447e..54709a54b 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/memory_queue.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/memory_queue.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" import ( "context" @@ -25,14 +25,6 @@ var ( errSizeTooLarge = errors.New("element size too large") ) -// memoryQueueSettings defines internal parameters for boundedMemoryQueue creation. -type memoryQueueSettings[T any] struct { - sizer request.Sizer[T] - capacity int64 - waitForResult bool - blockOnOverflow bool -} - // memoryQueue is an in-memory implementation of a Queue. type memoryQueue[T any] struct { component.StartFunc @@ -51,13 +43,13 @@ type memoryQueue[T any] struct { // newMemoryQueue creates a sized elements channel. Each element is assigned a size by the provided sizer. // capacity is the capacity of the queue. -func newMemoryQueue[T any](set memoryQueueSettings[T]) readableQueue[T] { +func newMemoryQueue[T any](set Settings[T]) readableQueue[T] { sq := &memoryQueue[T]{ - sizer: set.sizer, - cap: set.capacity, + sizer: set.activeSizer(), + cap: set.Capacity, items: &linkedQueue[T]{}, - waitForResult: set.waitForResult, - blockOnOverflow: set.blockOnOverflow, + waitForResult: set.WaitForResult, + blockOnOverflow: set.BlockOnOverflow, } sq.hasMoreElements = sync.NewCond(&sq.mu) sq.hasMoreSpace = newCond(&sq.mu) diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/meta.pb.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/meta.pb.go new file mode 100644 index 000000000..a89fa718f --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/meta.pb.go @@ -0,0 +1,463 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exporter/exporterhelper/internal/queue/meta.proto + +package queue + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PersistentMetadata holds all persistent metadata for the queue. +// The items and bytes sizes are recorded explicitly, +// the requests size can be calculated as (write_index - read_index + len(currently_dispatched_items)). +type PersistentMetadata struct { + // Current total items size of the queue. + ItemsSize int64 `protobuf:"fixed64,1,opt,name=items_size,json=itemsSize,proto3" json:"items_size,omitempty"` + // Current total bytes size of the queue. + BytesSize int64 `protobuf:"fixed64,2,opt,name=bytes_size,json=bytesSize,proto3" json:"bytes_size,omitempty"` + // Index of the next item to be read from the queue. + ReadIndex uint64 `protobuf:"fixed64,3,opt,name=read_index,json=readIndex,proto3" json:"read_index,omitempty"` + // Index where the next item will be written to the queue. + WriteIndex uint64 `protobuf:"fixed64,4,opt,name=write_index,json=writeIndex,proto3" json:"write_index,omitempty"` + // List of item indices currently being processed by consumers. + CurrentlyDispatchedItems []uint64 `protobuf:"fixed64,5,rep,packed,name=currently_dispatched_items,json=currentlyDispatchedItems,proto3" json:"currently_dispatched_items,omitempty"` +} + +func (m *PersistentMetadata) Reset() { *m = PersistentMetadata{} } +func (m *PersistentMetadata) String() string { return proto.CompactTextString(m) } +func (*PersistentMetadata) ProtoMessage() {} +func (*PersistentMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_8ad1b29fca6d4f37, []int{0} +} +func (m *PersistentMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PersistentMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PersistentMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PersistentMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_PersistentMetadata.Merge(m, src) +} +func (m *PersistentMetadata) XXX_Size() int { + return m.Size() +} +func (m *PersistentMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_PersistentMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_PersistentMetadata proto.InternalMessageInfo + +func (m *PersistentMetadata) GetItemsSize() int64 { + if m != nil { + return m.ItemsSize + } + return 0 +} + +func (m *PersistentMetadata) GetBytesSize() int64 { + if m != nil { + return m.BytesSize + } + return 0 +} + +func (m *PersistentMetadata) GetReadIndex() uint64 { + if m != nil { + return m.ReadIndex + } + return 0 +} + +func (m *PersistentMetadata) GetWriteIndex() uint64 { + if m != nil { + return m.WriteIndex + } + return 0 +} + +func (m *PersistentMetadata) GetCurrentlyDispatchedItems() []uint64 { + if m != nil { + return m.CurrentlyDispatchedItems + } + return nil +} + +func init() { + proto.RegisterType((*PersistentMetadata)(nil), "opentelemetry.collector.exporter.exporterhelper.internal.queue.PersistentMetadata") +} + +func init() { + proto.RegisterFile("exporter/exporterhelper/internal/queue/meta.proto", fileDescriptor_8ad1b29fca6d4f37) +} + +var fileDescriptor_8ad1b29fca6d4f37 = []byte{ + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x03, 0x41, + 0x14, 0x45, 0x33, 0x46, 0x03, 0x19, 0x1b, 0xd9, 0x6a, 0x11, 0x5c, 0x83, 0x55, 0xaa, 0x59, 0xc4, + 0x56, 0x2c, 0x24, 0x4d, 0x0a, 0x41, 0x62, 0x67, 0xe1, 0x32, 0xd9, 0xbd, 0x98, 0x81, 0xc9, 0xcc, + 0xfa, 0xf6, 0x05, 0x93, 0x7c, 0x85, 0x9f, 0x65, 0x99, 0xd2, 0x52, 0x92, 0x1f, 0x91, 0x9d, 0x64, + 0x17, 0xd2, 0xd9, 0x3d, 0xce, 0xb9, 0x5c, 0x1e, 0x57, 0xde, 0x62, 0x59, 0x7a, 0x62, 0x50, 0xda, + 0x1c, 0x33, 0xd8, 0x12, 0x94, 0x1a, 0xc7, 0x20, 0xa7, 0x6d, 0xfa, 0xb1, 0xc0, 0x02, 0xe9, 0x1c, + 0xac, 0x55, 0x49, 0x9e, 0x7d, 0xf4, 0xe0, 0x4b, 0x38, 0x86, 0xc5, 0x1c, 0x4c, 0x2b, 0x95, 0x7b, + 0x6b, 0x91, 0xb3, 0x27, 0xd5, 0x34, 0xa8, 0xe3, 0x2a, 0xd5, 0x54, 0xa9, 0x50, 0x75, 0xb3, 0x11, + 0x32, 0x7a, 0x06, 0x55, 0xa6, 0x62, 0x38, 0x7e, 0x02, 0xeb, 0x42, 0xb3, 0x8e, 0xae, 0xa4, 0x34, + 0x8c, 0x79, 0x95, 0x55, 0x66, 0x8d, 0x58, 0x0c, 0xc4, 0xf0, 0x62, 0xd2, 0x0f, 0xe4, 0xc5, 0xac, + 0x51, 0xeb, 0xe9, 0x8a, 0x71, 0xd0, 0x27, 0x7b, 0x1d, 0x48, 0xa3, 0x09, 0xba, 0xc8, 0x8c, 0x2b, + 0xb0, 0x8c, 0xbb, 0x03, 0x31, 0xec, 0x4d, 0xfa, 0x35, 0x19, 0xd7, 0x20, 0xba, 0x96, 0xe7, 0x9f, + 0x64, 0x18, 0x07, 0x7f, 0x1a, 0xbc, 0x0c, 0x68, 0x1f, 0xb8, 0x97, 0x97, 0xf9, 0x82, 0x08, 0x8e, + 0xed, 0x2a, 0x2b, 0x4c, 0x55, 0x6a, 0xce, 0x67, 0x28, 0xb2, 0xf0, 0x40, 0x7c, 0x36, 0xe8, 0x0e, + 0x7b, 0x93, 0xb8, 0x4d, 0x8c, 0xda, 0xc0, 0xb8, 0xf6, 0x8f, 0x6f, 0xdf, 0xdb, 0x44, 0x6c, 0xb6, + 0x89, 0xf8, 0xdd, 0x26, 0xe2, 0x6b, 0x97, 0x74, 0x36, 0xbb, 0xa4, 0xf3, 0xb3, 0x4b, 0x3a, 0xaf, + 0xa3, 0x77, 0xaf, 0x8e, 0xf7, 0x32, 0x3e, 0x6d, 0x27, 0x4b, 0xff, 0xb7, 0xfe, 0xb4, 0x17, 0x96, + 0xbf, 0xfb, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x15, 0x90, 0x67, 0x5e, 0xae, 0x01, 0x00, 0x00, +} + +func (m *PersistentMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PersistentMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PersistentMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CurrentlyDispatchedItems) > 0 { + for iNdEx := len(m.CurrentlyDispatchedItems) - 1; iNdEx >= 0; iNdEx-- { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.CurrentlyDispatchedItems[iNdEx])) + } + i = encodeVarintMeta(dAtA, i, uint64(len(m.CurrentlyDispatchedItems)*8)) + i-- + dAtA[i] = 0x2a + } + if m.WriteIndex != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.WriteIndex)) + i-- + dAtA[i] = 0x21 + } + if m.ReadIndex != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.ReadIndex)) + i-- + dAtA[i] = 0x19 + } + if m.BytesSize != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.BytesSize)) + i-- + dAtA[i] = 0x11 + } + if m.ItemsSize != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.ItemsSize)) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func encodeVarintMeta(dAtA []byte, offset int, v uint64) int { + offset -= sovMeta(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PersistentMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ItemsSize != 0 { + n += 9 + } + if m.BytesSize != 0 { + n += 9 + } + if m.ReadIndex != 0 { + n += 9 + } + if m.WriteIndex != 0 { + n += 9 + } + if len(m.CurrentlyDispatchedItems) > 0 { + n += 1 + sovMeta(uint64(len(m.CurrentlyDispatchedItems)*8)) + len(m.CurrentlyDispatchedItems)*8 + } + return n +} + +func sovMeta(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMeta(x uint64) (n int) { + return sovMeta(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PersistentMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMeta + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PersistentMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PersistentMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ItemsSize", wireType) + } + m.ItemsSize = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.ItemsSize = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field BytesSize", wireType) + } + m.BytesSize = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.BytesSize = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadIndex", wireType) + } + m.ReadIndex = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.ReadIndex = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field WriteIndex", wireType) + } + m.WriteIndex = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.WriteIndex = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 5: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.CurrentlyDispatchedItems = append(m.CurrentlyDispatchedItems, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMeta + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMeta + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMeta + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.CurrentlyDispatchedItems) == 0 { + m.CurrentlyDispatchedItems = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.CurrentlyDispatchedItems = append(m.CurrentlyDispatchedItems, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentlyDispatchedItems", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipMeta(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMeta + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMeta(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMeta + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMeta + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMeta + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMeta + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMeta + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMeta + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMeta = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMeta = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMeta = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.proto b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/meta.proto similarity index 50% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.proto rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/meta.proto index 3b52978b8..8486133f5 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.proto +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/meta.proto @@ -1,23 +1,18 @@ syntax = "proto3"; -package opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue; +package opentelemetry.collector.exporter.exporterhelper.internal.queue; -option go_package = "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue"; +option go_package = "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue"; -// Sizer type configuration -enum SizerType { - REQUESTS = 0; - ITEMS = 1; - BYTES = 2; -} - -// QueueMetadata holds all persistent metadata for the queue. -message QueueMetadata{ - // Sizer type configuration. - SizerType sizer_type = 1; +// PersistentMetadata holds all persistent metadata for the queue. +// The items and bytes sizes are recorded explicitly, +// the requests size can be calculated as (write_index - read_index + len(currently_dispatched_items)). +message PersistentMetadata{ + // Current total items size of the queue. + sfixed64 items_size = 1; - // Current total size of the queue (in bytes, items, or requests). - sfixed64 queue_size = 2; + // Current total bytes size of the queue. + sfixed64 bytes_size = 2; // Index of the next item to be read from the queue. fixed64 read_index = 3; diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/obs_queue.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/obs_queue.go similarity index 96% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/obs_queue.go rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/obs_queue.go index 4b69e4a54..1a0776511 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/obs_queue.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/obs_queue.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" import ( "context" diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/persistent_queue.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/persistent_queue.go similarity index 64% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/persistent_queue.go rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/persistent_queue.go index 065b6cced..cda2e1a7e 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/persistent_queue.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/persistent_queue.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" import ( "context" @@ -15,7 +15,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/experr" - "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/extension/xextension/storage" "go.opentelemetry.io/collector/pipeline" @@ -26,15 +25,12 @@ const ( zapErrorCount = "errorCount" zapNumberOfItems = "numberOfItems" - readIndexKey = "ri" - writeIndexKey = "wi" - currentlyDispatchedItemsKey = "di" - queueSizeKey = "si" + legacyReadIndexKey = "ri" + legacyWriteIndexKey = "wi" + legacyCurrentlyDispatchedItemsKey = "di" - // queueMetadataKey is the new single key for all queue metadata. - // TODO: Enable when https://github.com/open-telemetry/opentelemetry-collector/issues/12890 is done - //nolint:unused - queueMetadataKey = "qmv0" + // metadataKey is the new single key for all queue metadata. + metadataKey = "qmv0" ) var ( @@ -50,18 +46,6 @@ var indexDonePool = sync.Pool{ }, } -type persistentQueueSettings[T any] struct { - sizer request.Sizer[T] - sizerType request.SizerType - capacity int64 - blockOnOverflow bool - signal pipeline.Signal - storageID component.ID - encoding Encoding[T] - id component.ID - telemetry component.TelemetrySettings -} - // persistentQueue provides a persistent queue implementation backed by file storage extension // // Write index describes the position at which next item is going to be stored. @@ -85,29 +69,43 @@ type persistentQueueSettings[T any] struct { // index index x // xxxx deleted type persistentQueue[T any] struct { - set persistentQueueSettings[T] - logger *zap.Logger - client storage.Client - - // isRequestSized indicates whether the queue is sized by the number of requests. - isRequestSized bool + logger *zap.Logger + client storage.Client + encoding Encoding[T] + capacity int64 + sizerType request.SizerType + activeSizer request.Sizer[T] + itemsSizer request.Sizer[T] + bytesSizer request.Sizer[T] + storageID component.ID + id component.ID + signal pipeline.Signal // mu guards everything declared below. mu sync.Mutex hasMoreElements *sync.Cond hasMoreSpace *cond - metadata persistentqueue.QueueMetadata + metadata PersistentMetadata refClient int64 stopped bool + + blockOnOverflow bool } // newPersistentQueue creates a new queue backed by file storage; name and signal must be a unique combination that identifies the queue storage -func newPersistentQueue[T any](set persistentQueueSettings[T]) readableQueue[T] { - _, isRequestSized := set.sizer.(request.RequestsSizer[T]) +func newPersistentQueue[T any](set Settings[T]) readableQueue[T] { pq := &persistentQueue[T]{ - set: set, - logger: set.telemetry.Logger, - isRequestSized: isRequestSized, + logger: set.Telemetry.Logger, + encoding: set.Encoding, + capacity: set.Capacity, + sizerType: set.SizerType, + activeSizer: set.activeSizer(), + itemsSizer: set.ItemsSizer, + bytesSizer: set.BytesSizer, + storageID: *set.StorageID, + id: set.ID, + signal: set.Signal, + blockOnOverflow: set.BlockOnOverflow, } pq.hasMoreElements = sync.NewCond(&pq.mu) pq.hasMoreSpace = newCond(&pq.mu) @@ -116,7 +114,7 @@ func newPersistentQueue[T any](set persistentQueueSettings[T]) readableQueue[T] // Start starts the persistentQueue with the given number of consumers. func (pq *persistentQueue[T]) Start(ctx context.Context, host component.Host) error { - storageClient, err := toStorageClient(ctx, pq.set.storageID, host, pq.set.id, pq.set.signal) + storageClient, err := toStorageClient(ctx, pq.storageID, host, pq.id, pq.signal) if err != nil { return err } @@ -127,25 +125,80 @@ func (pq *persistentQueue[T]) Start(ctx context.Context, host component.Host) er func (pq *persistentQueue[T]) Size() int64 { pq.mu.Lock() defer pq.mu.Unlock() - return pq.metadata.QueueSize + return pq.internalSize() +} + +func (pq *persistentQueue[T]) internalSize() int64 { + switch pq.sizerType { + case request.SizerTypeBytes: + return pq.metadata.BytesSize + case request.SizerTypeItems: + return pq.metadata.ItemsSize + default: + return pq.requestSize() + } +} + +func (pq *persistentQueue[T]) requestSize() int64 { + //nolint:gosec + return int64(pq.metadata.WriteIndex-pq.metadata.ReadIndex) + int64(len(pq.metadata.CurrentlyDispatchedItems)) } func (pq *persistentQueue[T]) Capacity() int64 { - return pq.set.capacity + return pq.capacity } func (pq *persistentQueue[T]) initClient(ctx context.Context, client storage.Client) { pq.client = client // Start with a reference 1 which is the reference we use for the producer goroutines and initialization. pq.refClient = 1 - pq.initPersistentContiguousStorage(ctx) - // Make sure the leftover requests are handled - pq.retrieveAndEnqueueNotDispatchedReqs(ctx) + + // Try to load from new consolidated metadata first + err := pq.loadQueueMetadata(ctx) + switch { + case err == nil: + pq.enqueueNotDispatchedReqs(ctx, pq.metadata.CurrentlyDispatchedItems) + pq.metadata.CurrentlyDispatchedItems = nil + case !errors.Is(err, errValueNotSet): + pq.logger.Error("Failed getting metadata, starting with new ones", zap.Error(err)) + pq.metadata = PersistentMetadata{} + default: + pq.logger.Info("New queue metadata key not found, attempting to load legacy format.") + pq.loadLegacyMetadata(ctx) + } } -func (pq *persistentQueue[T]) initPersistentContiguousStorage(ctx context.Context) { - riOp := storage.GetOperation(readIndexKey) - wiOp := storage.GetOperation(writeIndexKey) +// loadQueueMetadata loads queue metadata from the consolidated key +func (pq *persistentQueue[T]) loadQueueMetadata(ctx context.Context) error { + buf, err := pq.client.Get(ctx, metadataKey) + if err != nil { + return err + } + + if len(buf) == 0 { + return errValueNotSet + } + + metadata := &pq.metadata + if err = metadata.Unmarshal(buf); err != nil { + return err + } + + pq.logger.Info("Loaded queue metadata", + zap.Uint64("readIndex", pq.metadata.ReadIndex), + zap.Uint64("writeIndex", pq.metadata.WriteIndex), + zap.Int64("itemsSize", pq.metadata.ItemsSize), + zap.Int64("bytesSize", pq.metadata.BytesSize), + zap.Int("dispatchedItems", len(pq.metadata.CurrentlyDispatchedItems))) + + return nil +} + +// TODO: Remove legacy format support after 6 months (target: December 2025) +func (pq *persistentQueue[T]) loadLegacyMetadata(ctx context.Context) { + // Fallback to legacy individual keys for backward compatibility + riOp := storage.GetOperation(legacyReadIndexKey) + wiOp := storage.GetOperation(legacyWriteIndexKey) err := pq.client.Batch(ctx, riOp, wiOp) if err == nil { @@ -166,33 +219,28 @@ func (pq *persistentQueue[T]) initPersistentContiguousStorage(ctx context.Contex pq.metadata.WriteIndex = 0 } - queueSize := pq.metadata.WriteIndex - pq.metadata.ReadIndex + pq.retrieveAndEnqueueNotDispatchedReqs(ctx) - // If the queue is sized by the number of requests, no need to read the queue size from storage. - if queueSize > 0 && !pq.isRequestSized { - if restoredQueueSize, err := pq.restoreQueueSizeFromStorage(ctx); err == nil { - queueSize = restoredQueueSize - } + // Save to a new format and clean up legacy keys + metadataBytes, err := pq.metadata.Marshal() + if err != nil { + pq.logger.Error("Failed to marshal metadata", zap.Error(err)) + return } - //nolint:gosec - pq.metadata.QueueSize = int64(queueSize) -} -// restoreQueueSizeFromStorage restores the queue size from storage. -func (pq *persistentQueue[T]) restoreQueueSizeFromStorage(ctx context.Context) (uint64, error) { - val, err := pq.client.Get(ctx, queueSizeKey) - if err != nil { - if errors.Is(err, errValueNotSet) { - pq.logger.Warn("Cannot read the queue size snapshot from storage. "+ - "The reported queue size will be inaccurate until the initial queue is drained. "+ - "It's expected when the items sized queue enabled for the first time", zap.Error(err)) - } else { - pq.logger.Error("Failed to read the queue size snapshot from storage. "+ - "The reported queue size will be inaccurate until the initial queue is drained.", zap.Error(err)) - } - return 0, err + if err = pq.client.Set(ctx, metadataKey, metadataBytes); err != nil { + pq.logger.Error("Failed to persist current metadata to storage", zap.Error(err)) + return + } + + if err = pq.client.Batch(ctx, + storage.DeleteOperation(legacyReadIndexKey), + storage.DeleteOperation(legacyWriteIndexKey), + storage.DeleteOperation(legacyCurrentlyDispatchedItemsKey)); err != nil { + pq.logger.Warn("Failed to cleanup legacy metadata keys", zap.Error(err)) + } else { + pq.logger.Info("Successfully migrated to consolidated metadata format") } - return bytesToItemIndex(val) } func (pq *persistentQueue[T]) Shutdown(ctx context.Context) error { @@ -203,24 +251,10 @@ func (pq *persistentQueue[T]) Shutdown(ctx context.Context) error { pq.mu.Lock() defer pq.mu.Unlock() - backupErr := pq.backupQueueSize(ctx) // Mark this queue as stopped, so consumer don't start any more work. pq.stopped = true pq.hasMoreElements.Broadcast() - return errors.Join(backupErr, pq.unrefClient(ctx)) -} - -// backupQueueSize writes the current queue size to storage. The value is used to recover the queue size -// in case if the collector is killed. -func (pq *persistentQueue[T]) backupQueueSize(ctx context.Context) error { - // No need to write the queue size if the queue is sized by the number of requests. - // That information is already stored as difference between read and write indexes. - if pq.isRequestSized { - return nil - } - - //nolint:gosec - return pq.client.Set(ctx, queueSizeKey, itemIndexToBytes(uint64(pq.metadata.QueueSize))) + return pq.unrefClient(ctx) } // unrefClient unrefs the client, and closes if no more references. Callers MUST hold the mutex. @@ -239,14 +273,10 @@ func (pq *persistentQueue[T]) unrefClient(ctx context.Context) error { func (pq *persistentQueue[T]) Offer(ctx context.Context, req T) error { pq.mu.Lock() defer pq.mu.Unlock() - return pq.putInternal(ctx, req) -} -// putInternal is the internal version that requires caller to hold the mutex lock. -func (pq *persistentQueue[T]) putInternal(ctx context.Context, req T) error { - reqSize := pq.set.sizer.Sizeof(req) - for pq.metadata.QueueSize+reqSize > pq.set.capacity { - if !pq.set.blockOnOverflow { + size := pq.activeSizer.Sizeof(req) + for pq.internalSize()+size > pq.capacity { + if !pq.blockOnOverflow { return ErrQueueIsFull } if err := pq.hasMoreSpace.Wait(ctx); err != nil { @@ -254,32 +284,38 @@ func (pq *persistentQueue[T]) putInternal(ctx context.Context, req T) error { } } - reqBuf, err := pq.set.encoding.Marshal(req) + pq.metadata.ItemsSize += pq.itemsSizer.Sizeof(req) + pq.metadata.BytesSize += pq.bytesSizer.Sizeof(req) + + return pq.putInternal(ctx, req) +} + +// putInternal adds the request to the storage without updating items/bytes sizes. +func (pq *persistentQueue[T]) putInternal(ctx context.Context, req T) error { + pq.metadata.WriteIndex++ + + metadataBuf, err := pq.metadata.Marshal() if err != nil { return err } + reqBuf, err := pq.encoding.Marshal(ctx, req) + if err != nil { + return err + } // Carry out a transaction where we both add the item and update the write index ops := []*storage.Operation{ - storage.SetOperation(writeIndexKey, itemIndexToBytes(pq.metadata.WriteIndex+1)), - storage.SetOperation(getItemKey(pq.metadata.WriteIndex), reqBuf), + storage.SetOperation(metadataKey, metadataBuf), + storage.SetOperation(getItemKey(pq.metadata.WriteIndex-1), reqBuf), } if err = pq.client.Batch(ctx, ops...); err != nil { + // At this moment, metadata may be updated in the storage, so we cannot just revert changes to the + // metadata, rely on the sizes being fixed on complete draining. return err } - pq.metadata.WriteIndex++ - pq.metadata.QueueSize += reqSize pq.hasMoreElements.Signal() - // Back up the queue size to storage every 10 writes. The stored value is used to recover the queue size - // in case if the collector is killed. The recovered queue size is allowed to be inaccurate. - if (pq.metadata.WriteIndex % 10) == 5 { - if err := pq.backupQueueSize(ctx); err != nil { - pq.logger.Error("Error writing queue size to storage", zap.Error(err)) - } - } - return nil } @@ -295,17 +331,19 @@ func (pq *persistentQueue[T]) Read(ctx context.Context) (context.Context, T, Don // Read until either a successful retrieved element or no more elements in the storage. for pq.metadata.ReadIndex != pq.metadata.WriteIndex { - index, req, consumed := pq.getNextItem(ctx) - // Ensure the used size and the channel size are in sync. - if pq.metadata.ReadIndex == pq.metadata.WriteIndex { - pq.metadata.QueueSize = 0 - pq.hasMoreSpace.Signal() + index, req, reqCtx, consumed := pq.getNextItem(ctx) + // Ensure the used size are in sync when queue is drained. + if pq.requestSize() == 0 { + pq.metadata.BytesSize = 0 + pq.metadata.ItemsSize = 0 } if consumed { id := indexDonePool.Get().(*indexDone) - id.reset(index, pq.set.sizer.Sizeof(req), pq) - return context.Background(), req, id, true + id.reset(index, pq.itemsSizer.Sizeof(req), pq.bytesSizer.Sizeof(req), pq) + return reqCtx, req, id, true } + // More space available, data was dropped. + pq.hasMoreSpace.Signal() } // TODO: Need to change the Queue interface to return an error to allow distinguish between shutdown and context canceled. @@ -317,20 +355,23 @@ func (pq *persistentQueue[T]) Read(ctx context.Context) (context.Context, T, Don // getNextItem pulls the next available item from the persistent storage along with its index. Once processing is // finished, the index should be called with onDone to clean up the storage. If no new item is available, // returns false. -func (pq *persistentQueue[T]) getNextItem(ctx context.Context) (uint64, T, bool) { +func (pq *persistentQueue[T]) getNextItem(ctx context.Context) (uint64, T, context.Context, bool) { index := pq.metadata.ReadIndex // Increase here, so even if errors happen below, it always iterates pq.metadata.ReadIndex++ pq.metadata.CurrentlyDispatchedItems = append(pq.metadata.CurrentlyDispatchedItems, index) - getOp := storage.GetOperation(getItemKey(index)) - err := pq.client.Batch(ctx, - storage.SetOperation(readIndexKey, itemIndexToBytes(pq.metadata.ReadIndex)), - storage.SetOperation(currentlyDispatchedItemsKey, itemIndexArrayToBytes(pq.metadata.CurrentlyDispatchedItems)), - getOp) - var request T + var req T + restoredCtx := context.Background() + metadataBytes, err := pq.metadata.Marshal() + if err != nil { + return 0, req, restoredCtx, false + } + + getOp := storage.GetOperation(getItemKey(index)) + err = pq.client.Batch(ctx, storage.SetOperation(metadataKey, metadataBytes), getOp) if err == nil { - request, err = pq.set.encoding.Unmarshal(getOp.Value) + restoredCtx, req, err = pq.encoding.Unmarshal(getOp.Value) } if err != nil { @@ -340,18 +381,18 @@ func (pq *persistentQueue[T]) getNextItem(ctx context.Context) (uint64, T, bool) pq.logger.Error("Error deleting item from queue", zap.Error(err)) } - return 0, request, false + return 0, req, restoredCtx, false } // Increase the reference count, so the client is not closed while the request is being processed. // The client cannot be closed because we hold the lock since last we checked `stopped`. pq.refClient++ - return index, request, true + return index, req, restoredCtx, true } // onDone should be called to remove the item of the given index from the queue once processing is finished. -func (pq *persistentQueue[T]) onDone(index uint64, elSize int64, consumeErr error) { +func (pq *persistentQueue[T]) onDone(index uint64, itemsSize int64, bytesSize int64, consumeErr error) { // Delete the item from the persistent storage after it was processed. pq.mu.Lock() // Always unref client even if the consumer is shutdown because we always ref it for every valid request. @@ -362,32 +403,27 @@ func (pq *persistentQueue[T]) onDone(index uint64, elSize int64, consumeErr erro pq.mu.Unlock() }() - pq.metadata.QueueSize -= elSize - // The size might be not in sync with the queue in case it's restored from the disk - // because we don't flush the current queue size on the disk on every read/write. - // In that case we need to make sure it doesn't go below 0. - if pq.metadata.QueueSize < 0 { - pq.metadata.QueueSize = 0 - } - pq.hasMoreSpace.Signal() - if experr.IsShutdownErr(consumeErr) { // The queue is shutting down, don't mark the item as dispatched, so it's picked up again after restart. // TODO: Handle partially delivered requests by updating their values in the storage. return } + pq.metadata.BytesSize -= bytesSize + if pq.metadata.BytesSize < 0 { + pq.metadata.BytesSize = 0 + } + pq.metadata.ItemsSize -= itemsSize + if pq.metadata.ItemsSize < 0 { + pq.metadata.ItemsSize = 0 + } + if err := pq.itemDispatchingFinish(context.Background(), index); err != nil { pq.logger.Error("Error deleting item from queue", zap.Error(err)) } - // Back up the queue size to storage on every 10 reads. The stored value is used to recover the queue size - // in case if the collector is killed. The recovered queue size is allowed to be inaccurate. - if (pq.metadata.ReadIndex % 10) == 0 { - if qsErr := pq.backupQueueSize(context.Background()); qsErr != nil { - pq.logger.Error("Error writing queue size to storage", zap.Error(qsErr)) - } - } + // More space available after data are removed from the storage. + pq.hasMoreSpace.Signal() } // retrieveAndEnqueueNotDispatchedReqs gets the items for which sending was not finished, cleans the storage @@ -398,7 +434,7 @@ func (pq *persistentQueue[T]) retrieveAndEnqueueNotDispatchedReqs(ctx context.Co pq.mu.Lock() defer pq.mu.Unlock() pq.logger.Debug("Checking if there are items left for dispatch by consumers") - itemKeysBuf, err := pq.client.Get(ctx, currentlyDispatchedItemsKey) + itemKeysBuf, err := pq.client.Get(ctx, legacyCurrentlyDispatchedItemsKey) if err == nil { dispatchedItems, err = bytesToItemIndexArray(itemKeysBuf) } @@ -407,6 +443,10 @@ func (pq *persistentQueue[T]) retrieveAndEnqueueNotDispatchedReqs(ctx context.Co return } + pq.enqueueNotDispatchedReqs(ctx, dispatchedItems) +} + +func (pq *persistentQueue[T]) enqueueNotDispatchedReqs(ctx context.Context, dispatchedItems []uint64) { if len(dispatchedItems) == 0 { pq.logger.Debug("No items left for dispatch by consumers") return @@ -439,13 +479,13 @@ func (pq *persistentQueue[T]) retrieveAndEnqueueNotDispatchedReqs(ctx context.Co pq.logger.Warn("Failed retrieving item", zap.String(zapKey, op.Key), zap.Error(errValueNotSet)) continue } - req, err := pq.set.encoding.Unmarshal(op.Value) + reqCtx, req, err := pq.encoding.Unmarshal(op.Value) // If error happened or item is nil, it will be efficiently ignored if err != nil { pq.logger.Warn("Failed unmarshalling item", zap.String(zapKey, op.Key), zap.Error(err)) continue } - if pq.putInternal(ctx, req) != nil { + if pq.putInternal(reqCtx, req) != nil { errCount++ } } @@ -470,23 +510,35 @@ func (pq *persistentQueue[T]) itemDispatchingFinish(ctx context.Context, index u } } - setOp := storage.SetOperation(currentlyDispatchedItemsKey, itemIndexArrayToBytes(pq.metadata.CurrentlyDispatchedItems)) + // Ensure the used size are in sync when queue is drained. + if pq.requestSize() == 0 { + pq.metadata.BytesSize = 0 + pq.metadata.ItemsSize = 0 + } + + metadataBytes, err := pq.metadata.Marshal() + if err != nil { + return err + } + + setOp := storage.SetOperation(metadataKey, metadataBytes) deleteOp := storage.DeleteOperation(getItemKey(index)) - if err := pq.client.Batch(ctx, setOp, deleteOp); err != nil { - // got an error, try to gracefully handle it - pq.logger.Warn("Failed updating currently dispatched items, trying to delete the item first", - zap.Error(err)) - } else { + err = pq.client.Batch(ctx, setOp, deleteOp) + if err == nil { // Everything ok, exit return nil } - if err := pq.client.Batch(ctx, deleteOp); err != nil { + // got an error, try to gracefully handle it + pq.logger.Warn("Failed updating currently dispatched items, trying to delete the item first", + zap.Error(err)) + + if err = pq.client.Batch(ctx, deleteOp); err != nil { // Return an error here, as this indicates an issue with the underlying storage medium return fmt.Errorf("failed deleting item from queue, got error from storage: %w", err) } - if err := pq.client.Batch(ctx, setOp); err != nil { + if err = pq.client.Batch(ctx, setOp); err != nil { // even if this fails, we still have the right dispatched items in memory // at worst, we'll have the wrong list in storage, and we'll discard the nonexistent items during startup return fmt.Errorf("failed updating currently dispatched items, but deleted item successfully: %w", err) @@ -513,10 +565,6 @@ func getItemKey(index uint64) string { return strconv.FormatUint(index, 10) } -func itemIndexToBytes(value uint64) []byte { - return binary.LittleEndian.AppendUint64([]byte{}, value) -} - func bytesToItemIndex(buf []byte) (uint64, error) { if buf == nil { return uint64(0), errValueNotSet @@ -528,17 +576,6 @@ func bytesToItemIndex(buf []byte) (uint64, error) { return binary.LittleEndian.Uint64(buf), nil } -func itemIndexArrayToBytes(arr []uint64) []byte { - size := len(arr) - buf := make([]byte, 0, 4+size*8) - //nolint:gosec - buf = binary.LittleEndian.AppendUint32(buf, uint32(size)) - for _, item := range arr { - buf = binary.LittleEndian.AppendUint64(buf, item) - } - return buf -} - func bytesToItemIndexArray(buf []byte) ([]uint64, error) { if len(buf) == 0 { return nil, nil @@ -568,19 +605,24 @@ func bytesToItemIndexArray(buf []byte) ([]uint64, error) { } type indexDone struct { - index uint64 - size int64 - queue interface { - onDone(uint64, int64, error) + index uint64 + itemsSize int64 + bytesSize int64 + queue interface { + onDone(uint64, int64, int64, error) } } -func (id *indexDone) reset(index uint64, size int64, queue interface{ onDone(uint64, int64, error) }) { +func (id *indexDone) reset(index uint64, itemsSize, bytesSize int64, queue interface { + onDone(uint64, int64, int64, error) +}, +) { id.index = index - id.size = size + id.itemsSize = itemsSize + id.bytesSize = bytesSize id.queue = queue } func (id *indexDone) OnDone(err error) { - id.queue.onDone(id.index, id.size, err) + id.queue.onDone(id.index, id.itemsSize, id.bytesSize, err) } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/queue.go similarity index 59% rename from vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue.go rename to vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/queue.go index 027d9958a..9583be9fb 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue/queue.go @@ -1,21 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" +package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" import ( "context" "errors" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" + "go.opentelemetry.io/collector/pipeline" ) type Encoding[T any] interface { // Marshal is a function that can marshal a request into bytes. - Marshal(T) ([]byte, error) + Marshal(context.Context, T) ([]byte, error) // Unmarshal is a function that can unmarshal bytes into a request. - Unmarshal([]byte) (T, error) + Unmarshal([]byte) (context.Context, T, error) } // ErrQueueIsFull is the error returned when an item is offered to the Queue and the queue is full and setup to @@ -51,6 +53,62 @@ type Queue[T any] interface { Capacity() int64 } +// Settings define internal parameters for a new Queue creation. +type Settings[T any] struct { + ItemsSizer request.Sizer[T] + BytesSizer request.Sizer[T] + SizerType request.SizerType + Capacity int64 + NumConsumers int + WaitForResult bool + BlockOnOverflow bool + Signal pipeline.Signal + StorageID *component.ID + Encoding Encoding[T] + ID component.ID + Telemetry component.TelemetrySettings +} + +func (set *Settings[T]) activeSizer() request.Sizer[T] { + switch set.SizerType { + case request.SizerTypeBytes: + return set.BytesSizer + case request.SizerTypeItems: + return set.ItemsSizer + default: + return request.RequestsSizer[T]{} + } +} + +func NewQueue[T request.Request](set Settings[T], next ConsumeFunc[T]) (Queue[T], error) { + q, err := newBaseQueue(set) + if err != nil { + return nil, err + } + + oq, err := newObsQueue(set, newAsyncQueue(q, set.NumConsumers, next)) + if err != nil { + return nil, err + } + + return oq, nil +} + +func newBaseQueue[T any](set Settings[T]) (readableQueue[T], error) { + // Configure memory queue or persistent based on the config. + if set.StorageID == nil { + return newMemoryQueue[T](set), nil + } + if set.ItemsSizer == nil { + return nil, errors.New("PersistentQueue requires ItemsSizer to be set") + } + if set.BytesSizer == nil { + return nil, errors.New("PersistentQueue requires BytesSizer to be set") + } + + return newPersistentQueue[T](set), nil +} + // TODO: Investigate why linter "unused" fails if add a private "read" func on the Queue. type readableQueue[T any] interface { Queue[T] diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue_sender.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue_sender.go index 1045aa720..1a71ad0e6 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue_sender.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue_sender.go @@ -5,14 +5,10 @@ package internal // import "go.opentelemetry.io/collector/exporter/exporterhelpe import ( "context" - "errors" - "fmt" - "math" - "runtime" - "time" "go.uber.org/zap" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender" @@ -20,8 +16,9 @@ import ( // QueueBatchSettings is a subset of the queuebatch.Settings that are needed when used within an Exporter. type QueueBatchSettings[T any] struct { - Encoding queuebatch.Encoding[T] - Sizers map[request.SizerType]request.Sizer[T] + Encoding queue.Encoding[T] + ItemsSizer request.Sizer[T] + BytesSizer request.Sizer[T] Partitioner queuebatch.Partitioner[T] } @@ -37,15 +34,12 @@ func NewDefaultQueueConfig() queuebatch.Config { // This default is probably still too high, and may be adjusted further down in a future release QueueSize: 1_000, BlockOnOverflow: false, - StorageID: nil, - Batch: nil, } } func NewQueueSender( qSet queuebatch.Settings[request.Request], qCfg queuebatch.Config, - bCfg BatcherConfig, exportFailureMessage string, next sender.Sender[request.Request], ) (sender.Sender[request.Request], error) { @@ -61,105 +55,5 @@ func NewQueueSender( return nil } - // TODO: Remove this when WithBatcher is removed. - if bCfg.Enabled { - return queuebatch.NewQueueBatchLegacyBatcher(qSet, newQueueBatchConfig(qCfg, bCfg), exportFunc) - } - return queuebatch.NewQueueBatch(qSet, newQueueBatchConfig(qCfg, bCfg), exportFunc) -} - -func newQueueBatchConfig(qCfg queuebatch.Config, bCfg BatcherConfig) queuebatch.Config { - // Overwrite configuration with the legacy BatcherConfig configured via WithBatcher. - // TODO: Remove this when WithBatcher is removed. - if !bCfg.Enabled { - return qCfg - } - - // User configured queueing, copy all config. - if qCfg.Enabled { - // Overwrite configuration with the legacy BatcherConfig configured via WithBatcher. - // TODO: Remove this when WithBatcher is removed. - qCfg.Batch = &queuebatch.BatchConfig{ - FlushTimeout: bCfg.FlushTimeout, - MinSize: bCfg.MinSize, - MaxSize: bCfg.MaxSize, - } - return qCfg - } - - // This can happen only if the deprecated way to configure batching is used with a "disabled" queue. - // TODO: Remove this when WithBatcher is removed. - return queuebatch.Config{ - Enabled: true, - WaitForResult: true, - Sizer: request.SizerTypeRequests, - QueueSize: math.MaxInt, - NumConsumers: runtime.NumCPU(), - BlockOnOverflow: true, - StorageID: nil, - Batch: &queuebatch.BatchConfig{ - FlushTimeout: bCfg.FlushTimeout, - MinSize: bCfg.MinSize, - MaxSize: bCfg.MaxSize, - }, - } -} - -// BatcherConfig defines a configuration for batching requests based on a timeout and a minimum number of items. -// Experimental: This API is at the early stage of development and may change without backward compatibility -// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. -type BatcherConfig struct { - // Enabled indicates whether to not enqueue batches before sending to the consumerSender. - Enabled bool `mapstructure:"enabled"` - - // FlushTimeout sets the time after which a batch will be sent regardless of its size. - FlushTimeout time.Duration `mapstructure:"flush_timeout"` - - // SizeConfig sets the size limits for a batch. - SizeConfig `mapstructure:",squash"` -} - -// SizeConfig sets the size limits for a batch. -type SizeConfig struct { - Sizer request.SizerType `mapstructure:"sizer"` - - // MinSize defines the configuration for the minimum size of a batch. - MinSize int64 `mapstructure:"min_size"` - // MaxSize defines the configuration for the maximum size of a batch. - MaxSize int64 `mapstructure:"max_size"` -} - -func (c *BatcherConfig) Validate() error { - if !c.Enabled { - return nil - } - - if c.FlushTimeout <= 0 { - return errors.New("`flush_timeout` must be greater than zero") - } - - if c.Sizer != request.SizerTypeItems { - return fmt.Errorf("unsupported sizer type: %q", c.Sizer) - } - if c.MinSize < 0 { - return errors.New("`min_size` must be greater than or equal to zero") - } - if c.MaxSize < 0 { - return errors.New("`max_size` must be greater than or equal to zero") - } - if c.MaxSize != 0 && c.MaxSize < c.MinSize { - return errors.New("`max_size` must be greater than or equal to mix_size") - } - return nil -} - -func NewDefaultBatcherConfig() BatcherConfig { - return BatcherConfig{ - Enabled: true, - FlushTimeout: 200 * time.Millisecond, - SizeConfig: SizeConfig{ - Sizer: request.SizerTypeItems, - MinSize: 8192, - }, - } + return queuebatch.NewQueueBatch(qSet, qCfg, exportFunc) } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/batcher.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/batcher.go index 5e2b3dbc8..474f69e72 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/batcher.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/batcher.go @@ -5,8 +5,11 @@ package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhel import ( "context" + "fmt" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configoptional" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender" ) @@ -14,25 +17,41 @@ import ( // Batcher is in charge of reading items from the queue and send them out asynchronously. type Batcher[T any] interface { component.Component - Consume(context.Context, T, Done) + Consume(context.Context, T, queue.Done) } type batcherSettings[T any] struct { - sizerType request.SizerType - sizer request.Sizer[T] + itemsSizer request.Sizer[T] + bytesSizer request.Sizer[T] partitioner Partitioner[T] next sender.SendFunc[T] maxWorkers int } -func NewBatcher(cfg *BatchConfig, set batcherSettings[request.Request]) Batcher[request.Request] { - if cfg == nil { - return newDisabledBatcher[request.Request](set.next) +func NewBatcher(cfg configoptional.Optional[BatchConfig], set batcherSettings[request.Request]) (Batcher[request.Request], error) { + if !cfg.HasValue() { + return newDisabledBatcher[request.Request](set.next), nil + } + + sizer := activeSizer(cfg.Get().Sizer, set.itemsSizer, set.bytesSizer) + if sizer == nil { + return nil, fmt.Errorf("queue_batch: unsupported sizer %q", cfg.Get().Sizer) } if set.partitioner == nil { - return newPartitionBatcher(*cfg, set.sizerType, set.sizer, newWorkerPool(set.maxWorkers), set.next) + return newPartitionBatcher(*cfg.Get(), sizer, newWorkerPool(set.maxWorkers), set.next), nil } - return newMultiBatcher(*cfg, set.sizerType, set.sizer, newWorkerPool(set.maxWorkers), set.partitioner, set.next) + return newMultiBatcher(*cfg.Get(), sizer, newWorkerPool(set.maxWorkers), set.partitioner, set.next), nil +} + +func activeSizer[T any](sizerType request.SizerType, itemsSizer, bytesSizer request.Sizer[T]) request.Sizer[T] { + switch sizerType { + case request.SizerTypeBytes: + return bytesSizer + case request.SizerTypeItems: + return itemsSizer + default: + return request.RequestsSizer[T]{} + } } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/config.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/config.go index 8e19c3c7c..5f031c165 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/config.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/config.go @@ -8,6 +8,7 @@ import ( "time" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configoptional" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" ) @@ -32,9 +33,6 @@ type Config struct { // If true, the component will wait for space; otherwise, operations will immediately return a retryable error. BlockOnOverflow bool `mapstructure:"block_on_overflow"` - // Deprecated: [v0.123.0] use `block_on_overflow`. - Blocking bool `mapstructure:"blocking"` - // StorageID if not empty, enables the persistent storage and uses the component specified // as a storage extension for the persistent queue. // TODO: This will be changed to Optional when available. @@ -47,11 +45,7 @@ type Config struct { NumConsumers int `mapstructure:"num_consumers"` // BatchConfig it configures how the requests are consumed from the queue and batch together during consumption. - // TODO: This will be changed to Optional when available. - Batch *BatchConfig `mapstructure:"batch"` - - // TODO: Remove when deprecated "blocking" is removed. - hasBlocking bool + Batch configoptional.Optional[BatchConfig] `mapstructure:"batch"` } func (cfg *Config) Unmarshal(conf *confmap.Conf) error { @@ -59,12 +53,10 @@ func (cfg *Config) Unmarshal(conf *confmap.Conf) error { return err } - // If user still uses the old blocking, override and will log error during initialization. - if conf.IsSet("blocking") { - cfg.hasBlocking = true - cfg.BlockOnOverflow = cfg.Blocking + // If the batch sizer is not set, use the same value as the queue sizer. + if !conf.IsSet("batch::sizer") && cfg.Batch.HasValue() { + cfg.Batch.Get().Sizer = cfg.Sizer } - return nil } @@ -87,19 +79,9 @@ func (cfg *Config) Validate() error { return errors.New("`wait_for_result` is not supported with a persistent queue configured with `storage`") } - // Only support request sizer for persistent queue at this moment. - if cfg.StorageID != nil && cfg.Sizer != request.SizerTypeRequests { - return errors.New("persistent queue configured with `storage` only supports `requests` sizer") - } - - if cfg.Batch != nil { - // Only support items or bytes sizer for batch at this moment. - if cfg.Sizer != request.SizerTypeItems && cfg.Sizer != request.SizerTypeBytes { - return errors.New("`batch` supports only `items` or `bytes` sizer") - } - + if cfg.Batch.HasValue() && cfg.Batch.Get().Sizer == cfg.Sizer { // Avoid situations where the queue is not able to hold any data. - if cfg.Batch.MinSize > cfg.QueueSize { + if cfg.Batch.Get().MinSize > cfg.QueueSize { return errors.New("`min_size` must be less than or equal to `queue_size`") } } @@ -112,6 +94,11 @@ type BatchConfig struct { // FlushTimeout sets the time after which a batch will be sent regardless of its size. FlushTimeout time.Duration `mapstructure:"flush_timeout"` + // Sizer determines the type of size measurement used by the batch. + // If not configured, use the same configuration as the queue. + // It accepts "requests", "items", or "bytes". + Sizer request.SizerType `mapstructure:"sizer"` + // MinSize defines the configuration for the minimum size of a batch. MinSize int64 `mapstructure:"min_size"` @@ -124,6 +111,11 @@ func (cfg *BatchConfig) Validate() error { return nil } + // Only support items or bytes sizer for batch at this moment. + if cfg.Sizer != request.SizerTypeItems && cfg.Sizer != request.SizerTypeBytes { + return errors.New("`batch` supports only `items` or `bytes` sizer") + } + if cfg.FlushTimeout <= 0 { return errors.New("`flush_timeout` must be positive") } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/disabled_batcher.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/disabled_batcher.go index 7d3d8cd47..b2a4678bf 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/disabled_batcher.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/disabled_batcher.go @@ -7,6 +7,7 @@ import ( "context" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender" ) @@ -18,7 +19,7 @@ type disabledBatcher[T any] struct { consumeFunc sender.SendFunc[T] } -func (db *disabledBatcher[T]) Consume(ctx context.Context, req T, done Done) { +func (db *disabledBatcher[T]) Consume(ctx context.Context, req T, done queue.Done) { done.OnDone(db.consumeFunc(ctx, req)) } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.pb.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.pb.go deleted file mode 100644 index 6350c411b..000000000 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.pb.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.6 -// source: exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/meta.proto - -package persistentqueue - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Sizer type configuration -type SizerType int32 - -const ( - SizerType_REQUESTS SizerType = 0 - SizerType_ITEMS SizerType = 1 - SizerType_BYTES SizerType = 2 -) - -// Enum value maps for SizerType. -var ( - SizerType_name = map[int32]string{ - 0: "REQUESTS", - 1: "ITEMS", - 2: "BYTES", - } - SizerType_value = map[string]int32{ - "REQUESTS": 0, - "ITEMS": 1, - "BYTES": 2, - } -) - -func (x SizerType) Enum() *SizerType { - p := new(SizerType) - *p = x - return p -} - -func (x SizerType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SizerType) Descriptor() protoreflect.EnumDescriptor { - return file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_enumTypes[0].Descriptor() -} - -func (SizerType) Type() protoreflect.EnumType { - return &file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_enumTypes[0] -} - -func (x SizerType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SizerType.Descriptor instead. -func (SizerType) EnumDescriptor() ([]byte, []int) { - return file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescGZIP(), []int{0} -} - -// QueueMetadata holds all persistent metadata for the queue. -type QueueMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Sizer type configuration. - SizerType SizerType `protobuf:"varint,1,opt,name=sizer_type,json=sizerType,proto3,enum=opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue.SizerType" json:"sizer_type,omitempty"` - // Current total size of the queue (in bytes, items, or requests). - QueueSize int64 `protobuf:"fixed64,2,opt,name=queue_size,json=queueSize,proto3" json:"queue_size,omitempty"` - // Index of the next item to be read from the queue. - ReadIndex uint64 `protobuf:"fixed64,3,opt,name=read_index,json=readIndex,proto3" json:"read_index,omitempty"` - // Index where the next item will be written to the queue. - WriteIndex uint64 `protobuf:"fixed64,4,opt,name=write_index,json=writeIndex,proto3" json:"write_index,omitempty"` - // List of item indices currently being processed by consumers. - CurrentlyDispatchedItems []uint64 `protobuf:"fixed64,5,rep,packed,name=currently_dispatched_items,json=currentlyDispatchedItems,proto3" json:"currently_dispatched_items,omitempty"` -} - -func (x *QueueMetadata) Reset() { - *x = QueueMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueueMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueueMetadata) ProtoMessage() {} - -func (x *QueueMetadata) ProtoReflect() protoreflect.Message { - mi := &file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueueMetadata.ProtoReflect.Descriptor instead. -func (*QueueMetadata) Descriptor() ([]byte, []int) { - return file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescGZIP(), []int{0} -} - -func (x *QueueMetadata) GetSizerType() SizerType { - if x != nil { - return x.SizerType - } - return SizerType_REQUESTS -} - -func (x *QueueMetadata) GetQueueSize() int64 { - if x != nil { - return x.QueueSize - } - return 0 -} - -func (x *QueueMetadata) GetReadIndex() uint64 { - if x != nil { - return x.ReadIndex - } - return 0 -} - -func (x *QueueMetadata) GetWriteIndex() uint64 { - if x != nil { - return x.WriteIndex - } - return 0 -} - -func (x *QueueMetadata) GetCurrentlyDispatchedItems() []uint64 { - if x != nil { - return x.CurrentlyDispatchedItems - } - return nil -} - -var File_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto protoreflect.FileDescriptor - -var file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDesc = []byte{ - 0x0a, 0x4f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, - 0x74, 0x71, 0x75, 0x65, 0x75, 0x65, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x5c, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, - 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x68, 0x65, 0x6c, 0x70, - 0x65, 0x72, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x71, 0x75, 0x65, 0x75, - 0x65, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x71, 0x75, 0x65, 0x75, 0x65, 0x22, - 0xb5, 0x02, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x75, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, - 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, - 0x71, 0x75, 0x65, 0x75, 0x65, 0x2e, 0x53, 0x69, 0x7a, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x09, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x71, 0x75, - 0x65, 0x75, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x10, 0x52, 0x09, - 0x71, 0x75, 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x61, - 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x06, 0x52, 0x09, 0x72, - 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0a, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3c, 0x0a, 0x1a, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x64, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x06, 0x52, 0x18, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x2a, 0x2f, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x53, - 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x54, 0x45, 0x4d, 0x53, 0x10, 0x01, 0x12, 0x09, 0x0a, - 0x05, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x02, 0x42, 0x64, 0x5a, 0x62, 0x67, 0x6f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x68, 0x65, 0x6c, 0x70, 0x65, - 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x75, 0x65, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, - 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x71, 0x75, 0x65, 0x75, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescOnce sync.Once - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescData = file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDesc -) - -func file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescGZIP() []byte { - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescOnce.Do(func() { - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescData = protoimpl.X.CompressGZIP(file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescData) - }) - return file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDescData -} - -var file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_goTypes = []interface{}{ - (SizerType)(0), // 0: opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue.SizerType - (*QueueMetadata)(nil), // 1: opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue.QueueMetadata -} -var file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_depIdxs = []int32{ - 0, // 0: opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue.QueueMetadata.sizer_type:type_name -> opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue.SizerType - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_init() -} -func file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_init() { - if File_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueueMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_goTypes, - DependencyIndexes: file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_depIdxs, - EnumInfos: file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_enumTypes, - MessageInfos: file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_msgTypes, - }.Build() - File_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto = out.File - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_rawDesc = nil - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_goTypes = nil - file_exporter_exporterhelper_internal_queuebatch_internal_persistentqueue_meta_proto_depIdxs = nil -} diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/sizer_conversion.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/sizer_conversion.go deleted file mode 100644 index 384cb74d0..000000000 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue/sizer_conversion.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package persistentqueue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue" - -import ( - "fmt" - - "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" -) - -// SizerTypeToProto converts SizerType to int32 for protobuf serialization -func SizerTypeToProto(sizerType request.SizerType) (SizerType, error) { - switch sizerType { - case request.SizerTypeRequests: - return SizerType_REQUESTS, nil - case request.SizerTypeItems: - return SizerType_ITEMS, nil - case request.SizerTypeBytes: - return SizerType_BYTES, nil - default: - return -1, fmt.Errorf("invalid sizer type: %v", sizerType) - } -} - -// SizerTypeFromProto creates SizerType from int32 representation -func SizerTypeFromProto(value SizerType) (request.SizerType, error) { - switch value { - case SizerType_REQUESTS: - return request.SizerTypeRequests, nil - case SizerType_ITEMS: - return request.SizerTypeItems, nil - case SizerType_BYTES: - return request.SizerTypeBytes, nil - default: - return request.SizerType{}, fmt.Errorf("invalid sizer type value: %d", value) - } -} diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/multi_batcher.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/multi_batcher.go index 8cdda63c6..cc618c629 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/multi_batcher.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/multi_batcher.go @@ -7,6 +7,7 @@ import ( "sync" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender" ) @@ -16,7 +17,6 @@ var _ Batcher[request.Request] = (*multiBatcher)(nil) type multiBatcher struct { cfg BatchConfig wp *workerPool - sizerType request.SizerType sizer request.Sizer[request.Request] partitioner Partitioner[request.Request] consumeFunc sender.SendFunc[request.Request] @@ -25,7 +25,6 @@ type multiBatcher struct { func newMultiBatcher( bCfg BatchConfig, - sizerType request.SizerType, sizer request.Sizer[request.Request], wp *workerPool, partitioner Partitioner[request.Request], @@ -34,7 +33,6 @@ func newMultiBatcher( return &multiBatcher{ cfg: bCfg, wp: wp, - sizerType: sizerType, sizer: sizer, partitioner: partitioner, consumeFunc: next, @@ -48,7 +46,7 @@ func (mb *multiBatcher) getPartition(ctx context.Context, req request.Request) * if found { return s.(*partitionBatcher) } - newS := newPartitionBatcher(mb.cfg, mb.sizerType, mb.sizer, mb.wp, mb.consumeFunc) + newS := newPartitionBatcher(mb.cfg, mb.sizer, mb.wp, mb.consumeFunc) _ = newS.Start(ctx, nil) s, loaded := mb.shards.LoadOrStore(key, newS) // If not loaded, there was a race condition in adding the new shard. Shutdown the newly created shard. @@ -62,7 +60,7 @@ func (mb *multiBatcher) Start(context.Context, component.Host) error { return nil } -func (mb *multiBatcher) Consume(ctx context.Context, req request.Request, done Done) { +func (mb *multiBatcher) Consume(ctx context.Context, req request.Request, done queue.Done) { shard := mb.getPartition(ctx, req) shard.Consume(ctx, req, done) } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/partition_batcher.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/partition_batcher.go index e0556a9e8..24e2a0c86 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/partition_batcher.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/partition_batcher.go @@ -11,6 +11,7 @@ import ( "go.uber.org/multierr" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender" ) @@ -27,7 +28,6 @@ type batch struct { type partitionBatcher struct { cfg BatchConfig wp *workerPool - sizerType request.SizerType sizer request.Sizer[request.Request] consumeFunc sender.SendFunc[request.Request] stopWG sync.WaitGroup @@ -39,7 +39,6 @@ type partitionBatcher struct { func newPartitionBatcher( cfg BatchConfig, - sizerType request.SizerType, sizer request.Sizer[request.Request], wp *workerPool, next sender.SendFunc[request.Request], @@ -47,7 +46,6 @@ func newPartitionBatcher( return &partitionBatcher{ cfg: cfg, wp: wp, - sizerType: sizerType, sizer: sizer, consumeFunc: next, shutdownCh: make(chan struct{}, 1), @@ -60,11 +58,11 @@ func (qb *partitionBatcher) resetTimer() { } } -func (qb *partitionBatcher) Consume(ctx context.Context, req request.Request, done Done) { +func (qb *partitionBatcher) Consume(ctx context.Context, req request.Request, done queue.Done) { qb.currentBatchMu.Lock() if qb.currentBatch == nil { - reqList, mergeSplitErr := req.MergeSplit(ctx, int(qb.cfg.MaxSize), qb.sizerType, nil) + reqList, mergeSplitErr := req.MergeSplit(ctx, int(qb.cfg.MaxSize), qb.cfg.Sizer, nil) if mergeSplitErr != nil || len(reqList) == 0 { done.OnDone(mergeSplitErr) qb.currentBatchMu.Unlock() @@ -98,7 +96,7 @@ func (qb *partitionBatcher) Consume(ctx context.Context, req request.Request, do return } - reqList, mergeSplitErr := qb.currentBatch.req.MergeSplit(ctx, int(qb.cfg.MaxSize), qb.sizerType, req) + reqList, mergeSplitErr := qb.currentBatch.req.MergeSplit(ctx, int(qb.cfg.MaxSize), qb.cfg.Sizer, req) // If failed to merge signal all Done callbacks from the current batch as well as the current request and reset the current batch. if mergeSplitErr != nil || len(reqList) == 0 { done.OnDone(mergeSplitErr) @@ -203,7 +201,7 @@ func (qb *partitionBatcher) flushCurrentBatchIfNecessary() { } // flush starts a goroutine that calls consumeFunc. It blocks until a worker is available if necessary. -func (qb *partitionBatcher) flush(ctx context.Context, req request.Request, done Done) { +func (qb *partitionBatcher) flush(ctx context.Context, req request.Request, done queue.Done) { qb.stopWG.Add(1) qb.wp.execute(func() { defer qb.stopWG.Done() @@ -229,7 +227,7 @@ func (wp *workerPool) execute(f func()) { wp.workers <- struct{}{} } -type multiDone []Done +type multiDone []queue.Done func (mdc multiDone) OnDone(err error) { for _, d := range mdc { @@ -238,13 +236,13 @@ func (mdc multiDone) OnDone(err error) { } type refCountDone struct { - done Done + done queue.Done mu sync.Mutex refCount int64 err error } -func newRefCountDone(done Done, refCount int64) Done { +func newRefCountDone(done queue.Done, refCount int64) queue.Done { return &refCountDone{ done: done, refCount: refCount, diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue_batch.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue_batch.go index f0e5b7300..53d1b7b51 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue_batch.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/queue_batch.go @@ -6,9 +6,9 @@ package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhel import ( "context" "errors" - "fmt" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender" "go.opentelemetry.io/collector/pipeline" @@ -19,13 +19,14 @@ type Settings[T any] struct { Signal pipeline.Signal ID component.ID Telemetry component.TelemetrySettings - Encoding Encoding[T] - Sizers map[request.SizerType]request.Sizer[T] + Encoding queue.Encoding[T] + ItemsSizer request.Sizer[T] + BytesSizer request.Sizer[T] Partitioner Partitioner[T] } type QueueBatch struct { - queue Queue[request.Request] + queue queue.Queue[request.Request] batcher Batcher[request.Request] } @@ -34,82 +35,41 @@ func NewQueueBatch( cfg Config, next sender.SendFunc[request.Request], ) (*QueueBatch, error) { - return newQueueBatch(set, cfg, next, false) -} - -func NewQueueBatchLegacyBatcher( - set Settings[request.Request], - cfg Config, - next sender.SendFunc[request.Request], -) (*QueueBatch, error) { - set.Telemetry.Logger.Warn("Configuring the exporter batcher capability separately is now deprecated. " + - "Use sending_queue::batch instead.") - return newQueueBatch(set, cfg, next, true) -} - -func newQueueBatch( - set Settings[request.Request], - cfg Config, - next sender.SendFunc[request.Request], - oldBatcher bool, -) (*QueueBatch, error) { - if cfg.hasBlocking { - set.Telemetry.Logger.Error("using deprecated field `blocking`") - } - - sizer, ok := set.Sizers[cfg.Sizer] - if !ok { - return nil, fmt.Errorf("queue_batch: unsupported sizer %q", cfg.Sizer) - } - - bSet := batcherSettings[request.Request]{ - sizerType: cfg.Sizer, - sizer: sizer, + b, err := NewBatcher(cfg.Batch, batcherSettings[request.Request]{ + itemsSizer: set.ItemsSizer, + bytesSizer: set.BytesSizer, partitioner: set.Partitioner, next: next, maxWorkers: cfg.NumConsumers, + }) + if err != nil { + return nil, err } - if oldBatcher { - // If a user configures the old batcher, we only can support "items" sizer. - bSet.sizerType = request.SizerTypeItems - bSet.sizer = request.NewItemsSizer() - } - b := NewBatcher(cfg.Batch, bSet) - if cfg.Batch != nil { + if cfg.Batch.HasValue() { // If batching is enabled, keep the number of queue consumers to 1 if batching is enabled until we support // sharding as described in https://github.com/open-telemetry/opentelemetry-collector/issues/12473 cfg.NumConsumers = 1 } - var q Queue[request.Request] - // Configure memory queue or persistent based on the config. - if cfg.StorageID == nil { - q = newAsyncQueue(newMemoryQueue[request.Request](memoryQueueSettings[request.Request]{ - sizer: sizer, - capacity: cfg.QueueSize, - waitForResult: cfg.WaitForResult, - blockOnOverflow: cfg.BlockOnOverflow, - }), cfg.NumConsumers, b.Consume) - } else { - q = newAsyncQueue(newPersistentQueue[request.Request](persistentQueueSettings[request.Request]{ - sizer: sizer, - sizerType: cfg.Sizer, - capacity: cfg.QueueSize, - blockOnOverflow: cfg.BlockOnOverflow, - signal: set.Signal, - storageID: *cfg.StorageID, - encoding: set.Encoding, - id: set.ID, - telemetry: set.Telemetry, - }), cfg.NumConsumers, b.Consume) - } - - oq, err := newObsQueue(set, q) + q, err := queue.NewQueue[request.Request](queue.Settings[request.Request]{ + SizerType: cfg.Sizer, + ItemsSizer: set.ItemsSizer, + BytesSizer: set.BytesSizer, + Capacity: cfg.QueueSize, + NumConsumers: cfg.NumConsumers, + WaitForResult: cfg.WaitForResult, + BlockOnOverflow: cfg.BlockOnOverflow, + Signal: set.Signal, + StorageID: cfg.StorageID, + Encoding: set.Encoding, + ID: set.ID, + Telemetry: set.Telemetry, + }, b.Consume) if err != nil { return nil, err } - return &QueueBatch{queue: oq, batcher: b}, nil + return &QueueBatch{queue: q, batcher: b}, nil } // Start is invoked during service startup. diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/logs.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/logs.go index 8d40eb4fd..ee78e682d 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/logs.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/logs.go @@ -14,9 +14,11 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sizer" "go.opentelemetry.io/collector/pdata/plog" + pdatareq "go.opentelemetry.io/collector/pdata/xpdata/request" "go.opentelemetry.io/collector/pipeline" ) @@ -30,14 +32,11 @@ var ( // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewLogsQueueBatchSettings() QueueBatchSettings { return QueueBatchSettings{ - Encoding: logsEncoding{}, - Sizers: map[RequestSizerType]request.Sizer[Request]{ - RequestSizerTypeRequests: NewRequestsSizer(), - RequestSizerTypeItems: request.NewItemsSizer(), - RequestSizerTypeBytes: request.BaseSizer{ - SizeofFunc: func(req request.Request) int64 { - return int64(logsMarshaler.LogsSize(req.(*logsRequest).ld)) - }, + Encoding: logsEncoding{}, + ItemsSizer: request.NewItemsSizer(), + BytesSizer: request.BaseSizer{ + SizeofFunc: func(req request.Request) int64 { + return int64(logsMarshaler.LogsSize(req.(*logsRequest).ld)) }, }, } @@ -57,16 +56,32 @@ func newLogsRequest(ld plog.Logs) Request { type logsEncoding struct{} -func (logsEncoding) Unmarshal(bytes []byte) (Request, error) { +var _ QueueBatchEncoding[Request] = logsEncoding{} + +func (logsEncoding) Unmarshal(bytes []byte) (context.Context, Request, error) { + if queue.PersistRequestContextOnRead() { + ctx, logs, err := pdatareq.UnmarshalLogs(bytes) + if errors.Is(err, pdatareq.ErrInvalidFormat) { + // fall back to unmarshaling without context + logs, err = logsUnmarshaler.UnmarshalLogs(bytes) + } + return ctx, newLogsRequest(logs), err + } + logs, err := logsUnmarshaler.UnmarshalLogs(bytes) if err != nil { - return nil, err + var req Request + return context.Background(), req, err } - return newLogsRequest(logs), nil + return context.Background(), newLogsRequest(logs), nil } -func (logsEncoding) Marshal(req Request) ([]byte, error) { - return logsMarshaler.MarshalLogs(req.(*logsRequest).ld) +func (logsEncoding) Marshal(ctx context.Context, req Request) ([]byte, error) { + logs := req.(*logsRequest).ld + if queue.PersistRequestContextOnWrite() { + return pdatareq.MarshalLogs(ctx, logs) + } + return logsMarshaler.MarshalLogs(logs) } func (req *logsRequest) OnError(err error) Request { diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics.go index f05748ad3..0018b1173 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics.go @@ -14,9 +14,11 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sizer" "go.opentelemetry.io/collector/pdata/pmetric" + pdatareq "go.opentelemetry.io/collector/pdata/xpdata/request" "go.opentelemetry.io/collector/pipeline" ) @@ -30,14 +32,11 @@ var ( // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewMetricsQueueBatchSettings() QueueBatchSettings { return QueueBatchSettings{ - Encoding: metricsEncoding{}, - Sizers: map[RequestSizerType]request.Sizer[Request]{ - RequestSizerTypeRequests: NewRequestsSizer(), - RequestSizerTypeItems: request.NewItemsSizer(), - RequestSizerTypeBytes: request.BaseSizer{ - SizeofFunc: func(req request.Request) int64 { - return int64(metricsMarshaler.MetricsSize(req.(*metricsRequest).md)) - }, + Encoding: metricsEncoding{}, + ItemsSizer: request.NewItemsSizer(), + BytesSizer: request.BaseSizer{ + SizeofFunc: func(req request.Request) int64 { + return int64(metricsMarshaler.MetricsSize(req.(*metricsRequest).md)) }, }, } @@ -57,16 +56,31 @@ func newMetricsRequest(md pmetric.Metrics) Request { type metricsEncoding struct{} -func (metricsEncoding) Unmarshal(bytes []byte) (Request, error) { +var _ QueueBatchEncoding[Request] = metricsEncoding{} + +func (metricsEncoding) Unmarshal(bytes []byte) (context.Context, Request, error) { + if queue.PersistRequestContextOnRead() { + ctx, metrics, err := pdatareq.UnmarshalMetrics(bytes) + if errors.Is(err, pdatareq.ErrInvalidFormat) { + // fall back to unmarshaling without context + metrics, err = metricsUnmarshaler.UnmarshalMetrics(bytes) + } + return ctx, newMetricsRequest(metrics), err + } metrics, err := metricsUnmarshaler.UnmarshalMetrics(bytes) if err != nil { - return nil, err + var req Request + return context.Background(), req, err } - return newMetricsRequest(metrics), nil + return context.Background(), newMetricsRequest(metrics), nil } -func (metricsEncoding) Marshal(req Request) ([]byte, error) { - return metricsMarshaler.MarshalMetrics(req.(*metricsRequest).md) +func (metricsEncoding) Marshal(ctx context.Context, req Request) ([]byte, error) { + metrics := req.(*metricsRequest).md + if queue.PersistRequestContextOnWrite() { + return pdatareq.MarshalMetrics(ctx, metrics) + } + return metricsMarshaler.MarshalMetrics(metrics) } func (req *metricsRequest) OnError(err error) Request { diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics_batch.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics_batch.go index 9fa9665f7..29e4a0070 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics_batch.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/metrics_batch.go @@ -177,13 +177,21 @@ func extractMetricDataPoints(srcMetric pmetric.Metric, capacity int, sz sizer.Me destMetric, removedSize = extractGaugeDataPoints(srcMetric.Gauge(), capacity, sz) case pmetric.MetricTypeSum: destMetric, removedSize = extractSumDataPoints(srcMetric.Sum(), capacity, sz) + destMetric.Sum().SetIsMonotonic(srcMetric.Sum().IsMonotonic()) + destMetric.Sum().SetAggregationTemporality(srcMetric.Sum().AggregationTemporality()) case pmetric.MetricTypeHistogram: destMetric, removedSize = extractHistogramDataPoints(srcMetric.Histogram(), capacity, sz) + destMetric.Histogram().SetAggregationTemporality(srcMetric.Histogram().AggregationTemporality()) case pmetric.MetricTypeExponentialHistogram: destMetric, removedSize = extractExponentialHistogramDataPoints(srcMetric.ExponentialHistogram(), capacity, sz) + destMetric.ExponentialHistogram().SetAggregationTemporality(srcMetric.ExponentialHistogram().AggregationTemporality()) case pmetric.MetricTypeSummary: destMetric, removedSize = extractSummaryDataPoints(srcMetric.Summary(), capacity, sz) } + destMetric.SetName(srcMetric.Name()) + destMetric.SetDescription(srcMetric.Description()) + destMetric.SetUnit(srcMetric.Unit()) + srcMetric.Metadata().CopyTo(destMetric.Metadata()) return destMetric, removedSize } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/queue_batch.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/queue_batch.go index d31dd1a31..0e90b6bcf 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/queue_batch.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/queue_batch.go @@ -4,18 +4,13 @@ package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( + "context" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch" ) -// Deprecated: [v0.123.0] use QueueBatchConfig. -type QueueConfig = QueueBatchConfig - -// Deprecated: [v0.123.0] use WithQueueBatch. -func WithRequestQueue(cfg QueueBatchConfig, encoding QueueBatchEncoding[Request]) Option { - return WithQueueBatch(cfg, QueueBatchSettings{Encoding: encoding}) -} - // WithQueue overrides the default QueueBatchConfig for an exporter. // The default QueueBatchConfig is to disable queueing. // This option cannot be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter. @@ -23,11 +18,6 @@ func WithQueue(config QueueBatchConfig) Option { return internal.WithQueue(config) } -// Deprecated: [v0.123.0] use WithQueueBatch. -func WithBatcher(cfg BatcherConfig) Option { - return internal.WithBatcher(cfg) -} - // QueueBatchConfig defines configuration for queueing and batching for the exporter. type QueueBatchConfig = queuebatch.Config @@ -37,14 +27,14 @@ type BatchConfig = queuebatch.BatchConfig // QueueBatchEncoding defines the encoding to be used if persistent queue is configured. // Duplicate definition with queuebatch.Encoding since aliasing generics is not supported by default. type QueueBatchEncoding[T any] interface { - // Marshal is a function that can marshal a request into bytes. - Marshal(T) ([]byte, error) + // Marshal is a function that can marshal a request and its context into bytes. + Marshal(context.Context, T) ([]byte, error) - // Unmarshal is a function that can unmarshal bytes into a request. - Unmarshal([]byte) (T, error) + // Unmarshal is a function that can unmarshal bytes into a request and its context. + Unmarshal([]byte) (context.Context, T, error) } -var ErrQueueIsFull = queuebatch.ErrQueueIsFull +var ErrQueueIsFull = queue.ErrQueueIsFull // QueueBatchSettings are settings for the QueueBatch component. // They include things line Encoding to be used with persistent queue, or the available Sizers, etc. @@ -61,12 +51,3 @@ func WithQueueBatch(cfg QueueBatchConfig, set QueueBatchSettings) Option { // NewDefaultQueueConfig returns the default config for QueueBatchConfig. // By default, the queue stores 1000 requests of telemetry and is non-blocking when full. var NewDefaultQueueConfig = internal.NewDefaultQueueConfig - -// Deprecated: [v0.123.0] use WithQueueBatch. -type BatcherConfig = internal.BatcherConfig - -// Deprecated: [v0.123.0] use WithQueueBatch. -type SizeConfig = internal.SizeConfig - -// Deprecated: [v0.123.0] use WithQueueBatch. -var NewDefaultBatcherConfig = internal.NewDefaultBatcherConfig diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/request.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/request.go index 635468fd7..a0064f40c 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/request.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/request.go @@ -35,7 +35,7 @@ type RequestConsumeFunc = sender.SendFunc[Request] // RequestSizer is an interface that returns the size of the given request. type RequestSizer = request.Sizer[Request] -// NewRequestsSizer returns a RequestSizer that counts the requests by the number of requests, always returning 1. +// Deprecated: [v0.129.0] no need, always supported. func NewRequestsSizer() RequestSizer { return request.RequestsSizer[Request]{} } diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/traces.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/traces.go index af49b7ce0..63d87c922 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/traces.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/traces.go @@ -14,9 +14,11 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sizer" "go.opentelemetry.io/collector/pdata/ptrace" + pdatareq "go.opentelemetry.io/collector/pdata/xpdata/request" "go.opentelemetry.io/collector/pipeline" ) @@ -30,14 +32,11 @@ var ( // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewTracesQueueBatchSettings() QueueBatchSettings { return QueueBatchSettings{ - Encoding: tracesEncoding{}, - Sizers: map[RequestSizerType]request.Sizer[Request]{ - RequestSizerTypeRequests: NewRequestsSizer(), - RequestSizerTypeItems: request.NewItemsSizer(), - RequestSizerTypeBytes: request.BaseSizer{ - SizeofFunc: func(req request.Request) int64 { - return int64(tracesMarshaler.TracesSize(req.(*tracesRequest).td)) - }, + Encoding: tracesEncoding{}, + ItemsSizer: request.NewItemsSizer(), + BytesSizer: request.BaseSizer{ + SizeofFunc: func(req request.Request) int64 { + return int64(tracesMarshaler.TracesSize(req.(*tracesRequest).td)) }, }, } @@ -57,16 +56,31 @@ func newTracesRequest(td ptrace.Traces) Request { type tracesEncoding struct{} -func (tracesEncoding) Unmarshal(bytes []byte) (Request, error) { +var _ QueueBatchEncoding[Request] = tracesEncoding{} + +func (tracesEncoding) Unmarshal(bytes []byte) (context.Context, Request, error) { + if queue.PersistRequestContextOnRead() { + ctx, traces, err := pdatareq.UnmarshalTraces(bytes) + if errors.Is(err, pdatareq.ErrInvalidFormat) { + // fall back to unmarshaling without context + traces, err = tracesUnmarshaler.UnmarshalTraces(bytes) + } + return ctx, newTracesRequest(traces), err + } traces, err := tracesUnmarshaler.UnmarshalTraces(bytes) if err != nil { - return nil, err + var req Request + return context.Background(), req, err } - return newTracesRequest(traces), nil + return context.Background(), newTracesRequest(traces), nil } -func (tracesEncoding) Marshal(req Request) ([]byte, error) { - return tracesMarshaler.MarshalTraces(req.(*tracesRequest).td) +func (tracesEncoding) Marshal(ctx context.Context, req Request) ([]byte, error) { + traces := req.(*tracesRequest).td + if queue.PersistRequestContextOnWrite() { + return pdatareq.MarshalTraces(ctx, traces) + } + return tracesMarshaler.MarshalTraces(traces) } func (req *tracesRequest) OnError(err error) Request { diff --git a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper/profiles.go b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper/profiles.go index 41e5e40a8..3ac12d9e6 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper/profiles.go +++ b/vendor/go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper/profiles.go @@ -16,10 +16,12 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/sizer" "go.opentelemetry.io/collector/exporter/xexporter" "go.opentelemetry.io/collector/pdata/pprofile" + pdatareq "go.opentelemetry.io/collector/pdata/xpdata/request" "go.opentelemetry.io/collector/pipeline/xpipeline" ) @@ -33,14 +35,11 @@ var ( // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func NewProfilesQueueBatchSettings() exporterhelper.QueueBatchSettings { return exporterhelper.QueueBatchSettings{ - Encoding: profilesEncoding{}, - Sizers: map[exporterhelper.RequestSizerType]request.Sizer[exporterhelper.Request]{ - exporterhelper.RequestSizerTypeRequests: exporterhelper.NewRequestsSizer(), - exporterhelper.RequestSizerTypeItems: request.NewItemsSizer(), - exporterhelper.RequestSizerTypeBytes: request.BaseSizer{ - SizeofFunc: func(req request.Request) int64 { - return int64(profilesMarshaler.ProfilesSize(req.(*profilesRequest).pd)) - }, + Encoding: profilesEncoding{}, + ItemsSizer: request.NewItemsSizer(), + BytesSizer: request.BaseSizer{ + SizeofFunc: func(req request.Request) int64 { + return int64(profilesMarshaler.ProfilesSize(req.(*profilesRequest).pd)) }, }, } @@ -60,16 +59,31 @@ func newProfilesRequest(pd pprofile.Profiles) exporterhelper.Request { type profilesEncoding struct{} -func (profilesEncoding) Unmarshal(bytes []byte) (exporterhelper.Request, error) { +var _ exporterhelper.QueueBatchEncoding[request.Request] = profilesEncoding{} + +func (profilesEncoding) Unmarshal(bytes []byte) (context.Context, request.Request, error) { + if queue.PersistRequestContextOnRead() { + ctx, profiles, err := pdatareq.UnmarshalProfiles(bytes) + if errors.Is(err, pdatareq.ErrInvalidFormat) { + // fall back to unmarshaling without context + profiles, err = profilesUnmarshaler.UnmarshalProfiles(bytes) + } + return ctx, newProfilesRequest(profiles), err + } profiles, err := profilesUnmarshaler.UnmarshalProfiles(bytes) if err != nil { - return nil, err + var req request.Request + return context.Background(), req, err } - return newProfilesRequest(profiles), nil + return context.Background(), newProfilesRequest(profiles), nil } -func (profilesEncoding) Marshal(req exporterhelper.Request) ([]byte, error) { - return profilesMarshaler.MarshalProfiles(req.(*profilesRequest).pd) +func (profilesEncoding) Marshal(ctx context.Context, req request.Request) ([]byte, error) { + profiles := req.(*profilesRequest).pd + if queue.PersistRequestContextOnWrite() { + return pdatareq.MarshalProfiles(ctx, profiles) + } + return profilesMarshaler.MarshalProfiles(profiles) } func (req *profilesRequest) OnError(err error) exporterhelper.Request { @@ -100,8 +114,8 @@ type profileExporter struct { xconsumer.Profiles } -// NewProfilesExporter creates an xexporter.Profiles that records observability metrics and wraps every request with a Span. -func NewProfilesExporter( +// NewProfiles creates an xexporter.Profiles that records observability metrics and wraps every request with a Span. +func NewProfiles( ctx context.Context, set exporter.Settings, cfg component.Config, @@ -118,6 +132,9 @@ func NewProfilesExporter( append([]exporterhelper.Option{internal.WithQueueBatchSettings(NewProfilesQueueBatchSettings())}, options...)...) } +// Deprecated: [v0.130.0] use NewProfiles. +var NewProfilesExporter = NewProfiles + // requestConsumeFromProfiles returns a RequestConsumeFunc that consumes pprofile.Profiles. func requestConsumeFromProfiles(pusher xconsumer.ConsumeProfilesFunc) exporterhelper.RequestConsumeFunc { return func(ctx context.Context, request exporterhelper.Request) error { diff --git a/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/config.go b/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/config.go index 5c89e71e0..8be397a47 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/config.go +++ b/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/config.go @@ -14,7 +14,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/configretry" - "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/exporter/exporterhelper" ) @@ -25,28 +24,8 @@ type Config struct { RetryConfig configretry.BackOffConfig `mapstructure:"retry_on_failure"` ClientConfig configgrpc.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. - // Experimental: This configuration is at the early stage of development and may change without backward compatibility - // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved - // - // Deprecated: [v0.123.0] batch configuration moving to queue configuration. - BatcherConfig exporterhelper.BatcherConfig `mapstructure:"batcher"` //nolint:staticcheck // SA1019 - - // remove at the same time as BatcherConfig - hasBatcher bool -} - -func (c *Config) Unmarshal(conf *confmap.Conf) error { - if conf.IsSet("batcher") { - c.BatcherConfig = exporterhelper.NewDefaultBatcherConfig() //nolint:staticcheck // SA1019 - c.BatcherConfig.Enabled = false - c.hasBatcher = true - } - - if err := conf.Unmarshal(c); err != nil { - return err - } - - return nil + // prevent unkeyed literal initialization + _ struct{} } func (c *Config) Validate() error { diff --git a/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/factory.go b/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/factory.go index bad79e96c..3d5cc8512 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/factory.go +++ b/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/factory.go @@ -9,6 +9,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configcompression" "go.opentelemetry.io/collector/config/configgrpc" + "go.opentelemetry.io/collector/config/configoptional" "go.opentelemetry.io/collector/config/configretry" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" @@ -31,13 +32,13 @@ func NewFactory() exporter.Factory { } func createDefaultConfig() component.Config { - clientCfg := *configgrpc.NewDefaultClientConfig() + clientCfg := configgrpc.NewDefaultClientConfig() // Default to gzip compression clientCfg.Compression = configcompression.TypeGzip // We almost read 0 bytes, so no need to tune ReadBufferSize. clientCfg.WriteBufferSize = 512 * 1024 // For backward compatibility: - clientCfg.Keepalive = nil + clientCfg.Keepalive = configoptional.None[configgrpc.KeepaliveClientConfig]() clientCfg.BalancerName = "" return &Config{ @@ -61,7 +62,6 @@ func createTraces( exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), - exporterhelper.WithBatcher(oCfg.BatcherConfig), //nolint:staticcheck // SA1019 exporterhelper.WithStart(oce.start), exporterhelper.WithShutdown(oce.shutdown), ) @@ -80,7 +80,6 @@ func createMetrics( exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), - exporterhelper.WithBatcher(oCfg.BatcherConfig), //nolint:staticcheck // SA1019 exporterhelper.WithStart(oce.start), exporterhelper.WithShutdown(oce.shutdown), ) @@ -99,7 +98,6 @@ func createLogs( exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), - exporterhelper.WithBatcher(oCfg.BatcherConfig), //nolint:staticcheck // SA1019 exporterhelper.WithStart(oce.start), exporterhelper.WithShutdown(oce.shutdown), ) @@ -112,13 +110,12 @@ func createProfilesExporter( ) (xexporter.Profiles, error) { oce := newExporter(cfg, set) oCfg := cfg.(*Config) - return xexporterhelper.NewProfilesExporter(ctx, set, cfg, + return xexporterhelper.NewProfiles(ctx, set, cfg, oce.pushProfiles, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), - exporterhelper.WithBatcher(oCfg.BatcherConfig), //nolint:staticcheck // SA1019 exporterhelper.WithStart(oce.start), exporterhelper.WithShutdown(oce.shutdown), ) diff --git a/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/otlp.go b/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/otlp.go index 2978eccf1..e499b9552 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/otlp.go +++ b/vendor/go.opentelemetry.io/collector/exporter/otlpexporter/otlp.go @@ -53,10 +53,6 @@ type baseExporter struct { func newExporter(cfg component.Config, set exporter.Settings) *baseExporter { oCfg := cfg.(*Config) - if oCfg.hasBatcher { - set.Logger.Warn("using deprecated field: batcher") - } - userAgent := fmt.Sprintf("%s/%s (%s/%s)", set.BuildInfo.Description, set.BuildInfo.Version, runtime.GOOS, runtime.GOARCH) diff --git a/vendor/go.opentelemetry.io/collector/exporter/otlphttpexporter/factory.go b/vendor/go.opentelemetry.io/collector/exporter/otlphttpexporter/factory.go index 082e3805f..fade359e5 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/otlphttpexporter/factory.go +++ b/vendor/go.opentelemetry.io/collector/exporter/otlphttpexporter/factory.go @@ -166,7 +166,7 @@ func createProfiles( return nil, err } - return xexporterhelper.NewProfilesExporter(ctx, set, cfg, + return xexporterhelper.NewProfiles(ctx, set, cfg, oce.pushProfiles, exporterhelper.WithStart(oce.start), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attribute.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attribute.go index 94ef69505..e97dccbf3 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attribute.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attribute.go @@ -69,6 +69,10 @@ func (ms Attribute) Value() pcommon.Value { // CopyTo copies all properties from the current struct overriding the destination. func (ms Attribute) CopyTo(dest Attribute) { dest.state.AssertMutable() - dest.SetKey(ms.Key()) - ms.Value().CopyTo(dest.Value()) + copyOrigAttribute(dest.orig, ms.orig) +} + +func copyOrigAttribute(dest, src *v1.KeyValue) { + dest.Key = src.Key + internal.CopyOrigValue(&dest.Value, &src.Value) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributetableslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributetableslice.go index c6447c4b7..f68a7c9e4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributetableslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributetableslice.go @@ -144,14 +144,16 @@ func (es AttributeTableSlice) RemoveIf(f func(Attribute) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es AttributeTableSlice) CopyTo(dest AttributeTableSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - } else { - (*dest.orig) = make([]v1.KeyValue, srcLen) + *dest.orig = copyOrigAttributeTableSlice(*dest.orig, *es.orig) +} + +func copyOrigAttributeTableSlice(dest, src []v1.KeyValue) []v1.KeyValue { + if cap(dest) < len(src) { + dest = make([]v1.KeyValue, len(src)) } - for i := range *es.orig { - newAttribute(&(*es.orig)[i], es.state).CopyTo(newAttribute(&(*dest.orig)[i], dest.state)) + dest = dest[:len(src)] + for i := range src { + copyOrigAttribute(&dest[i], &src[i]) } + return dest } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunit.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunit.go index 228d4027a..bd8a3baa6 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunit.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunit.go @@ -74,6 +74,10 @@ func (ms AttributeUnit) SetUnitStrindex(v int32) { // CopyTo copies all properties from the current struct overriding the destination. func (ms AttributeUnit) CopyTo(dest AttributeUnit) { dest.state.AssertMutable() - dest.SetAttributeKeyStrindex(ms.AttributeKeyStrindex()) - dest.SetUnitStrindex(ms.UnitStrindex()) + copyOrigAttributeUnit(dest.orig, ms.orig) +} + +func copyOrigAttributeUnit(dest, src *otlpprofiles.AttributeUnit) { + dest.AttributeKeyStrindex = src.AttributeKeyStrindex + dest.UnitStrindex = src.UnitStrindex } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunitslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunitslice.go index 051bca444..6c817ec24 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunitslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_attributeunitslice.go @@ -145,22 +145,7 @@ func (es AttributeUnitSlice) RemoveIf(f func(AttributeUnit) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es AttributeUnitSlice) CopyTo(dest AttributeUnitSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newAttributeUnit((*es.orig)[i], es.state).CopyTo(newAttributeUnit((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.AttributeUnit, srcLen) - wrappers := make([]*otlpprofiles.AttributeUnit, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newAttributeUnit((*es.orig)[i], es.state).CopyTo(newAttributeUnit(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigAttributeUnitSlice(*dest.orig, *es.orig) } // Sort sorts the AttributeUnit elements within AttributeUnitSlice given the @@ -170,3 +155,18 @@ func (es AttributeUnitSlice) Sort(less func(a, b AttributeUnit) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigAttributeUnitSlice(dest, src []*otlpprofiles.AttributeUnit) []*otlpprofiles.AttributeUnit { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.AttributeUnit, len(src)) + data := make([]otlpprofiles.AttributeUnit, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigAttributeUnit(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_function.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_function.go index 8870bf687..909fc6a3a 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_function.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_function.go @@ -96,8 +96,12 @@ func (ms Function) SetStartLine(v int64) { // CopyTo copies all properties from the current struct overriding the destination. func (ms Function) CopyTo(dest Function) { dest.state.AssertMutable() - dest.SetNameStrindex(ms.NameStrindex()) - dest.SetSystemNameStrindex(ms.SystemNameStrindex()) - dest.SetFilenameStrindex(ms.FilenameStrindex()) - dest.SetStartLine(ms.StartLine()) + copyOrigFunction(dest.orig, ms.orig) +} + +func copyOrigFunction(dest, src *otlpprofiles.Function) { + dest.NameStrindex = src.NameStrindex + dest.SystemNameStrindex = src.SystemNameStrindex + dest.FilenameStrindex = src.FilenameStrindex + dest.StartLine = src.StartLine } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_functionslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_functionslice.go index 14d93c1f2..44c44341f 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_functionslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_functionslice.go @@ -145,22 +145,7 @@ func (es FunctionSlice) RemoveIf(f func(Function) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es FunctionSlice) CopyTo(dest FunctionSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newFunction((*es.orig)[i], es.state).CopyTo(newFunction((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Function, srcLen) - wrappers := make([]*otlpprofiles.Function, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newFunction((*es.orig)[i], es.state).CopyTo(newFunction(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigFunctionSlice(*dest.orig, *es.orig) } // Sort sorts the Function elements within FunctionSlice given the @@ -170,3 +155,18 @@ func (es FunctionSlice) Sort(less func(a, b Function) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigFunctionSlice(dest, src []*otlpprofiles.Function) []*otlpprofiles.Function { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Function, len(src)) + data := make([]otlpprofiles.Function, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigFunction(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_line.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_line.go index 016d3d913..ff03b3d1c 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_line.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_line.go @@ -85,7 +85,11 @@ func (ms Line) SetColumn(v int64) { // CopyTo copies all properties from the current struct overriding the destination. func (ms Line) CopyTo(dest Line) { dest.state.AssertMutable() - dest.SetFunctionIndex(ms.FunctionIndex()) - dest.SetLine(ms.Line()) - dest.SetColumn(ms.Column()) + copyOrigLine(dest.orig, ms.orig) +} + +func copyOrigLine(dest, src *otlpprofiles.Line) { + dest.FunctionIndex = src.FunctionIndex + dest.Line = src.Line + dest.Column = src.Column } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_lineslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_lineslice.go index bf3726c66..410924ef1 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_lineslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_lineslice.go @@ -145,22 +145,7 @@ func (es LineSlice) RemoveIf(f func(Line) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es LineSlice) CopyTo(dest LineSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newLine((*es.orig)[i], es.state).CopyTo(newLine((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Line, srcLen) - wrappers := make([]*otlpprofiles.Line, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newLine((*es.orig)[i], es.state).CopyTo(newLine(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigLineSlice(*dest.orig, *es.orig) } // Sort sorts the Line elements within LineSlice given the @@ -170,3 +155,18 @@ func (es LineSlice) Sort(less func(a, b Line) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigLineSlice(dest, src []*otlpprofiles.Line) []*otlpprofiles.Line { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Line, len(src)) + data := make([]otlpprofiles.Line, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigLine(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_link.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_link.go index c4527fbcf..e3540e9b0 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_link.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_link.go @@ -76,6 +76,10 @@ func (ms Link) SetSpanID(v pcommon.SpanID) { // CopyTo copies all properties from the current struct overriding the destination. func (ms Link) CopyTo(dest Link) { dest.state.AssertMutable() - dest.SetTraceID(ms.TraceID()) - dest.SetSpanID(ms.SpanID()) + copyOrigLink(dest.orig, ms.orig) +} + +func copyOrigLink(dest, src *otlpprofiles.Link) { + dest.TraceId = src.TraceId + dest.SpanId = src.SpanId } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_linkslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_linkslice.go index 91f716981..6f58ea194 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_linkslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_linkslice.go @@ -145,22 +145,7 @@ func (es LinkSlice) RemoveIf(f func(Link) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es LinkSlice) CopyTo(dest LinkSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newLink((*es.orig)[i], es.state).CopyTo(newLink((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Link, srcLen) - wrappers := make([]*otlpprofiles.Link, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newLink((*es.orig)[i], es.state).CopyTo(newLink(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigLinkSlice(*dest.orig, *es.orig) } // Sort sorts the Link elements within LinkSlice given the @@ -170,3 +155,18 @@ func (es LinkSlice) Sort(less func(a, b Link) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigLinkSlice(dest, src []*otlpprofiles.Link) []*otlpprofiles.Link { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Link, len(src)) + data := make([]otlpprofiles.Link, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigLink(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_location.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_location.go index d3097a995..9cd60b6f7 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_location.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_location.go @@ -108,12 +108,22 @@ func (ms Location) AttributeIndices() pcommon.Int32Slice { // CopyTo copies all properties from the current struct overriding the destination. func (ms Location) CopyTo(dest Location) { dest.state.AssertMutable() - if ms.HasMappingIndex() { - dest.SetMappingIndex(ms.MappingIndex()) - } + copyOrigLocation(dest.orig, ms.orig) +} - dest.SetAddress(ms.Address()) - ms.Line().CopyTo(dest.Line()) - dest.SetIsFolded(ms.IsFolded()) - ms.AttributeIndices().CopyTo(dest.AttributeIndices()) +func copyOrigLocation(dest, src *otlpprofiles.Location) { + if srcMappingIndex, ok := src.MappingIndex_.(*otlpprofiles.Location_MappingIndex); ok { + destMappingIndex, ok := dest.MappingIndex_.(*otlpprofiles.Location_MappingIndex) + if !ok { + destMappingIndex = &otlpprofiles.Location_MappingIndex{} + dest.MappingIndex_ = destMappingIndex + } + destMappingIndex.MappingIndex = srcMappingIndex.MappingIndex + } else { + dest.MappingIndex_ = nil + } + dest.Address = src.Address + dest.Line = copyOrigLineSlice(dest.Line, src.Line) + dest.IsFolded = src.IsFolded + dest.AttributeIndices = internal.CopyOrigInt32Slice(dest.AttributeIndices, src.AttributeIndices) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_locationslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_locationslice.go index 07e6c4601..1866020e9 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_locationslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_locationslice.go @@ -145,22 +145,7 @@ func (es LocationSlice) RemoveIf(f func(Location) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es LocationSlice) CopyTo(dest LocationSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newLocation((*es.orig)[i], es.state).CopyTo(newLocation((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Location, srcLen) - wrappers := make([]*otlpprofiles.Location, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newLocation((*es.orig)[i], es.state).CopyTo(newLocation(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigLocationSlice(*dest.orig, *es.orig) } // Sort sorts the Location elements within LocationSlice given the @@ -170,3 +155,18 @@ func (es LocationSlice) Sort(less func(a, b Location) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigLocationSlice(dest, src []*otlpprofiles.Location) []*otlpprofiles.Location { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Location, len(src)) + data := make([]otlpprofiles.Location, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigLocation(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mapping.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mapping.go index d1cbdf131..9fce45244 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mapping.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mapping.go @@ -146,13 +146,17 @@ func (ms Mapping) SetHasInlineFrames(v bool) { // CopyTo copies all properties from the current struct overriding the destination. func (ms Mapping) CopyTo(dest Mapping) { dest.state.AssertMutable() - dest.SetMemoryStart(ms.MemoryStart()) - dest.SetMemoryLimit(ms.MemoryLimit()) - dest.SetFileOffset(ms.FileOffset()) - dest.SetFilenameStrindex(ms.FilenameStrindex()) - ms.AttributeIndices().CopyTo(dest.AttributeIndices()) - dest.SetHasFunctions(ms.HasFunctions()) - dest.SetHasFilenames(ms.HasFilenames()) - dest.SetHasLineNumbers(ms.HasLineNumbers()) - dest.SetHasInlineFrames(ms.HasInlineFrames()) + copyOrigMapping(dest.orig, ms.orig) +} + +func copyOrigMapping(dest, src *otlpprofiles.Mapping) { + dest.MemoryStart = src.MemoryStart + dest.MemoryLimit = src.MemoryLimit + dest.FileOffset = src.FileOffset + dest.FilenameStrindex = src.FilenameStrindex + dest.AttributeIndices = internal.CopyOrigInt32Slice(dest.AttributeIndices, src.AttributeIndices) + dest.HasFunctions = src.HasFunctions + dest.HasFilenames = src.HasFilenames + dest.HasLineNumbers = src.HasLineNumbers + dest.HasInlineFrames = src.HasInlineFrames } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mappingslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mappingslice.go index 3a8d4ce53..ca8fad01d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mappingslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_mappingslice.go @@ -145,22 +145,7 @@ func (es MappingSlice) RemoveIf(f func(Mapping) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es MappingSlice) CopyTo(dest MappingSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newMapping((*es.orig)[i], es.state).CopyTo(newMapping((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Mapping, srcLen) - wrappers := make([]*otlpprofiles.Mapping, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newMapping((*es.orig)[i], es.state).CopyTo(newMapping(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigMappingSlice(*dest.orig, *es.orig) } // Sort sorts the Mapping elements within MappingSlice given the @@ -170,3 +155,18 @@ func (es MappingSlice) Sort(less func(a, b Mapping) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigMappingSlice(dest, src []*otlpprofiles.Mapping) []*otlpprofiles.Mapping { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Mapping, len(src)) + data := make([]otlpprofiles.Mapping, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigMapping(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profile.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profile.go index 70be3fd64..85a24ab77 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profile.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profile.go @@ -88,17 +88,6 @@ func (ms Profile) SetDuration(v pcommon.Timestamp) { ms.orig.DurationNanos = int64(v) } -// StartTime returns the starttime associated with this Profile. -func (ms Profile) StartTime() pcommon.Timestamp { - return pcommon.Timestamp(ms.orig.TimeNanos) -} - -// SetStartTime replaces the starttime associated with this Profile. -func (ms Profile) SetStartTime(v pcommon.Timestamp) { - ms.state.AssertMutable() - ms.orig.TimeNanos = int64(v) -} - // PeriodType returns the periodtype associated with this Profile. func (ms Profile) PeriodType() ValueType { return newValueType(&ms.orig.PeriodType, ms.state) @@ -142,11 +131,6 @@ func (ms Profile) SetProfileID(v ProfileID) { ms.orig.ProfileId = data.ProfileID(v) } -// AttributeIndices returns the AttributeIndices associated with this Profile. -func (ms Profile) AttributeIndices() pcommon.Int32Slice { - return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.AttributeIndices, ms.state)) -} - // DroppedAttributesCount returns the droppedattributescount associated with this Profile. func (ms Profile) DroppedAttributesCount() uint32 { return ms.orig.DroppedAttributesCount @@ -174,22 +158,30 @@ func (ms Profile) OriginalPayload() pcommon.ByteSlice { return pcommon.ByteSlice(internal.NewByteSlice(&ms.orig.OriginalPayload, ms.state)) } +// AttributeIndices returns the AttributeIndices associated with this Profile. +func (ms Profile) AttributeIndices() pcommon.Int32Slice { + return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.AttributeIndices, ms.state)) +} + // CopyTo copies all properties from the current struct overriding the destination. func (ms Profile) CopyTo(dest Profile) { dest.state.AssertMutable() - ms.SampleType().CopyTo(dest.SampleType()) - ms.Sample().CopyTo(dest.Sample()) - ms.LocationIndices().CopyTo(dest.LocationIndices()) - dest.SetTime(ms.Time()) - dest.SetDuration(ms.Duration()) - dest.SetStartTime(ms.StartTime()) - ms.PeriodType().CopyTo(dest.PeriodType()) - dest.SetPeriod(ms.Period()) - ms.CommentStrindices().CopyTo(dest.CommentStrindices()) - dest.SetDefaultSampleTypeIndex(ms.DefaultSampleTypeIndex()) - dest.SetProfileID(ms.ProfileID()) - ms.AttributeIndices().CopyTo(dest.AttributeIndices()) - dest.SetDroppedAttributesCount(ms.DroppedAttributesCount()) - dest.SetOriginalPayloadFormat(ms.OriginalPayloadFormat()) - ms.OriginalPayload().CopyTo(dest.OriginalPayload()) + copyOrigProfile(dest.orig, ms.orig) +} + +func copyOrigProfile(dest, src *otlpprofiles.Profile) { + dest.SampleType = copyOrigValueTypeSlice(dest.SampleType, src.SampleType) + dest.Sample = copyOrigSampleSlice(dest.Sample, src.Sample) + dest.LocationIndices = internal.CopyOrigInt32Slice(dest.LocationIndices, src.LocationIndices) + dest.TimeNanos = src.TimeNanos + dest.DurationNanos = src.DurationNanos + copyOrigValueType(&dest.PeriodType, &src.PeriodType) + dest.Period = src.Period + dest.CommentStrindices = internal.CopyOrigInt32Slice(dest.CommentStrindices, src.CommentStrindices) + dest.DefaultSampleTypeIndex = src.DefaultSampleTypeIndex + dest.ProfileId = src.ProfileId + dest.DroppedAttributesCount = src.DroppedAttributesCount + dest.OriginalPayloadFormat = src.OriginalPayloadFormat + dest.OriginalPayload = internal.CopyOrigByteSlice(dest.OriginalPayload, src.OriginalPayload) + dest.AttributeIndices = internal.CopyOrigInt32Slice(dest.AttributeIndices, src.AttributeIndices) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesdictionary.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesdictionary.go index 11b67798a..e040ad2de 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesdictionary.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesdictionary.go @@ -88,11 +88,15 @@ func (ms ProfilesDictionary) AttributeUnits() AttributeUnitSlice { // CopyTo copies all properties from the current struct overriding the destination. func (ms ProfilesDictionary) CopyTo(dest ProfilesDictionary) { dest.state.AssertMutable() - ms.MappingTable().CopyTo(dest.MappingTable()) - ms.LocationTable().CopyTo(dest.LocationTable()) - ms.FunctionTable().CopyTo(dest.FunctionTable()) - ms.LinkTable().CopyTo(dest.LinkTable()) - ms.StringTable().CopyTo(dest.StringTable()) - ms.AttributeTable().CopyTo(dest.AttributeTable()) - ms.AttributeUnits().CopyTo(dest.AttributeUnits()) + copyOrigProfilesDictionary(dest.orig, ms.orig) +} + +func copyOrigProfilesDictionary(dest, src *otlpprofiles.ProfilesDictionary) { + dest.MappingTable = copyOrigMappingSlice(dest.MappingTable, src.MappingTable) + dest.LocationTable = copyOrigLocationSlice(dest.LocationTable, src.LocationTable) + dest.FunctionTable = copyOrigFunctionSlice(dest.FunctionTable, src.FunctionTable) + dest.LinkTable = copyOrigLinkSlice(dest.LinkTable, src.LinkTable) + dest.StringTable = internal.CopyOrigStringSlice(dest.StringTable, src.StringTable) + dest.AttributeTable = copyOrigAttributeTableSlice(dest.AttributeTable, src.AttributeTable) + dest.AttributeUnits = copyOrigAttributeUnitSlice(dest.AttributeUnits, src.AttributeUnits) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesslice.go index fa00fa3a1..6ef0b3074 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_profilesslice.go @@ -145,22 +145,7 @@ func (es ProfilesSlice) RemoveIf(f func(Profile) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es ProfilesSlice) CopyTo(dest ProfilesSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newProfile((*es.orig)[i], es.state).CopyTo(newProfile((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Profile, srcLen) - wrappers := make([]*otlpprofiles.Profile, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newProfile((*es.orig)[i], es.state).CopyTo(newProfile(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigProfilesSlice(*dest.orig, *es.orig) } // Sort sorts the Profile elements within ProfilesSlice given the @@ -170,3 +155,18 @@ func (es ProfilesSlice) Sort(less func(a, b Profile) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigProfilesSlice(dest, src []*otlpprofiles.Profile) []*otlpprofiles.Profile { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Profile, len(src)) + data := make([]otlpprofiles.Profile, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigProfile(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofiles.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofiles.go index 054f027cc..6d0be9f42 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofiles.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofiles.go @@ -74,7 +74,11 @@ func (ms ResourceProfiles) ScopeProfiles() ScopeProfilesSlice { // CopyTo copies all properties from the current struct overriding the destination. func (ms ResourceProfiles) CopyTo(dest ResourceProfiles) { dest.state.AssertMutable() - ms.Resource().CopyTo(dest.Resource()) - dest.SetSchemaUrl(ms.SchemaUrl()) - ms.ScopeProfiles().CopyTo(dest.ScopeProfiles()) + copyOrigResourceProfiles(dest.orig, ms.orig) +} + +func copyOrigResourceProfiles(dest, src *otlpprofiles.ResourceProfiles) { + internal.CopyOrigResource(&dest.Resource, &src.Resource) + dest.SchemaUrl = src.SchemaUrl + dest.ScopeProfiles = copyOrigScopeProfilesSlice(dest.ScopeProfiles, src.ScopeProfiles) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofilesslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofilesslice.go index a592c54ef..c78115dbf 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofilesslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_resourceprofilesslice.go @@ -145,22 +145,7 @@ func (es ResourceProfilesSlice) RemoveIf(f func(ResourceProfiles) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es ResourceProfilesSlice) CopyTo(dest ResourceProfilesSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newResourceProfiles((*es.orig)[i], es.state).CopyTo(newResourceProfiles((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.ResourceProfiles, srcLen) - wrappers := make([]*otlpprofiles.ResourceProfiles, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newResourceProfiles((*es.orig)[i], es.state).CopyTo(newResourceProfiles(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigResourceProfilesSlice(*dest.orig, *es.orig) } // Sort sorts the ResourceProfiles elements within ResourceProfilesSlice given the @@ -170,3 +155,18 @@ func (es ResourceProfilesSlice) Sort(less func(a, b ResourceProfiles) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigResourceProfilesSlice(dest, src []*otlpprofiles.ResourceProfiles) []*otlpprofiles.ResourceProfiles { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.ResourceProfiles, len(src)) + data := make([]otlpprofiles.ResourceProfiles, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigResourceProfiles(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sample.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sample.go index 573c3183a..0ba854204 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sample.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sample.go @@ -113,13 +113,23 @@ func (ms Sample) TimestampsUnixNano() pcommon.UInt64Slice { // CopyTo copies all properties from the current struct overriding the destination. func (ms Sample) CopyTo(dest Sample) { dest.state.AssertMutable() - dest.SetLocationsStartIndex(ms.LocationsStartIndex()) - dest.SetLocationsLength(ms.LocationsLength()) - ms.Value().CopyTo(dest.Value()) - ms.AttributeIndices().CopyTo(dest.AttributeIndices()) - if ms.HasLinkIndex() { - dest.SetLinkIndex(ms.LinkIndex()) + copyOrigSample(dest.orig, ms.orig) +} + +func copyOrigSample(dest, src *otlpprofiles.Sample) { + dest.LocationsStartIndex = src.LocationsStartIndex + dest.LocationsLength = src.LocationsLength + dest.Value = internal.CopyOrigInt64Slice(dest.Value, src.Value) + dest.AttributeIndices = internal.CopyOrigInt32Slice(dest.AttributeIndices, src.AttributeIndices) + if srcLinkIndex, ok := src.LinkIndex_.(*otlpprofiles.Sample_LinkIndex); ok { + destLinkIndex, ok := dest.LinkIndex_.(*otlpprofiles.Sample_LinkIndex) + if !ok { + destLinkIndex = &otlpprofiles.Sample_LinkIndex{} + dest.LinkIndex_ = destLinkIndex + } + destLinkIndex.LinkIndex = srcLinkIndex.LinkIndex + } else { + dest.LinkIndex_ = nil } - - ms.TimestampsUnixNano().CopyTo(dest.TimestampsUnixNano()) + dest.TimestampsUnixNano = internal.CopyOrigUInt64Slice(dest.TimestampsUnixNano, src.TimestampsUnixNano) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sampleslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sampleslice.go index f25d1ef7d..425391f29 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sampleslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_sampleslice.go @@ -145,22 +145,7 @@ func (es SampleSlice) RemoveIf(f func(Sample) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es SampleSlice) CopyTo(dest SampleSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newSample((*es.orig)[i], es.state).CopyTo(newSample((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.Sample, srcLen) - wrappers := make([]*otlpprofiles.Sample, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newSample((*es.orig)[i], es.state).CopyTo(newSample(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigSampleSlice(*dest.orig, *es.orig) } // Sort sorts the Sample elements within SampleSlice given the @@ -170,3 +155,18 @@ func (es SampleSlice) Sort(less func(a, b Sample) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigSampleSlice(dest, src []*otlpprofiles.Sample) []*otlpprofiles.Sample { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.Sample, len(src)) + data := make([]otlpprofiles.Sample, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigSample(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofiles.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofiles.go index f9107862a..1ee42e6d3 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofiles.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofiles.go @@ -74,7 +74,11 @@ func (ms ScopeProfiles) Profiles() ProfilesSlice { // CopyTo copies all properties from the current struct overriding the destination. func (ms ScopeProfiles) CopyTo(dest ScopeProfiles) { dest.state.AssertMutable() - ms.Scope().CopyTo(dest.Scope()) - dest.SetSchemaUrl(ms.SchemaUrl()) - ms.Profiles().CopyTo(dest.Profiles()) + copyOrigScopeProfiles(dest.orig, ms.orig) +} + +func copyOrigScopeProfiles(dest, src *otlpprofiles.ScopeProfiles) { + internal.CopyOrigInstrumentationScope(&dest.Scope, &src.Scope) + dest.SchemaUrl = src.SchemaUrl + dest.Profiles = copyOrigProfilesSlice(dest.Profiles, src.Profiles) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofilesslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofilesslice.go index a00083ca5..1feabca10 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofilesslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_scopeprofilesslice.go @@ -145,22 +145,7 @@ func (es ScopeProfilesSlice) RemoveIf(f func(ScopeProfiles) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es ScopeProfilesSlice) CopyTo(dest ScopeProfilesSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newScopeProfiles((*es.orig)[i], es.state).CopyTo(newScopeProfiles((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.ScopeProfiles, srcLen) - wrappers := make([]*otlpprofiles.ScopeProfiles, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newScopeProfiles((*es.orig)[i], es.state).CopyTo(newScopeProfiles(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigScopeProfilesSlice(*dest.orig, *es.orig) } // Sort sorts the ScopeProfiles elements within ScopeProfilesSlice given the @@ -170,3 +155,18 @@ func (es ScopeProfilesSlice) Sort(less func(a, b ScopeProfiles) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigScopeProfilesSlice(dest, src []*otlpprofiles.ScopeProfiles) []*otlpprofiles.ScopeProfiles { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.ScopeProfiles, len(src)) + data := make([]otlpprofiles.ScopeProfiles, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigScopeProfiles(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetype.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetype.go index 309e08299..03cd26113 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetype.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetype.go @@ -85,7 +85,11 @@ func (ms ValueType) SetAggregationTemporality(v AggregationTemporality) { // CopyTo copies all properties from the current struct overriding the destination. func (ms ValueType) CopyTo(dest ValueType) { dest.state.AssertMutable() - dest.SetTypeStrindex(ms.TypeStrindex()) - dest.SetUnitStrindex(ms.UnitStrindex()) - dest.SetAggregationTemporality(ms.AggregationTemporality()) + copyOrigValueType(dest.orig, ms.orig) +} + +func copyOrigValueType(dest, src *otlpprofiles.ValueType) { + dest.TypeStrindex = src.TypeStrindex + dest.UnitStrindex = src.UnitStrindex + dest.AggregationTemporality = src.AggregationTemporality } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetypeslice.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetypeslice.go index f2673870a..eb504c312 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetypeslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/generated_valuetypeslice.go @@ -145,22 +145,7 @@ func (es ValueTypeSlice) RemoveIf(f func(ValueType) bool) { // CopyTo copies all elements from the current slice overriding the destination. func (es ValueTypeSlice) CopyTo(dest ValueTypeSlice) { dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newValueType((*es.orig)[i], es.state).CopyTo(newValueType((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]otlpprofiles.ValueType, srcLen) - wrappers := make([]*otlpprofiles.ValueType, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - newValueType((*es.orig)[i], es.state).CopyTo(newValueType(wrappers[i], dest.state)) - } - *dest.orig = wrappers + *dest.orig = copyOrigValueTypeSlice(*dest.orig, *es.orig) } // Sort sorts the ValueType elements within ValueTypeSlice given the @@ -170,3 +155,18 @@ func (es ValueTypeSlice) Sort(less func(a, b ValueType) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } + +func copyOrigValueTypeSlice(dest, src []*otlpprofiles.ValueType) []*otlpprofiles.ValueType { + if cap(dest) < len(src) { + dest = make([]*otlpprofiles.ValueType, len(src)) + data := make([]otlpprofiles.ValueType, len(src)) + for i := range src { + dest[i] = &data[i] + } + } + dest = dest[:len(src)] + for i := range src { + copyOrigValueType(dest[i], src[i]) + } + return dest +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/line.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/line.go new file mode 100644 index 000000000..ae97b8f83 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/line.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +// Equal checks equality with another LineSlice +func (l LineSlice) Equal(val LineSlice) bool { + if l.Len() != val.Len() { + return false + } + + for i := range l.Len() { + if !l.At(i).Equal(val.At(i)) { + return false + } + } + + return true +} + +// Equal checks equality with another Line +func (l Line) Equal(val Line) bool { + return l.Column() == val.Column() && + l.FunctionIndex() == val.FunctionIndex() && + l.Line() == val.Line() +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/location.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/location.go new file mode 100644 index 000000000..4edd7d388 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/location.go @@ -0,0 +1,13 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +// Equal checks equality with another Location +func (l Location) Equal(val Location) bool { + return l.MappingIndex() == val.MappingIndex() && + l.Address() == val.Address() && + l.AttributeIndices().Equal(val.AttributeIndices()) && + l.IsFolded() == val.IsFolded() && + l.Line().Equal(val.Line()) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/locations.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/locations.go new file mode 100644 index 000000000..98e64f0ab --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/locations.go @@ -0,0 +1,68 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import ( + "errors" + "fmt" + "math" +) + +// FromLocationIndices builds a slice containing all the locations of a Profile. +// Updates made to the returned map will not be applied back to the Profile. +func FromLocationIndices(table LocationSlice, record Profile) LocationSlice { + m := NewLocationSlice() + m.EnsureCapacity(record.LocationIndices().Len()) + + for _, idx := range record.LocationIndices().All() { + l := table.At(int(idx)) + l.CopyTo(m.AppendEmpty()) + } + + return m +} + +var ( + errTooManyLocationTableEntries = errors.New("too many entries in LocationTable") + errTooManyLocationIndicesEntries = errors.New("too many entries in LocationIndices") +) + +// PutLocation updates a LocationTable and a Profile's LocationIndices to +// add or update a location. +func PutLocation(table LocationSlice, record Profile, loc Location) error { + for i, locIdx := range record.LocationIndices().All() { + idx := int(locIdx) + if idx < 0 || idx >= table.Len() { + return fmt.Errorf("index value %d out of range in LocationIndices[%d]", idx, i) + } + locAt := table.At(idx) + if locAt.Equal(loc) { + // Location already exists, nothing to do. + return nil + } + } + + if record.LocationIndices().Len() >= math.MaxInt32 { + return errTooManyLocationIndicesEntries + } + + for j, a := range table.All() { + if a.Equal(loc) { + if j > math.MaxInt32 { + return errTooManyLocationTableEntries + } + // Add the index of the existing location to the indices. + record.LocationIndices().Append(int32(j)) //nolint:gosec // G115 overflow checked + return nil + } + } + + if table.Len() >= math.MaxInt32 { + return errTooManyLocationTableEntries + } + + loc.CopyTo(table.AppendEmpty()) + record.LocationIndices().Append(int32(table.Len() - 1)) //nolint:gosec // G115 overflow checked + return nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/mapping.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/mapping.go new file mode 100644 index 000000000..62ae63aad --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/mapping.go @@ -0,0 +1,17 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +// Equal checks equality with another Mapping +func (m Mapping) Equal(val Mapping) bool { + return m.MemoryStart() == val.MemoryStart() && + m.MemoryLimit() == val.MemoryLimit() && + m.FileOffset() == val.FileOffset() && + m.FilenameStrindex() == val.FilenameStrindex() && + m.AttributeIndices().Equal(val.AttributeIndices()) && + m.HasFunctions() == val.HasFunctions() && + m.HasFilenames() == val.HasFilenames() && + m.HasLineNumbers() == val.HasLineNumbers() && + m.HasInlineFrames() == val.HasInlineFrames() +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/mappings.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/mappings.go new file mode 100644 index 000000000..fe547e915 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/mappings.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import ( + "errors" + "fmt" + "math" +) + +var errTooManyMappingTableEntries = errors.New("too many entries in MappingTable") + +// SetMapping updates a MappingTable and a Location's MappingIndex to +// add or update a mapping. +func SetMapping(table MappingSlice, record Location, ma Mapping) error { + idx := int(record.MappingIndex()) + if idx > 0 { + if idx >= table.Len() { + return fmt.Errorf("index value %d out of range for MappingIndex", idx) + } + mapAt := table.At(idx) + if mapAt.Equal(ma) { + // Mapping already exists, nothing to do. + return nil + } + } + + for j, m := range table.All() { + if m.Equal(ma) { + if j > math.MaxInt32 { + return errTooManyMappingTableEntries + } + // Add the index of the existing mapping to the indices. + record.SetMappingIndex(int32(j)) //nolint:gosec // G115 overflow checked + return nil + } + } + + if table.Len() >= math.MaxInt32 { + return errTooManyMappingTableEntries + } + + ma.CopyTo(table.AppendEmpty()) + record.SetMappingIndex(int32(table.Len() - 1)) //nolint:gosec // G115 overflow checked + return nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go b/vendor/go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go index 075d6e067..f73e87bc0 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go @@ -74,6 +74,10 @@ func (ms ExportPartialSuccess) SetErrorMessage(v string) { // CopyTo copies all properties from the current struct overriding the destination. func (ms ExportPartialSuccess) CopyTo(dest ExportPartialSuccess) { dest.state.AssertMutable() - dest.SetRejectedProfiles(ms.RejectedProfiles()) - dest.SetErrorMessage(ms.ErrorMessage()) + copyOrigExportPartialSuccess(dest.orig, ms.orig) +} + +func copyOrigExportPartialSuccess(dest, src *otlpcollectorprofile.ExportProfilesPartialSuccess) { + dest.RejectedProfiles = src.RejectedProfiles + dest.ErrorMessage = src.ErrorMessage } diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/LICENSE b/vendor/go.opentelemetry.io/collector/pdata/xpdata/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/context.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/context.go new file mode 100644 index 000000000..91c833731 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/context.go @@ -0,0 +1,165 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "context" + "net" + + "go.opentelemetry.io/otel/trace" + + "go.opentelemetry.io/collector/client" + pdataint "go.opentelemetry.io/collector/pdata/internal" + protocommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/xpdata/request/internal" +) + +var readOnlyState = pdataint.StateReadOnly + +// encodeContext encodes the context into a map of strings. +func encodeContext(ctx context.Context) internal.RequestContext { + rc := internal.RequestContext{} + encodeSpanContext(ctx, &rc) + encodeClientMetadata(ctx, &rc) + encodeClientAddress(ctx, &rc) + return rc +} + +func encodeSpanContext(ctx context.Context, rc *internal.RequestContext) { + spanCtx := trace.SpanContextFromContext(ctx) + if !spanCtx.IsValid() { + return + } + traceID := spanCtx.TraceID() + spanID := spanCtx.SpanID() + rc.SpanContext = &internal.SpanContext{ + TraceId: traceID[:], + SpanId: spanID[:], + TraceFlags: uint32(spanCtx.TraceFlags()), + TraceState: spanCtx.TraceState().String(), + Remote: spanCtx.IsRemote(), + } +} + +func encodeClientMetadata(ctx context.Context, rc *internal.RequestContext) { + clientMetadata := client.FromContext(ctx).Metadata + metadataMap, metadataFound := pcommon.Map{}, false + for k := range clientMetadata.Keys() { + if !metadataFound { + metadataMap, metadataFound = pcommon.NewMap(), true + } + vals := metadataMap.PutEmptySlice(k) + for i := 0; i < len(clientMetadata.Get(k)); i++ { + vals.AppendEmpty().SetStr(clientMetadata.Get(k)[i]) + } + } + if metadataFound { + rc.ClientMetadata = *pdataint.GetOrigMap(pdataint.Map(metadataMap)) + } +} + +func encodeClientAddress(ctx context.Context, rc *internal.RequestContext) { + switch a := client.FromContext(ctx).Addr.(type) { + case *net.IPAddr: + rc.ClientAddress = &internal.RequestContext_Ip{Ip: &internal.IPAddr{ + Ip: a.IP, + Zone: a.Zone, + }} + case *net.TCPAddr: + rc.ClientAddress = &internal.RequestContext_Tcp{Tcp: &internal.TCPAddr{ + Ip: a.IP, + Port: int64(a.Port), + Zone: a.Zone, + }} + case *net.UDPAddr: + rc.ClientAddress = &internal.RequestContext_Udp{Udp: &internal.UDPAddr{ + Ip: a.IP, + Port: int64(a.Port), + Zone: a.Zone, + }} + case *net.UnixAddr: + rc.ClientAddress = &internal.RequestContext_Unix{Unix: &internal.UnixAddr{ + Name: a.Name, + Net: a.Net, + }} + } +} + +// decodeContext decodes the context from the bytes map. +func decodeContext(ctx context.Context, rc *internal.RequestContext) context.Context { + if rc == nil { + return ctx + } + ctx = decodeSpanContext(ctx, rc.SpanContext) + metadataMap := decodeClientMetadata(rc.ClientMetadata) + clientAddress := decodeClientAddress(rc) + if len(metadataMap) > 0 || clientAddress != nil { + ctx = client.NewContext(ctx, client.Info{ + Metadata: client.NewMetadata(metadataMap), + Addr: clientAddress, + }) + } + return ctx +} + +func decodeSpanContext(ctx context.Context, sc *internal.SpanContext) context.Context { + if sc == nil { + return ctx + } + traceID := trace.TraceID{} + copy(traceID[:], sc.TraceId) + spanID := trace.SpanID{} + copy(spanID[:], sc.SpanId) + traceState, _ := trace.ParseTraceState(sc.TraceState) + return trace.ContextWithSpanContext(context.Background(), trace.NewSpanContext(trace.SpanContextConfig{ + TraceID: traceID, + SpanID: spanID, + TraceFlags: trace.TraceFlags(sc.TraceFlags), + TraceState: traceState, + Remote: sc.Remote, + })) +} + +func decodeClientMetadata(clientMetadata []protocommon.KeyValue) map[string][]string { + if len(clientMetadata) == 0 { + return nil + } + metadataMap := make(map[string][]string, len(clientMetadata)) + for k, vals := range pcommon.Map(pdataint.NewMap(&clientMetadata, &readOnlyState)).All() { + metadataMap[k] = make([]string, vals.Slice().Len()) + for i, v := range vals.Slice().All() { + metadataMap[k][i] = v.Str() + } + } + return metadataMap +} + +func decodeClientAddress(rc *internal.RequestContext) net.Addr { + switch a := rc.ClientAddress.(type) { + case *internal.RequestContext_Ip: + return &net.IPAddr{ + IP: a.Ip.Ip, + Zone: a.Ip.Zone, + } + case *internal.RequestContext_Tcp: + return &net.TCPAddr{ + IP: a.Tcp.Ip, + Port: int(a.Tcp.Port), + Zone: a.Tcp.Zone, + } + case *internal.RequestContext_Udp: + return &net.UDPAddr{ + IP: a.Udp.Ip, + Port: int(a.Udp.Port), + Zone: a.Udp.Zone, + } + case *internal.RequestContext_Unix: + return &net.UnixAddr{ + Name: a.Unix.Name, + Net: a.Unix.Net, + } + } + return nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/internal/request.pb.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/internal/request.pb.go new file mode 100644 index 000000000..524ffee02 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/internal/request.pb.go @@ -0,0 +1,3167 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pdata/xpdata/request/internal/request.proto + +package internal + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + + v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + v13 "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + v12 "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + v1development "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" + v11 "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// SpanContext represents a span context encoded associated with a telemetry export request. +type SpanContext struct { + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + TraceFlags uint32 `protobuf:"fixed32,3,opt,name=trace_flags,json=traceFlags,proto3" json:"trace_flags,omitempty"` + TraceState string `protobuf:"bytes,4,opt,name=trace_state,json=traceState,proto3" json:"trace_state,omitempty"` + Remote bool `protobuf:"varint,5,opt,name=remote,proto3" json:"remote,omitempty"` +} + +func (m *SpanContext) Reset() { *m = SpanContext{} } +func (m *SpanContext) String() string { return proto.CompactTextString(m) } +func (*SpanContext) ProtoMessage() {} +func (*SpanContext) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{0} +} +func (m *SpanContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpanContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpanContext.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SpanContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpanContext.Merge(m, src) +} +func (m *SpanContext) XXX_Size() int { + return m.Size() +} +func (m *SpanContext) XXX_DiscardUnknown() { + xxx_messageInfo_SpanContext.DiscardUnknown(m) +} + +var xxx_messageInfo_SpanContext proto.InternalMessageInfo + +func (m *SpanContext) GetTraceId() []byte { + if m != nil { + return m.TraceId + } + return nil +} + +func (m *SpanContext) GetSpanId() []byte { + if m != nil { + return m.SpanId + } + return nil +} + +func (m *SpanContext) GetTraceFlags() uint32 { + if m != nil { + return m.TraceFlags + } + return 0 +} + +func (m *SpanContext) GetTraceState() string { + if m != nil { + return m.TraceState + } + return "" +} + +func (m *SpanContext) GetRemote() bool { + if m != nil { + return m.Remote + } + return false +} + +type IPAddr struct { + Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + Zone string `protobuf:"bytes,2,opt,name=zone,proto3" json:"zone,omitempty"` +} + +func (m *IPAddr) Reset() { *m = IPAddr{} } +func (m *IPAddr) String() string { return proto.CompactTextString(m) } +func (*IPAddr) ProtoMessage() {} +func (*IPAddr) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{1} +} +func (m *IPAddr) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IPAddr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IPAddr.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IPAddr) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddr.Merge(m, src) +} +func (m *IPAddr) XXX_Size() int { + return m.Size() +} +func (m *IPAddr) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddr.DiscardUnknown(m) +} + +var xxx_messageInfo_IPAddr proto.InternalMessageInfo + +func (m *IPAddr) GetIp() []byte { + if m != nil { + return m.Ip + } + return nil +} + +func (m *IPAddr) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +type TCPAddr struct { + Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + Port int64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` +} + +func (m *TCPAddr) Reset() { *m = TCPAddr{} } +func (m *TCPAddr) String() string { return proto.CompactTextString(m) } +func (*TCPAddr) ProtoMessage() {} +func (*TCPAddr) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{2} +} +func (m *TCPAddr) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TCPAddr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TCPAddr.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TCPAddr) XXX_Merge(src proto.Message) { + xxx_messageInfo_TCPAddr.Merge(m, src) +} +func (m *TCPAddr) XXX_Size() int { + return m.Size() +} +func (m *TCPAddr) XXX_DiscardUnknown() { + xxx_messageInfo_TCPAddr.DiscardUnknown(m) +} + +var xxx_messageInfo_TCPAddr proto.InternalMessageInfo + +func (m *TCPAddr) GetIp() []byte { + if m != nil { + return m.Ip + } + return nil +} + +func (m *TCPAddr) GetPort() int64 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *TCPAddr) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +type UDPAddr struct { + Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + Port int64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` +} + +func (m *UDPAddr) Reset() { *m = UDPAddr{} } +func (m *UDPAddr) String() string { return proto.CompactTextString(m) } +func (*UDPAddr) ProtoMessage() {} +func (*UDPAddr) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{3} +} +func (m *UDPAddr) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UDPAddr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UDPAddr.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UDPAddr) XXX_Merge(src proto.Message) { + xxx_messageInfo_UDPAddr.Merge(m, src) +} +func (m *UDPAddr) XXX_Size() int { + return m.Size() +} +func (m *UDPAddr) XXX_DiscardUnknown() { + xxx_messageInfo_UDPAddr.DiscardUnknown(m) +} + +var xxx_messageInfo_UDPAddr proto.InternalMessageInfo + +func (m *UDPAddr) GetIp() []byte { + if m != nil { + return m.Ip + } + return nil +} + +func (m *UDPAddr) GetPort() int64 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *UDPAddr) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +type UnixAddr struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Net string `protobuf:"bytes,2,opt,name=net,proto3" json:"net,omitempty"` +} + +func (m *UnixAddr) Reset() { *m = UnixAddr{} } +func (m *UnixAddr) String() string { return proto.CompactTextString(m) } +func (*UnixAddr) ProtoMessage() {} +func (*UnixAddr) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{4} +} +func (m *UnixAddr) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnixAddr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnixAddr.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UnixAddr) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnixAddr.Merge(m, src) +} +func (m *UnixAddr) XXX_Size() int { + return m.Size() +} +func (m *UnixAddr) XXX_DiscardUnknown() { + xxx_messageInfo_UnixAddr.DiscardUnknown(m) +} + +var xxx_messageInfo_UnixAddr proto.InternalMessageInfo + +func (m *UnixAddr) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UnixAddr) GetNet() string { + if m != nil { + return m.Net + } + return "" +} + +// RequestContext represents metadata associated with a telemetry export request. +type RequestContext struct { + SpanContext *SpanContext `protobuf:"bytes,1,opt,name=span_context,json=spanContext,proto3" json:"span_context,omitempty"` + // ClientMetadata contains additional metadata about the client making the request. + ClientMetadata []v1.KeyValue `protobuf:"bytes,2,rep,name=client_metadata,json=clientMetadata,proto3" json:"client_metadata"` + // ClientAddress contains the address of the client making the request. + // + // Types that are valid to be assigned to ClientAddress: + // *RequestContext_Ip + // *RequestContext_Tcp + // *RequestContext_Udp + // *RequestContext_Unix + ClientAddress isRequestContext_ClientAddress `protobuf_oneof:"client_address"` +} + +func (m *RequestContext) Reset() { *m = RequestContext{} } +func (m *RequestContext) String() string { return proto.CompactTextString(m) } +func (*RequestContext) ProtoMessage() {} +func (*RequestContext) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{5} +} +func (m *RequestContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestContext.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RequestContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestContext.Merge(m, src) +} +func (m *RequestContext) XXX_Size() int { + return m.Size() +} +func (m *RequestContext) XXX_DiscardUnknown() { + xxx_messageInfo_RequestContext.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestContext proto.InternalMessageInfo + +type isRequestContext_ClientAddress interface { + isRequestContext_ClientAddress() + MarshalTo([]byte) (int, error) + Size() int +} + +type RequestContext_Ip struct { + Ip *IPAddr `protobuf:"bytes,3,opt,name=ip,proto3,oneof" json:"ip,omitempty"` +} +type RequestContext_Tcp struct { + Tcp *TCPAddr `protobuf:"bytes,4,opt,name=tcp,proto3,oneof" json:"tcp,omitempty"` +} +type RequestContext_Udp struct { + Udp *UDPAddr `protobuf:"bytes,5,opt,name=udp,proto3,oneof" json:"udp,omitempty"` +} +type RequestContext_Unix struct { + Unix *UnixAddr `protobuf:"bytes,6,opt,name=unix,proto3,oneof" json:"unix,omitempty"` +} + +func (*RequestContext_Ip) isRequestContext_ClientAddress() {} +func (*RequestContext_Tcp) isRequestContext_ClientAddress() {} +func (*RequestContext_Udp) isRequestContext_ClientAddress() {} +func (*RequestContext_Unix) isRequestContext_ClientAddress() {} + +func (m *RequestContext) GetClientAddress() isRequestContext_ClientAddress { + if m != nil { + return m.ClientAddress + } + return nil +} + +func (m *RequestContext) GetSpanContext() *SpanContext { + if m != nil { + return m.SpanContext + } + return nil +} + +func (m *RequestContext) GetClientMetadata() []v1.KeyValue { + if m != nil { + return m.ClientMetadata + } + return nil +} + +func (m *RequestContext) GetIp() *IPAddr { + if x, ok := m.GetClientAddress().(*RequestContext_Ip); ok { + return x.Ip + } + return nil +} + +func (m *RequestContext) GetTcp() *TCPAddr { + if x, ok := m.GetClientAddress().(*RequestContext_Tcp); ok { + return x.Tcp + } + return nil +} + +func (m *RequestContext) GetUdp() *UDPAddr { + if x, ok := m.GetClientAddress().(*RequestContext_Udp); ok { + return x.Udp + } + return nil +} + +func (m *RequestContext) GetUnix() *UnixAddr { + if x, ok := m.GetClientAddress().(*RequestContext_Unix); ok { + return x.Unix + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RequestContext) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RequestContext_Ip)(nil), + (*RequestContext_Tcp)(nil), + (*RequestContext_Udp)(nil), + (*RequestContext_Unix)(nil), + } +} + +type TracesRequest struct { + FormatVersion uint32 `protobuf:"fixed32,1,opt,name=format_version,json=formatVersion,proto3" json:"format_version,omitempty"` + RequestContext *RequestContext `protobuf:"bytes,2,opt,name=request_context,json=requestContext,proto3" json:"request_context,omitempty"` + TracesData *v11.TracesData `protobuf:"bytes,3,opt,name=traces_data,json=tracesData,proto3" json:"traces_data,omitempty"` +} + +func (m *TracesRequest) Reset() { *m = TracesRequest{} } +func (m *TracesRequest) String() string { return proto.CompactTextString(m) } +func (*TracesRequest) ProtoMessage() {} +func (*TracesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{6} +} +func (m *TracesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TracesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TracesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TracesRequest.Merge(m, src) +} +func (m *TracesRequest) XXX_Size() int { + return m.Size() +} +func (m *TracesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TracesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TracesRequest proto.InternalMessageInfo + +func (m *TracesRequest) GetFormatVersion() uint32 { + if m != nil { + return m.FormatVersion + } + return 0 +} + +func (m *TracesRequest) GetRequestContext() *RequestContext { + if m != nil { + return m.RequestContext + } + return nil +} + +func (m *TracesRequest) GetTracesData() *v11.TracesData { + if m != nil { + return m.TracesData + } + return nil +} + +type MetricsRequest struct { + FormatVersion uint32 `protobuf:"fixed32,1,opt,name=format_version,json=formatVersion,proto3" json:"format_version,omitempty"` + RequestContext *RequestContext `protobuf:"bytes,2,opt,name=request_context,json=requestContext,proto3" json:"request_context,omitempty"` + MetricsData *v12.MetricsData `protobuf:"bytes,3,opt,name=metrics_data,json=metricsData,proto3" json:"metrics_data,omitempty"` +} + +func (m *MetricsRequest) Reset() { *m = MetricsRequest{} } +func (m *MetricsRequest) String() string { return proto.CompactTextString(m) } +func (*MetricsRequest) ProtoMessage() {} +func (*MetricsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{7} +} +func (m *MetricsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MetricsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MetricsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetricsRequest.Merge(m, src) +} +func (m *MetricsRequest) XXX_Size() int { + return m.Size() +} +func (m *MetricsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MetricsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MetricsRequest proto.InternalMessageInfo + +func (m *MetricsRequest) GetFormatVersion() uint32 { + if m != nil { + return m.FormatVersion + } + return 0 +} + +func (m *MetricsRequest) GetRequestContext() *RequestContext { + if m != nil { + return m.RequestContext + } + return nil +} + +func (m *MetricsRequest) GetMetricsData() *v12.MetricsData { + if m != nil { + return m.MetricsData + } + return nil +} + +type LogsRequest struct { + FormatVersion uint32 `protobuf:"fixed32,1,opt,name=format_version,json=formatVersion,proto3" json:"format_version,omitempty"` + RequestContext *RequestContext `protobuf:"bytes,2,opt,name=request_context,json=requestContext,proto3" json:"request_context,omitempty"` + LogsData *v13.LogsData `protobuf:"bytes,3,opt,name=logs_data,json=logsData,proto3" json:"logs_data,omitempty"` +} + +func (m *LogsRequest) Reset() { *m = LogsRequest{} } +func (m *LogsRequest) String() string { return proto.CompactTextString(m) } +func (*LogsRequest) ProtoMessage() {} +func (*LogsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{8} +} +func (m *LogsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LogsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LogsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogsRequest.Merge(m, src) +} +func (m *LogsRequest) XXX_Size() int { + return m.Size() +} +func (m *LogsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LogsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LogsRequest proto.InternalMessageInfo + +func (m *LogsRequest) GetFormatVersion() uint32 { + if m != nil { + return m.FormatVersion + } + return 0 +} + +func (m *LogsRequest) GetRequestContext() *RequestContext { + if m != nil { + return m.RequestContext + } + return nil +} + +func (m *LogsRequest) GetLogsData() *v13.LogsData { + if m != nil { + return m.LogsData + } + return nil +} + +type ProfilesRequest struct { + FormatVersion uint32 `protobuf:"fixed32,1,opt,name=format_version,json=formatVersion,proto3" json:"format_version,omitempty"` + RequestContext *RequestContext `protobuf:"bytes,2,opt,name=request_context,json=requestContext,proto3" json:"request_context,omitempty"` + ProfilesData *v1development.ProfilesData `protobuf:"bytes,3,opt,name=profiles_data,json=profilesData,proto3" json:"profiles_data,omitempty"` +} + +func (m *ProfilesRequest) Reset() { *m = ProfilesRequest{} } +func (m *ProfilesRequest) String() string { return proto.CompactTextString(m) } +func (*ProfilesRequest) ProtoMessage() {} +func (*ProfilesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b47c551a6764db21, []int{9} +} +func (m *ProfilesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProfilesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProfilesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProfilesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProfilesRequest.Merge(m, src) +} +func (m *ProfilesRequest) XXX_Size() int { + return m.Size() +} +func (m *ProfilesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProfilesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ProfilesRequest proto.InternalMessageInfo + +func (m *ProfilesRequest) GetFormatVersion() uint32 { + if m != nil { + return m.FormatVersion + } + return 0 +} + +func (m *ProfilesRequest) GetRequestContext() *RequestContext { + if m != nil { + return m.RequestContext + } + return nil +} + +func (m *ProfilesRequest) GetProfilesData() *v1development.ProfilesData { + if m != nil { + return m.ProfilesData + } + return nil +} + +func init() { + proto.RegisterType((*SpanContext)(nil), "opentelemetry.collector.pdata.xpdata.internal.SpanContext") + proto.RegisterType((*IPAddr)(nil), "opentelemetry.collector.pdata.xpdata.internal.IPAddr") + proto.RegisterType((*TCPAddr)(nil), "opentelemetry.collector.pdata.xpdata.internal.TCPAddr") + proto.RegisterType((*UDPAddr)(nil), "opentelemetry.collector.pdata.xpdata.internal.UDPAddr") + proto.RegisterType((*UnixAddr)(nil), "opentelemetry.collector.pdata.xpdata.internal.UnixAddr") + proto.RegisterType((*RequestContext)(nil), "opentelemetry.collector.pdata.xpdata.internal.RequestContext") + proto.RegisterType((*TracesRequest)(nil), "opentelemetry.collector.pdata.xpdata.internal.TracesRequest") + proto.RegisterType((*MetricsRequest)(nil), "opentelemetry.collector.pdata.xpdata.internal.MetricsRequest") + proto.RegisterType((*LogsRequest)(nil), "opentelemetry.collector.pdata.xpdata.internal.LogsRequest") + proto.RegisterType((*ProfilesRequest)(nil), "opentelemetry.collector.pdata.xpdata.internal.ProfilesRequest") +} + +func init() { + proto.RegisterFile("pdata/xpdata/request/internal/request.proto", fileDescriptor_b47c551a6764db21) +} + +var fileDescriptor_b47c551a6764db21 = []byte{ + // 783 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0x8d, 0x93, 0x90, 0x8f, 0x75, 0x9a, 0x56, 0x16, 0x82, 0xd0, 0x43, 0x1a, 0x59, 0x2a, 0x44, + 0xb4, 0x38, 0xa4, 0x15, 0x9f, 0x12, 0x87, 0xa6, 0x15, 0x34, 0x40, 0x50, 0xe5, 0x7e, 0x1c, 0x90, + 0xaa, 0x68, 0xb1, 0x37, 0x91, 0x25, 0x7b, 0xd7, 0xd8, 0x9b, 0x28, 0xe5, 0x1f, 0x70, 0xe3, 0xce, + 0x1f, 0xea, 0xb1, 0x47, 0x4e, 0xa8, 0x6a, 0x4f, 0x9c, 0xf8, 0x09, 0xa0, 0x9d, 0xdd, 0xa4, 0x49, + 0x65, 0x0e, 0x11, 0x97, 0x9e, 0x32, 0x3b, 0x7e, 0xf3, 0x3c, 0x6f, 0xf7, 0x79, 0x27, 0x68, 0x2d, + 0x74, 0x31, 0xc7, 0x8d, 0x91, 0xfc, 0x89, 0xc8, 0xe7, 0x01, 0x89, 0x79, 0xc3, 0xa3, 0x9c, 0x44, + 0x14, 0xfb, 0xe3, 0x84, 0x15, 0x46, 0x8c, 0x33, 0xe3, 0x11, 0x0b, 0x09, 0xe5, 0xc4, 0x27, 0x01, + 0xe1, 0xd1, 0x89, 0xe5, 0x30, 0xdf, 0x27, 0x0e, 0x67, 0x91, 0x05, 0xd5, 0x96, 0x24, 0xb1, 0xc6, + 0xc5, 0xcb, 0xb7, 0xfb, 0xac, 0xcf, 0xa0, 0xb2, 0x21, 0x22, 0x49, 0xb2, 0x5c, 0x9f, 0x21, 0x69, + 0xc8, 0xe7, 0x3c, 0xc2, 0x0e, 0x69, 0x0c, 0x9b, 0x32, 0x50, 0xc8, 0xf5, 0x24, 0xa4, 0x88, 0x3d, + 0x27, 0x16, 0x58, 0x15, 0x2a, 0xf4, 0xfd, 0x24, 0xb4, 0xcf, 0xfa, 0x00, 0x15, 0xbf, 0x0a, 0xf7, + 0x30, 0x09, 0xe7, 0xb0, 0x20, 0x60, 0x54, 0x20, 0x65, 0xa4, 0xb0, 0x2f, 0x92, 0xb0, 0x61, 0xc4, + 0x7a, 0x9e, 0x4f, 0x04, 0xaf, 0x4b, 0x86, 0xc4, 0x67, 0x61, 0x40, 0x28, 0x9f, 0xa4, 0x65, 0xa9, + 0xf9, 0x5d, 0x43, 0xfa, 0x7e, 0x88, 0xe9, 0x36, 0xa3, 0x9c, 0x8c, 0xb8, 0x71, 0x0f, 0x15, 0x40, + 0x5b, 0xd7, 0x73, 0x2b, 0x5a, 0x4d, 0xab, 0x97, 0xec, 0x3c, 0xac, 0xdb, 0xae, 0x71, 0x17, 0xe5, + 0xe3, 0x10, 0x53, 0xf1, 0x24, 0x0d, 0x4f, 0x72, 0x62, 0xd9, 0x76, 0x8d, 0x15, 0xa4, 0xcb, 0x9a, + 0x9e, 0x8f, 0xfb, 0x71, 0x25, 0x53, 0xd3, 0xea, 0x79, 0x1b, 0x41, 0xea, 0xb5, 0xc8, 0x5c, 0x01, + 0x62, 0x8e, 0x39, 0xa9, 0x64, 0x6b, 0x5a, 0xbd, 0xa8, 0x00, 0xfb, 0x22, 0x63, 0xdc, 0x41, 0xb9, + 0x88, 0x04, 0x8c, 0x93, 0xca, 0xad, 0x9a, 0x56, 0x2f, 0xd8, 0x6a, 0x65, 0xae, 0xa3, 0x5c, 0x7b, + 0x6f, 0xcb, 0x75, 0x23, 0xa3, 0x8c, 0xd2, 0x5e, 0xa8, 0x3a, 0x4a, 0x7b, 0xa1, 0x61, 0xa0, 0xec, + 0x17, 0x46, 0x09, 0x74, 0x52, 0xb4, 0x21, 0x36, 0xb7, 0x50, 0xfe, 0x60, 0xfb, 0x9f, 0xf0, 0x90, + 0x45, 0x1c, 0xe0, 0x19, 0x1b, 0xe2, 0x09, 0x45, 0x66, 0x96, 0xe2, 0x70, 0xe7, 0xff, 0x28, 0x1e, + 0xa3, 0xc2, 0x21, 0xf5, 0x46, 0xc0, 0x61, 0xa0, 0x2c, 0xc5, 0x01, 0x01, 0x96, 0xa2, 0x0d, 0xb1, + 0xb1, 0x84, 0x32, 0x94, 0x70, 0xd5, 0xb8, 0x08, 0xcd, 0xaf, 0x59, 0x54, 0xb6, 0xa5, 0x83, 0xc7, + 0xc7, 0x70, 0x8c, 0x4a, 0xb0, 0xd7, 0x8e, 0x5c, 0x03, 0x81, 0xbe, 0xf1, 0xd2, 0x9a, 0xcb, 0xd9, + 0xd6, 0xd4, 0xc1, 0xda, 0x7a, 0x3c, 0x75, 0xca, 0x47, 0x68, 0xd1, 0xf1, 0x3d, 0x42, 0x79, 0x37, + 0x20, 0x1c, 0x8b, 0xa2, 0x4a, 0xba, 0x96, 0xa9, 0xeb, 0x1b, 0x0f, 0xae, 0xbd, 0x01, 0x4c, 0x62, + 0x29, 0xb3, 0x0d, 0x9b, 0xd6, 0x3b, 0x72, 0x72, 0x84, 0xfd, 0x01, 0x69, 0x65, 0x4f, 0x7f, 0xae, + 0xa4, 0xec, 0xb2, 0x64, 0xe9, 0x28, 0x12, 0xe3, 0x0d, 0xec, 0x59, 0x06, 0x9a, 0x7d, 0x32, 0x67, + 0xb3, 0xf2, 0xa0, 0x77, 0x53, 0xb0, 0xd9, 0x6f, 0x51, 0x86, 0x3b, 0x21, 0x38, 0x45, 0xdf, 0x78, + 0x3a, 0x27, 0x93, 0x32, 0xc1, 0x6e, 0xca, 0x16, 0x24, 0x82, 0x6b, 0xe0, 0x86, 0xe0, 0xac, 0xf9, + 0xb9, 0x94, 0x1b, 0x04, 0xd7, 0xc0, 0x0d, 0x8d, 0x0e, 0xca, 0x0e, 0xa8, 0x37, 0xaa, 0xe4, 0x80, + 0xec, 0xd9, 0xbc, 0x64, 0xca, 0x17, 0xbb, 0x29, 0x1b, 0x68, 0x5a, 0x4b, 0x48, 0xed, 0x60, 0x17, + 0xbb, 0x6e, 0x44, 0xe2, 0xd8, 0xfc, 0xa5, 0xa1, 0x85, 0x03, 0xf1, 0x61, 0xc4, 0xca, 0x11, 0xc6, + 0x2a, 0x2a, 0xf7, 0x58, 0x14, 0x60, 0xde, 0x1d, 0x92, 0x28, 0xf6, 0x18, 0x05, 0x33, 0xe4, 0xed, + 0x05, 0x99, 0x3d, 0x92, 0x49, 0xa3, 0x87, 0x16, 0xd5, 0x2d, 0x38, 0x31, 0x4d, 0x1a, 0x9a, 0x7c, + 0x35, 0x67, 0x93, 0xb3, 0x4e, 0xb4, 0xcb, 0xd1, 0xac, 0x33, 0xdb, 0xea, 0x5b, 0x8e, 0xbb, 0x60, + 0x1b, 0x79, 0xd6, 0xf5, 0x44, 0xdb, 0xc8, 0x4b, 0x72, 0xd8, 0xb4, 0xa4, 0xa0, 0x1d, 0xcc, 0xb1, + 0xfa, 0xea, 0x21, 0x36, 0x7f, 0x6b, 0xa8, 0xdc, 0x91, 0x97, 0xe3, 0x0d, 0x15, 0xfb, 0x01, 0x95, + 0xd4, 0xed, 0x3d, 0xad, 0x76, 0x2d, 0x51, 0xed, 0xf8, 0x9a, 0x1f, 0x36, 0x2d, 0x25, 0x0a, 0x04, + 0xeb, 0xc1, 0xd5, 0xc2, 0x3c, 0xd7, 0x90, 0xfe, 0x9e, 0xf5, 0x6f, 0xaa, 0xdc, 0x16, 0x2a, 0x8a, + 0x09, 0x34, 0xad, 0x75, 0x35, 0x51, 0x2b, 0xcc, 0xa9, 0x61, 0xd3, 0x12, 0x5a, 0x40, 0x65, 0xc1, + 0x57, 0x91, 0xf9, 0x47, 0x43, 0x8b, 0x7b, 0x6a, 0xc6, 0xdc, 0x50, 0x99, 0xc7, 0x68, 0x61, 0x3c, + 0x05, 0xa7, 0xa5, 0x3e, 0x4f, 0x94, 0x3a, 0x99, 0x97, 0x33, 0x63, 0xd4, 0x1a, 0x4b, 0x04, 0xf5, + 0xa5, 0x70, 0x6a, 0xd5, 0xea, 0x9c, 0x5e, 0x54, 0xb5, 0xb3, 0x8b, 0xaa, 0x76, 0x7e, 0x51, 0xd5, + 0xbe, 0x5d, 0x56, 0x53, 0x67, 0x97, 0xd5, 0xd4, 0x8f, 0xcb, 0x6a, 0xea, 0xe3, 0x66, 0x9f, 0x5d, + 0x7b, 0x87, 0x27, 0x66, 0xba, 0x12, 0xd3, 0x98, 0xf9, 0x8f, 0x33, 0x16, 0xf3, 0x29, 0x07, 0x7d, + 0x6c, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x46, 0x4d, 0x98, 0x93, 0x03, 0x09, 0x00, 0x00, +} + +func (m *SpanContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SpanContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpanContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Remote { + i-- + if m.Remote { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.TraceState) > 0 { + i -= len(m.TraceState) + copy(dAtA[i:], m.TraceState) + i = encodeVarintRequest(dAtA, i, uint64(len(m.TraceState))) + i-- + dAtA[i] = 0x22 + } + if m.TraceFlags != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.TraceFlags)) + i-- + dAtA[i] = 0x1d + } + if len(m.SpanId) > 0 { + i -= len(m.SpanId) + copy(dAtA[i:], m.SpanId) + i = encodeVarintRequest(dAtA, i, uint64(len(m.SpanId))) + i-- + dAtA[i] = 0x12 + } + if len(m.TraceId) > 0 { + i -= len(m.TraceId) + copy(dAtA[i:], m.TraceId) + i = encodeVarintRequest(dAtA, i, uint64(len(m.TraceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IPAddr) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IPAddr) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAddr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Zone) > 0 { + i -= len(m.Zone) + copy(dAtA[i:], m.Zone) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Zone))) + i-- + dAtA[i] = 0x12 + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TCPAddr) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TCPAddr) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TCPAddr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Zone) > 0 { + i -= len(m.Zone) + copy(dAtA[i:], m.Zone) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Zone))) + i-- + dAtA[i] = 0x1a + } + if m.Port != 0 { + i = encodeVarintRequest(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UDPAddr) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UDPAddr) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UDPAddr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Zone) > 0 { + i -= len(m.Zone) + copy(dAtA[i:], m.Zone) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Zone))) + i-- + dAtA[i] = 0x1a + } + if m.Port != 0 { + i = encodeVarintRequest(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UnixAddr) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UnixAddr) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnixAddr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Net) > 0 { + i -= len(m.Net) + copy(dAtA[i:], m.Net) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Net))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRequest(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RequestContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RequestContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClientAddress != nil { + { + size := m.ClientAddress.Size() + i -= size + if _, err := m.ClientAddress.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.ClientMetadata) > 0 { + for iNdEx := len(m.ClientMetadata) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ClientMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.SpanContext != nil { + { + size, err := m.SpanContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RequestContext_Ip) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestContext_Ip) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Ip != nil { + { + size, err := m.Ip.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *RequestContext_Tcp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestContext_Tcp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Tcp != nil { + { + size, err := m.Tcp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *RequestContext_Udp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestContext_Udp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Udp != nil { + { + size, err := m.Udp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *RequestContext_Unix) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestContext_Unix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Unix != nil { + { + size, err := m.Unix.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *TracesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TracesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TracesData != nil { + { + size, err := m.TracesData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.RequestContext != nil { + { + size, err := m.RequestContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.FormatVersion != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.FormatVersion)) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func (m *MetricsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MetricsData != nil { + { + size, err := m.MetricsData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.RequestContext != nil { + { + size, err := m.RequestContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.FormatVersion != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.FormatVersion)) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func (m *LogsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LogsData != nil { + { + size, err := m.LogsData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.RequestContext != nil { + { + size, err := m.RequestContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.FormatVersion != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.FormatVersion)) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func (m *ProfilesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProfilesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProfilesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProfilesData != nil { + { + size, err := m.ProfilesData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.RequestContext != nil { + { + size, err := m.RequestContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequest(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.FormatVersion != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.FormatVersion)) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func encodeVarintRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SpanContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TraceId) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + l = len(m.SpanId) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + if m.TraceFlags != 0 { + n += 5 + } + l = len(m.TraceState) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + if m.Remote { + n += 2 + } + return n +} + +func (m *IPAddr) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + l = len(m.Zone) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *TCPAddr) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + if m.Port != 0 { + n += 1 + sovRequest(uint64(m.Port)) + } + l = len(m.Zone) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *UDPAddr) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + if m.Port != 0 { + n += 1 + sovRequest(uint64(m.Port)) + } + l = len(m.Zone) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *UnixAddr) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + l = len(m.Net) + if l > 0 { + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *RequestContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpanContext != nil { + l = m.SpanContext.Size() + n += 1 + l + sovRequest(uint64(l)) + } + if len(m.ClientMetadata) > 0 { + for _, e := range m.ClientMetadata { + l = e.Size() + n += 1 + l + sovRequest(uint64(l)) + } + } + if m.ClientAddress != nil { + n += m.ClientAddress.Size() + } + return n +} + +func (m *RequestContext_Ip) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ip != nil { + l = m.Ip.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} +func (m *RequestContext_Tcp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tcp != nil { + l = m.Tcp.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} +func (m *RequestContext_Udp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Udp != nil { + l = m.Udp.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} +func (m *RequestContext_Unix) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Unix != nil { + l = m.Unix.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} +func (m *TracesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FormatVersion != 0 { + n += 5 + } + if m.RequestContext != nil { + l = m.RequestContext.Size() + n += 1 + l + sovRequest(uint64(l)) + } + if m.TracesData != nil { + l = m.TracesData.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *MetricsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FormatVersion != 0 { + n += 5 + } + if m.RequestContext != nil { + l = m.RequestContext.Size() + n += 1 + l + sovRequest(uint64(l)) + } + if m.MetricsData != nil { + l = m.MetricsData.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *LogsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FormatVersion != 0 { + n += 5 + } + if m.RequestContext != nil { + l = m.RequestContext.Size() + n += 1 + l + sovRequest(uint64(l)) + } + if m.LogsData != nil { + l = m.LogsData.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func (m *ProfilesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FormatVersion != 0 { + n += 5 + } + if m.RequestContext != nil { + l = m.RequestContext.Size() + n += 1 + l + sovRequest(uint64(l)) + } + if m.ProfilesData != nil { + l = m.ProfilesData.Size() + n += 1 + l + sovRequest(uint64(l)) + } + return n +} + +func sovRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRequest(x uint64) (n int) { + return sovRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SpanContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SpanContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpanContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceId = append(m.TraceId[:0], dAtA[iNdEx:postIndex]...) + if m.TraceId == nil { + m.TraceId = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpanId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpanId = append(m.SpanId[:0], dAtA[iNdEx:postIndex]...) + if m.SpanId == nil { + m.SpanId = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceFlags", wireType) + } + m.TraceFlags = 0 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + m.TraceFlags = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceState", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Remote", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Remote = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IPAddr) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IPAddr: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IPAddr: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = append(m.Ip[:0], dAtA[iNdEx:postIndex]...) + if m.Ip == nil { + m.Ip = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Zone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Zone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TCPAddr) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TCPAddr: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TCPAddr: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = append(m.Ip[:0], dAtA[iNdEx:postIndex]...) + if m.Ip == nil { + m.Ip = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Zone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Zone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UDPAddr) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UDPAddr: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UDPAddr: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = append(m.Ip[:0], dAtA[iNdEx:postIndex]...) + if m.Ip == nil { + m.Ip = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Zone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Zone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UnixAddr) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UnixAddr: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnixAddr: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Net", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Net = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpanContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SpanContext == nil { + m.SpanContext = &SpanContext{} + } + if err := m.SpanContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientMetadata = append(m.ClientMetadata, v1.KeyValue{}) + if err := m.ClientMetadata[len(m.ClientMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &IPAddr{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ClientAddress = &RequestContext_Ip{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tcp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TCPAddr{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ClientAddress = &RequestContext_Tcp{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Udp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &UDPAddr{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ClientAddress = &RequestContext_Udp{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unix", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &UnixAddr{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ClientAddress = &RequestContext_Unix{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TracesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TracesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TracesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field FormatVersion", wireType) + } + m.FormatVersion = 0 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + m.FormatVersion = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestContext == nil { + m.RequestContext = &RequestContext{} + } + if err := m.RequestContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TracesData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TracesData == nil { + m.TracesData = &v11.TracesData{} + } + if err := m.TracesData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MetricsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field FormatVersion", wireType) + } + m.FormatVersion = 0 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + m.FormatVersion = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestContext == nil { + m.RequestContext = &RequestContext{} + } + if err := m.RequestContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricsData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetricsData == nil { + m.MetricsData = &v12.MetricsData{} + } + if err := m.MetricsData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LogsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field FormatVersion", wireType) + } + m.FormatVersion = 0 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + m.FormatVersion = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestContext == nil { + m.RequestContext = &RequestContext{} + } + if err := m.RequestContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LogsData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LogsData == nil { + m.LogsData = &v13.LogsData{} + } + if err := m.LogsData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProfilesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProfilesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProfilesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field FormatVersion", wireType) + } + m.FormatVersion = 0 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + m.FormatVersion = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestContext == nil { + m.RequestContext = &RequestContext{} + } + if err := m.RequestContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProfilesData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequest + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequest + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequest + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProfilesData == nil { + m.ProfilesData = &v1development.ProfilesData{} + } + if err := m.ProfilesData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRequest(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRequest + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRequest + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRequest + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/internal/request.proto b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/internal/request.proto new file mode 100644 index 000000000..ba4705167 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/internal/request.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; + +package opentelemetry.collector.pdata.xpdata.internal; + +option go_package = "go.opentelemetry.io/collector/pdata/xpdata/internal"; + +import "gogoproto/gogo.proto"; + +import "opentelemetry/proto/trace/v1/trace.proto"; +import "opentelemetry/proto/metrics/v1/metrics.proto"; +import "opentelemetry/proto/logs/v1/logs.proto"; +import "opentelemetry/proto/common/v1/common.proto"; +import "opentelemetry/proto/profiles/v1development/profiles.proto"; + +// SpanContext represents a span context encoded associated with a telemetry export request. +message SpanContext { + bytes trace_id = 1; + bytes span_id = 2; + fixed32 trace_flags = 3; + string trace_state = 4; + bool remote = 5; +} + +message IPAddr { + bytes ip = 1; + string zone = 2; +} + +message TCPAddr { + bytes ip = 1; + int64 port = 2; + string zone = 3; +} + +message UDPAddr { + bytes ip = 1; + int64 port = 2; + string zone = 3; +} + +message UnixAddr { + string name = 1; + string net = 2; +} + +// RequestContext represents metadata associated with a telemetry export request. +message RequestContext { + SpanContext span_context = 1; + + // ClientMetadata contains additional metadata about the client making the request. + repeated opentelemetry.proto.common.v1.KeyValue client_metadata = 2 [ (gogoproto.nullable) = false ]; + + // ClientAddress contains the address of the client making the request. + oneof client_address { + IPAddr ip = 3; + TCPAddr tcp = 4; + UDPAddr udp = 5; + UnixAddr unix = 6; + } +} + +// The following messages are wrappers around standard OpenTelemetry data types. +// They embed request-level context and a version discriminator to ensure they are not wire-compatible with +// the canonical OpenTelemetry proto messages. +// +// Each wrapper reserves field tag 1 for a `fixed32` (protobuf wire type 5) format_version field, which makes it +// structurally incompatible with the standard OTLP messages which use tag 1 for the data message field (protobuf wire type 2). +// This ensures old and new formats cannot be confused during decoding. + +message TracesRequest { + fixed32 format_version = 1; + RequestContext request_context = 2; + opentelemetry.proto.trace.v1.TracesData traces_data = 3; +} + +message MetricsRequest { + fixed32 format_version = 1; + RequestContext request_context = 2; + opentelemetry.proto.metrics.v1.MetricsData metrics_data = 3; +} + +message LogsRequest { + fixed32 format_version = 1; + RequestContext request_context = 2; + opentelemetry.proto.logs.v1.LogsData logs_data = 3; +} + +message ProfilesRequest { + fixed32 format_version = 1; + RequestContext request_context = 2; + opentelemetry.proto.profiles.v1development.ProfilesData profiles_data = 3; +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/logs_request.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/logs_request.go new file mode 100644 index 000000000..a5483ce48 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/logs_request.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/plog" + reqint "go.opentelemetry.io/collector/pdata/xpdata/request/internal" +) + +// MarshalLogs marshals plog.Logs along with the context into a byte slice. +func MarshalLogs(ctx context.Context, ld plog.Logs) ([]byte, error) { + otlpLogs := internal.LogsToProto(internal.Logs(ld)) + rc := encodeContext(ctx) + lr := reqint.LogsRequest{ + FormatVersion: requestFormatVersion, + LogsData: &otlpLogs, + RequestContext: &rc, + } + return lr.Marshal() +} + +// UnmarshalLogs unmarshals a byte slice into plog.Logs and the context. +func UnmarshalLogs(buf []byte) (context.Context, plog.Logs, error) { + ctx := context.Background() + if !isRequestPayloadV1(buf) { + return ctx, plog.Logs{}, ErrInvalidFormat + } + lr := reqint.LogsRequest{} + if err := lr.Unmarshal(buf); err != nil { + return ctx, plog.Logs{}, fmt.Errorf("failed to unmarshal logs request: %w", err) + } + return decodeContext(ctx, lr.RequestContext), plog.Logs(internal.LogsFromProto(*lr.LogsData)), nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/metrics_request.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/metrics_request.go new file mode 100644 index 000000000..b4796da52 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/metrics_request.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/pmetric" + reqint "go.opentelemetry.io/collector/pdata/xpdata/request/internal" +) + +// MarshalMetrics marshals pmetric.Metrics along with the context into a byte slice. +func MarshalMetrics(ctx context.Context, ld pmetric.Metrics) ([]byte, error) { + otlpMetrics := internal.MetricsToProto(internal.Metrics(ld)) + rc := encodeContext(ctx) + mr := reqint.MetricsRequest{ + FormatVersion: requestFormatVersion, + MetricsData: &otlpMetrics, + RequestContext: &rc, + } + return mr.Marshal() +} + +// UnmarshalMetrics unmarshals a byte slice into pmetric.Metrics and the context. +func UnmarshalMetrics(buf []byte) (context.Context, pmetric.Metrics, error) { + ctx := context.Background() + if !isRequestPayloadV1(buf) { + return ctx, pmetric.Metrics{}, ErrInvalidFormat + } + mr := reqint.MetricsRequest{} + if err := mr.Unmarshal(buf); err != nil { + return ctx, pmetric.Metrics{}, fmt.Errorf("failed to unmarshal metrics request: %w", err) + } + return decodeContext(ctx, mr.RequestContext), pmetric.Metrics(internal.MetricsFromProto(*mr.MetricsData)), nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/profiles_request.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/profiles_request.go new file mode 100644 index 000000000..b13c065fe --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/profiles_request.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/pprofile" + reqint "go.opentelemetry.io/collector/pdata/xpdata/request/internal" +) + +// MarshalProfiles marshals pprofile.Profiles along with the context into a byte slice. +func MarshalProfiles(ctx context.Context, ld pprofile.Profiles) ([]byte, error) { + otlpProfiles := internal.ProfilesToProto(internal.Profiles(ld)) + rc := encodeContext(ctx) + pr := reqint.ProfilesRequest{ + FormatVersion: requestFormatVersion, + ProfilesData: &otlpProfiles, + RequestContext: &rc, + } + return pr.Marshal() +} + +// UnmarshalProfiles unmarshals a byte slice into pprofile.Profiles and the context. +func UnmarshalProfiles(buf []byte) (context.Context, pprofile.Profiles, error) { + ctx := context.Background() + if !isRequestPayloadV1(buf) { + return ctx, pprofile.Profiles{}, ErrInvalidFormat + } + pr := reqint.ProfilesRequest{} + if err := pr.Unmarshal(buf); err != nil { + return ctx, pprofile.Profiles{}, fmt.Errorf("failed to unmarshal profiles request: %w", err) + } + return decodeContext(ctx, pr.RequestContext), pprofile.Profiles(internal.ProfilesFromProto(*pr.ProfilesData)), nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/requesttest.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/requesttest.go new file mode 100644 index 000000000..8b96546d6 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/requesttest.go @@ -0,0 +1,27 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/trace" +) + +func fakeSpanContext(tb testing.TB) trace.SpanContext { + traceID, err := trace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10") + require.NoError(tb, err) + spanID, err := trace.SpanIDFromHex("0102030405060708") + require.NoError(tb, err) + traceState, err := trace.ParseTraceState("key1=value1,key2=value2,key3=value3") + require.NoError(tb, err) + return trace.NewSpanContext(trace.SpanContextConfig{ + TraceID: traceID, + SpanID: spanID, + TraceFlags: 0x01, + TraceState: traceState, + Remote: true, + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/traces_request.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/traces_request.go new file mode 100644 index 000000000..ff5312b12 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/traces_request.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/ptrace" + reqint "go.opentelemetry.io/collector/pdata/xpdata/request/internal" +) + +// MarshalTraces marshals ptrace.Traces along with the context into a byte slice. +func MarshalTraces(ctx context.Context, ld ptrace.Traces) ([]byte, error) { + otlpTraces := internal.TracesToProto(internal.Traces(ld)) + rc := encodeContext(ctx) + tr := reqint.TracesRequest{ + FormatVersion: requestFormatVersion, + TracesData: &otlpTraces, + RequestContext: &rc, + } + return tr.Marshal() +} + +// UnmarshalTraces unmarshals a byte slice into ptrace.Traces and the context. +func UnmarshalTraces(buf []byte) (context.Context, ptrace.Traces, error) { + ctx := context.Background() + if !isRequestPayloadV1(buf) { + return ctx, ptrace.Traces{}, ErrInvalidFormat + } + tr := reqint.TracesRequest{} + if err := tr.Unmarshal(buf); err != nil { + return ctx, ptrace.Traces{}, fmt.Errorf("failed to unmarshal traces request: %w", err) + } + return decodeContext(ctx, tr.RequestContext), ptrace.Traces(internal.TracesFromProto(*tr.TracesData)), nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/version_check.go b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/version_check.go new file mode 100644 index 000000000..71e81ee00 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/xpdata/request/version_check.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package request // import "go.opentelemetry.io/collector/pdata/xpdata/request" + +import ( + "encoding/binary" + "errors" +) + +const ( + // field 1 << 3, wire type 5 (fixed32) + protoTag1TypeByte = 0x0D + + // version of the request payload format set in the `format_version` field + requestFormatVersion = uint32(1) +) + +var ErrInvalidFormat = errors.New("invalid request payload format") + +// isRequestPayloadV1 returns true if the given payload represents one of the wrappers around standard OpenTelemetry +// data types defined in internal/request.go and has the version set to 1. +func isRequestPayloadV1(data []byte) bool { + if len(data) < 5 { + return false + } + if data[0] != protoTag1TypeByte { + return false + } + return binary.LittleEndian.Uint32(data[1:5]) == requestFormatVersion +} diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go index 296407f38..e3b5ff1fc 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go @@ -4,6 +4,8 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" import ( + "context" + "google.golang.org/grpc/stats" "go.opentelemetry.io/otel" @@ -39,6 +41,9 @@ type config struct { SpanAttributes []attribute.KeyValue MetricAttributes []attribute.KeyValue + PublicEndpoint bool + PublicEndpointFn func(ctx context.Context, info *stats.RPCTagInfo) bool + ReceivedEvent bool SentEvent bool } @@ -61,6 +66,38 @@ func newConfig(opts []Option) *config { return c } +type publicEndpointOption struct{ p bool } + +func (o publicEndpointOption) apply(c *config) { + c.PublicEndpoint = o.p +} + +// WithPublicEndpoint configures the Handler to link the span with an incoming +// span context. If this option is not provided, then the association is a child +// association instead of a link. +func WithPublicEndpoint() Option { + return publicEndpointOption{p: true} +} + +type publicEndpointFnOption struct { + fn func(context.Context, *stats.RPCTagInfo) bool +} + +func (o publicEndpointFnOption) apply(c *config) { + if o.fn != nil { + c.PublicEndpointFn = o.fn + } +} + +// WithPublicEndpointFn runs with every request, and allows conditionally +// configuring the Handler to link the span with an incoming span context. If +// this option is not provided or returns false, then the association is a +// child association instead of a link. +// Note: WithPublicEndpoint takes precedence over WithPublicEndpointFn. +func WithPublicEndpointFn(fn func(context.Context, *stats.RPCTagInfo) bool) Option { + return publicEndpointFnOption{fn: fn} +} + type propagatorsOption struct{ p propagation.TextMapPropagator } func (o propagatorsOption) apply(c *config) { diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index f63513d45..7fc8193f6 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -4,7 +4,7 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" // gRPC tracing middleware -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md +// https://opentelemetry.io/docs/specs/semconv/rpc/ import ( "context" "errors" @@ -15,14 +15,13 @@ import ( "google.golang.org/grpc" grpc_codes "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" - "google.golang.org/grpc/peer" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.30.0" + semconv "go.opentelemetry.io/otel/semconv/v1.34.0" "go.opentelemetry.io/otel/trace" ) @@ -196,118 +195,11 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor { } } -// serverStream wraps around the embedded grpc.ServerStream, and intercepts the RecvMsg and -// SendMsg method call. -type serverStream struct { - grpc.ServerStream - ctx context.Context - - receivedMessageID int - sentMessageID int - - receivedEvent bool - sentEvent bool -} - -func (w *serverStream) Context() context.Context { - return w.ctx -} - -func (w *serverStream) RecvMsg(m interface{}) error { - err := w.ServerStream.RecvMsg(m) - - if err == nil { - w.receivedMessageID++ - if w.receivedEvent { - messageReceived.Event(w.Context(), w.receivedMessageID, m) - } - } - - return err -} - -func (w *serverStream) SendMsg(m interface{}) error { - err := w.ServerStream.SendMsg(m) - - w.sentMessageID++ - if w.sentEvent { - messageSent.Event(w.Context(), w.sentMessageID, m) - } - - return err -} - -func wrapServerStream(ctx context.Context, ss grpc.ServerStream, cfg *config) *serverStream { - return &serverStream{ - ServerStream: ss, - ctx: ctx, - receivedEvent: cfg.ReceivedEvent, - sentEvent: cfg.SentEvent, - } -} - -// StreamServerInterceptor returns a grpc.StreamServerInterceptor suitable -// for use in a grpc.NewServer call. -// -// Deprecated: Use [NewServerHandler] instead. -func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor { - cfg := newConfig(opts) - tracer := cfg.TracerProvider.Tracer( - ScopeName, - trace.WithInstrumentationVersion(Version()), - ) - - return func( - srv interface{}, - ss grpc.ServerStream, - info *grpc.StreamServerInfo, - handler grpc.StreamHandler, - ) error { - ctx := ss.Context() - i := &InterceptorInfo{ - StreamServerInfo: info, - Type: StreamServer, - } - if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) { - return handler(srv, wrapServerStream(ctx, ss, cfg)) - } - - ctx = extract(ctx, cfg.Propagators) - name, attr := telemetryAttributes(info.FullMethod, peerFromCtx(ctx)) - - startOpts := append([]trace.SpanStartOption{ - trace.WithSpanKind(trace.SpanKindServer), - trace.WithAttributes(attr...), - }, - cfg.SpanStartOptions..., - ) - - ctx, span := tracer.Start( - trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)), - name, - startOpts..., - ) - defer span.End() - - err := handler(srv, wrapServerStream(ctx, ss, cfg)) - if err != nil { - s, _ := status.FromError(err) - statusCode, msg := serverStatus(s) - span.SetStatus(statusCode, msg) - span.SetAttributes(statusCodeAttr(s.Code())) - } else { - span.SetAttributes(statusCodeAttr(grpc_codes.OK)) - } - - return err - } -} - // telemetryAttributes returns a span name and span and metric attributes from // the gRPC method and peer address. -func telemetryAttributes(fullMethod, sererAddr string) (string, []attribute.KeyValue) { +func telemetryAttributes(fullMethod, serverAddr string) (string, []attribute.KeyValue) { name, methodAttrs := internal.ParseFullMethod(fullMethod) - srvAttrs := serverAddrAttrs(sererAddr) + srvAttrs := serverAddrAttrs(serverAddr) attrs := make([]attribute.KeyValue, 0, 1+len(methodAttrs)+len(srvAttrs)) attrs = append(attrs, semconv.RPCSystemGRPC) @@ -333,15 +225,6 @@ func serverAddrAttrs(hostport string) []attribute.KeyValue { } } -// peerFromCtx returns a peer address from a context, if one exists. -func peerFromCtx(ctx context.Context) string { - p, ok := peer.FromContext(ctx) - if !ok { - return "" - } - return p.Addr.String() -} - // statusCodeAttr returns status code attribute based on given gRPC code. func statusCodeAttr(c grpc_codes.Code) attribute.KeyValue { return semconv.RPCGRPCStatusCodeKey.Int64(int64(c)) diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go index 1fa73c2f9..9b98644fe 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go @@ -8,7 +8,7 @@ import ( "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.30.0" + semconv "go.opentelemetry.io/otel/semconv/v1.34.0" ) // ParseFullMethod returns a span name following the OpenTelemetry semantic diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go index 9bec51df3..17404c8d7 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go @@ -17,8 +17,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/noop" - semconv "go.opentelemetry.io/otel/semconv/v1.30.0" + semconv "go.opentelemetry.io/otel/semconv/v1.34.0" + "go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal" @@ -38,11 +38,11 @@ type serverHandler struct { tracer trace.Tracer - duration metric.Float64Histogram - inSize metric.Int64Histogram - outSize metric.Int64Histogram - inMsg metric.Int64Histogram - outMsg metric.Int64Histogram + duration rpcconv.ServerDuration + inSize rpcconv.ServerRequestSize + outSize rpcconv.ServerResponseSize + inMsg rpcconv.ServerRequestsPerRPC + outMsg rpcconv.ServerResponsesPerRPC } // NewServerHandler creates a stats.Handler for a gRPC server. @@ -62,64 +62,29 @@ func NewServerHandler(opts ...Option) stats.Handler { ) var err error - h.duration, err = meter.Float64Histogram( - semconv.RPCServerDurationName, - metric.WithDescription(semconv.RPCServerDurationDescription), - metric.WithUnit(semconv.RPCServerDurationUnit), - ) + h.duration, err = rpcconv.NewServerDuration(meter) if err != nil { otel.Handle(err) - if h.duration == nil { - h.duration = noop.Float64Histogram{} - } } - h.inSize, err = meter.Int64Histogram( - semconv.RPCServerRequestSizeName, - metric.WithDescription(semconv.RPCServerRequestSizeDescription), - metric.WithUnit(semconv.RPCServerRequestSizeUnit), - ) + h.inSize, err = rpcconv.NewServerRequestSize(meter) if err != nil { otel.Handle(err) - if h.inSize == nil { - h.inSize = noop.Int64Histogram{} - } } - h.outSize, err = meter.Int64Histogram( - semconv.RPCServerResponseSizeName, - metric.WithDescription(semconv.RPCServerResponseSizeDescription), - metric.WithUnit(semconv.RPCServerResponseSizeUnit), - ) + h.outSize, err = rpcconv.NewServerResponseSize(meter) if err != nil { otel.Handle(err) - if h.outSize == nil { - h.outSize = noop.Int64Histogram{} - } } - h.inMsg, err = meter.Int64Histogram( - semconv.RPCServerRequestsPerRPCName, - metric.WithDescription(semconv.RPCServerRequestsPerRPCDescription), - metric.WithUnit(semconv.RPCServerRequestsPerRPCUnit), - ) + h.inMsg, err = rpcconv.NewServerRequestsPerRPC(meter) if err != nil { otel.Handle(err) - if h.inMsg == nil { - h.inMsg = noop.Int64Histogram{} - } } - h.outMsg, err = meter.Int64Histogram( - semconv.RPCServerResponsesPerRPCName, - metric.WithDescription(semconv.RPCServerResponsesPerRPCDescription), - metric.WithUnit(semconv.RPCServerResponsesPerRPCUnit), - ) + h.outMsg, err = rpcconv.NewServerResponsesPerRPC(meter) if err != nil { otel.Handle(err) - if h.outMsg == nil { - h.outMsg = noop.Int64Histogram{} - } } return h @@ -147,11 +112,21 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont } if record { + opts := []trace.SpanStartOption{ + trace.WithSpanKind(trace.SpanKindServer), + trace.WithAttributes(append(attrs, h.SpanAttributes...)...), + } + if h.PublicEndpoint || (h.PublicEndpointFn != nil && h.PublicEndpointFn(ctx, info)) { + opts = append(opts, trace.WithNewRoot()) + // Linking incoming span context if any for public endpoint. + if s := trace.SpanContextFromContext(ctx); s.IsValid() && s.IsRemote() { + opts = append(opts, trace.WithLinks(trace.Link{SpanContext: s})) + } + } ctx, _ = h.tracer.Start( trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)), name, - trace.WithSpanKind(trace.SpanKindServer), - trace.WithAttributes(append(attrs, h.SpanAttributes...)...), + opts..., ) } @@ -165,7 +140,16 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont // HandleRPC processes the RPC stats. func (h *serverHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { - h.handleRPC(ctx, rs, h.duration, h.inSize, h.outSize, h.inMsg, h.outMsg, serverStatus) + h.handleRPC( + ctx, + rs, + h.duration.Inst(), + h.inSize, + h.outSize, + h.inMsg.Inst(), + h.outMsg.Inst(), + serverStatus, + ) } type clientHandler struct { @@ -173,11 +157,11 @@ type clientHandler struct { tracer trace.Tracer - duration metric.Float64Histogram - inSize metric.Int64Histogram - outSize metric.Int64Histogram - inMsg metric.Int64Histogram - outMsg metric.Int64Histogram + duration rpcconv.ClientDuration + inSize rpcconv.ClientResponseSize + outSize rpcconv.ClientRequestSize + inMsg rpcconv.ClientResponsesPerRPC + outMsg rpcconv.ClientRequestsPerRPC } // NewClientHandler creates a stats.Handler for a gRPC client. @@ -197,64 +181,29 @@ func NewClientHandler(opts ...Option) stats.Handler { ) var err error - h.duration, err = meter.Float64Histogram( - semconv.RPCClientDurationName, - metric.WithDescription(semconv.RPCClientDurationDescription), - metric.WithUnit(semconv.RPCClientDurationUnit), - ) + h.duration, err = rpcconv.NewClientDuration(meter) if err != nil { otel.Handle(err) - if h.duration == nil { - h.duration = noop.Float64Histogram{} - } } - h.outSize, err = meter.Int64Histogram( - semconv.RPCClientRequestSizeName, - metric.WithDescription(semconv.RPCClientRequestSizeDescription), - metric.WithUnit(semconv.RPCClientRequestSizeUnit), - ) + h.inSize, err = rpcconv.NewClientResponseSize(meter) if err != nil { otel.Handle(err) - if h.outSize == nil { - h.outSize = noop.Int64Histogram{} - } } - h.inSize, err = meter.Int64Histogram( - semconv.RPCClientResponseSizeName, - metric.WithDescription(semconv.RPCClientResponseSizeDescription), - metric.WithUnit(semconv.RPCClientResponseSizeUnit), - ) + h.outSize, err = rpcconv.NewClientRequestSize(meter) if err != nil { otel.Handle(err) - if h.inSize == nil { - h.inSize = noop.Int64Histogram{} - } } - h.outMsg, err = meter.Int64Histogram( - semconv.RPCClientRequestsPerRPCName, - metric.WithDescription(semconv.RPCClientRequestsPerRPCDescription), - metric.WithUnit(semconv.RPCClientRequestsPerRPCUnit), - ) + h.inMsg, err = rpcconv.NewClientResponsesPerRPC(meter) if err != nil { otel.Handle(err) - if h.outMsg == nil { - h.outMsg = noop.Int64Histogram{} - } } - h.inMsg, err = meter.Int64Histogram( - semconv.RPCClientResponsesPerRPCName, - metric.WithDescription(semconv.RPCClientResponsesPerRPCDescription), - metric.WithUnit(semconv.RPCClientResponsesPerRPCUnit), - ) + h.outMsg, err = rpcconv.NewClientRequestsPerRPC(meter) if err != nil { otel.Handle(err) - if h.inMsg == nil { - h.inMsg = noop.Int64Histogram{} - } } return h @@ -290,7 +239,13 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont // HandleRPC processes the RPC stats. func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { h.handleRPC( - ctx, rs, h.duration, h.inSize, h.outSize, h.inMsg, h.outMsg, + ctx, + rs, + h.duration.Inst(), + h.inSize, + h.outSize, + h.inMsg.Inst(), + h.outMsg.Inst(), func(s *status.Status) (codes.Code, string) { return codes.Error, s.Message() }, @@ -307,11 +262,16 @@ func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) { // no-op } +type int64Hist interface { + Record(context.Context, int64, ...attribute.KeyValue) +} + func (c *config) handleRPC( ctx context.Context, rs stats.RPCStats, duration metric.Float64Histogram, - inSize, outSize, inMsg, outMsg metric.Int64Histogram, + inSize, outSize int64Hist, + inMsg, outMsg metric.Int64Histogram, recordStatus func(*status.Status) (codes.Code, string), ) { gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext) @@ -327,7 +287,7 @@ func (c *config) handleRPC( case *stats.InPayload: if gctx != nil { messageId = atomic.AddInt64(&gctx.inMessages, 1) - inSize.Record(ctx, int64(rs.Length), metric.WithAttributes(gctx.metricAttrs...)) + inSize.Record(ctx, int64(rs.Length), gctx.metricAttrs...) } if c.ReceivedEvent && span.IsRecording() { @@ -343,7 +303,7 @@ func (c *config) handleRPC( case *stats.OutPayload: if gctx != nil { messageId = atomic.AddInt64(&gctx.outMessages, 1) - outSize.Record(ctx, int64(rs.Length), metric.WithAttributes(gctx.metricAttrs...)) + outSize.Record(ctx, int64(rs.Length), gctx.metricAttrs...) } if c.SentEvent && span.IsRecording() { diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go index b1feeca49..8849d79b8 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go @@ -5,6 +5,6 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.g // Version is the current release version of the gRPC instrumentation. func Version() string { - return "0.61.0" + return "0.62.0" // This string is updated by the pre_release.sh script during release } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go index 7cb9693d9..7edc8d10f 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go @@ -17,6 +17,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/semconv/v1.34.0/httpconv" ) // OTelSemConvStabilityOptIn is an environment variable. @@ -40,9 +41,9 @@ type HTTPServer struct { serverLatencyMeasure metric.Float64Histogram // New metrics - requestBodySizeHistogram metric.Int64Histogram - responseBodySizeHistogram metric.Int64Histogram - requestDurationHistogram metric.Float64Histogram + requestBodySizeHistogram httpconv.ServerRequestBodySize + responseBodySizeHistogram httpconv.ServerResponseBodySize + requestDurationHistogram httpconv.ServerRequestDuration } // RequestTraceAttrs returns trace attributes for an HTTP request received by a @@ -146,17 +147,15 @@ var ( ) func (s HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { - if s.requestDurationHistogram != nil && s.requestBodySizeHistogram != nil && s.responseBodySizeHistogram != nil { - attributes := CurrentHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes) - o := metric.WithAttributeSet(attribute.NewSet(attributes...)) - recordOpts := metricRecordOptionPool.Get().(*[]metric.RecordOption) - *recordOpts = append(*recordOpts, o) - s.requestBodySizeHistogram.Record(ctx, md.RequestSize, *recordOpts...) - s.responseBodySizeHistogram.Record(ctx, md.ResponseSize, *recordOpts...) - s.requestDurationHistogram.Record(ctx, md.ElapsedTime/1000.0, o) - *recordOpts = (*recordOpts)[:0] - metricRecordOptionPool.Put(recordOpts) - } + attributes := CurrentHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes) + o := metric.WithAttributeSet(attribute.NewSet(attributes...)) + recordOpts := metricRecordOptionPool.Get().(*[]metric.RecordOption) + *recordOpts = append(*recordOpts, o) + s.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...) + s.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...) + s.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o) + *recordOpts = (*recordOpts)[:0] + metricRecordOptionPool.Put(recordOpts) if s.duplicate && s.requestBytesCounter != nil && s.responseBytesCounter != nil && s.serverLatencyMeasure != nil { attributes := OldHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes) @@ -188,7 +187,23 @@ func NewHTTPServer(meter metric.Meter) HTTPServer { server := HTTPServer{ duplicate: duplicate, } - server.requestBodySizeHistogram, server.responseBodySizeHistogram, server.requestDurationHistogram = CurrentHTTPServer{}.createMeasures(meter) + + var err error + server.requestBodySizeHistogram, err = httpconv.NewServerRequestBodySize(meter) + handleErr(err) + + server.responseBodySizeHistogram, err = httpconv.NewServerResponseBodySize(meter) + handleErr(err) + + server.requestDurationHistogram, err = httpconv.NewServerRequestDuration( + meter, + metric.WithExplicitBucketBoundaries( + 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, + 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, + ), + ) + handleErr(err) + if duplicate { server.requestBytesCounter, server.responseBytesCounter, server.serverLatencyMeasure = OldHTTPServer{}.createMeasures(meter) } @@ -204,8 +219,8 @@ type HTTPClient struct { latencyMeasure metric.Float64Histogram // new metrics - requestBodySize metric.Int64Histogram - requestDuration metric.Float64Histogram + requestBodySize httpconv.ClientRequestBodySize + requestDuration httpconv.ClientRequestDuration } func NewHTTPClient(meter metric.Meter) HTTPClient { @@ -214,7 +229,17 @@ func NewHTTPClient(meter metric.Meter) HTTPClient { client := HTTPClient{ duplicate: duplicate, } - client.requestBodySize, client.requestDuration = CurrentHTTPClient{}.createMeasures(meter) + + var err error + client.requestBodySize, err = httpconv.NewClientRequestBodySize(meter) + handleErr(err) + + client.requestDuration, err = httpconv.NewClientRequestDuration( + meter, + metric.WithExplicitBucketBoundaries(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10), + ) + handleErr(err) + if duplicate { client.requestBytesCounter, client.responseBytesCounter, client.latencyMeasure = OldHTTPClient{}.createMeasures(meter) } @@ -290,13 +315,8 @@ func (c HTTPClient) MetricOptions(ma MetricAttributes) map[string]MetricOpts { } func (s HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts map[string]MetricOpts) { - if s.requestBodySize == nil || s.requestDuration == nil { - // This will happen if an HTTPClient{} is used instead of NewHTTPClient(). - return - } - - s.requestBodySize.Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) - s.requestDuration.Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) + s.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) + s.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) if s.duplicate { s.requestBytesCounter.Add(ctx, md.RequestSize, opts["old"].AddOptions()) diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go index f2cf8a152..b4036dd90 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go @@ -5,10 +5,12 @@ package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/ // Generate semconv package: //go:generate gotmpl --body=../../../../../../internal/shared/semconv/bench_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=bench_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/common_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=common_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/env.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=env.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/env_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=env_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconv.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconv_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconvtest_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconvtest_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/util.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=util.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/util_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=util_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/v1.20.0.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=v1.20.0.go diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go index 53976b0d5..9766f3ac8 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go @@ -17,9 +17,7 @@ import ( "strings" "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/noop" - semconvNew "go.opentelemetry.io/otel/semconv/v1.26.0" + semconvNew "go.opentelemetry.io/otel/semconv/v1.34.0" ) type RequestTraceAttrsOpts struct { @@ -247,36 +245,6 @@ func (n CurrentHTTPServer) Route(route string) attribute.KeyValue { return semconvNew.HTTPRoute(route) } -func (n CurrentHTTPServer) createMeasures(meter metric.Meter) (metric.Int64Histogram, metric.Int64Histogram, metric.Float64Histogram) { - if meter == nil { - return noop.Int64Histogram{}, noop.Int64Histogram{}, noop.Float64Histogram{} - } - - var err error - requestBodySizeHistogram, err := meter.Int64Histogram( - semconvNew.HTTPServerRequestBodySizeName, - metric.WithUnit(semconvNew.HTTPServerRequestBodySizeUnit), - metric.WithDescription(semconvNew.HTTPServerRequestBodySizeDescription), - ) - handleErr(err) - - responseBodySizeHistogram, err := meter.Int64Histogram( - semconvNew.HTTPServerResponseBodySizeName, - metric.WithUnit(semconvNew.HTTPServerResponseBodySizeUnit), - metric.WithDescription(semconvNew.HTTPServerResponseBodySizeDescription), - ) - handleErr(err) - requestDurationHistogram, err := meter.Float64Histogram( - semconvNew.HTTPServerRequestDurationName, - metric.WithUnit(semconvNew.HTTPServerRequestDurationUnit), - metric.WithDescription(semconvNew.HTTPServerRequestDurationDescription), - metric.WithExplicitBucketBoundaries(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10), - ) - handleErr(err) - - return requestBodySizeHistogram, responseBodySizeHistogram, requestDurationHistogram -} - func (n CurrentHTTPServer) MetricAttributes(server string, req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { num := len(additionalAttributes) + 3 var host string @@ -472,30 +440,6 @@ func (n CurrentHTTPClient) method(method string) (attribute.KeyValue, attribute. return semconvNew.HTTPRequestMethodGet, orig } -func (n CurrentHTTPClient) createMeasures(meter metric.Meter) (metric.Int64Histogram, metric.Float64Histogram) { - if meter == nil { - return noop.Int64Histogram{}, noop.Float64Histogram{} - } - - var err error - requestBodySize, err := meter.Int64Histogram( - semconvNew.HTTPClientRequestBodySizeName, - metric.WithUnit(semconvNew.HTTPClientRequestBodySizeUnit), - metric.WithDescription(semconvNew.HTTPClientRequestBodySizeDescription), - ) - handleErr(err) - - requestDuration, err := meter.Float64Histogram( - semconvNew.HTTPClientRequestDurationName, - metric.WithUnit(semconvNew.HTTPClientRequestDurationUnit), - metric.WithDescription(semconvNew.HTTPClientRequestDurationDescription), - metric.WithExplicitBucketBoundaries(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10), - ) - handleErr(err) - - return requestBodySize, requestDuration -} - func (n CurrentHTTPClient) MetricAttributes(req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { num := len(additionalAttributes) + 2 var h string diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go index bc1f7751d..e4ebf8581 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go @@ -14,7 +14,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - semconvNew "go.opentelemetry.io/otel/semconv/v1.26.0" + semconvNew "go.opentelemetry.io/otel/semconv/v1.34.0" ) // SplitHostPort splits a network address hostport of the form "host", diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go index 44b86ad86..e4c02a429 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go @@ -129,6 +129,41 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header)) res, err := t.rt.RoundTrip(r) + + // Defer metrics recording function to record the metrics on error or no error. + defer func() { + metricAttributes := semconv.MetricAttributes{ + Req: r, + AdditionalAttributes: append(labeler.Get(), t.metricAttributesFromRequest(r)...), + } + + if err == nil { + metricAttributes.StatusCode = res.StatusCode + } + + metricOpts := t.semconv.MetricOptions(metricAttributes) + + metricData := semconv.MetricData{ + RequestSize: bw.BytesRead(), + } + + if err == nil { + // For handling response bytes we leverage a callback when the client reads the http response + readRecordFunc := func(n int64) { + t.semconv.RecordResponseSize(ctx, n, metricOpts) + } + + res.Body = newWrappedBody(span, readRecordFunc, res.Body) + } + + // Use floating point division here for higher precision (instead of Millisecond method). + elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) + + metricData.ElapsedTime = elapsedTime + + t.semconv.RecordMetrics(ctx, metricData, metricOpts) + }() + if err != nil { // set error type attribute if the error is part of the predefined // error types. @@ -141,35 +176,14 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { span.SetStatus(codes.Error, err.Error()) span.End() - return res, err - } - // metrics - metricOpts := t.semconv.MetricOptions(semconv.MetricAttributes{ - Req: r, - StatusCode: res.StatusCode, - AdditionalAttributes: append(labeler.Get(), t.metricAttributesFromRequest(r)...), - }) - - // For handling response bytes we leverage a callback when the client reads the http response - readRecordFunc := func(n int64) { - t.semconv.RecordResponseSize(ctx, n, metricOpts) + return res, err } // traces span.SetAttributes(t.semconv.ResponseTraceAttrs(res)...) span.SetStatus(t.semconv.Status(res.StatusCode)) - res.Body = newWrappedBody(span, readRecordFunc, res.Body) - - // Use floating point division here for higher precision (instead of Millisecond method). - elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) - - t.semconv.RecordMetrics(ctx, semconv.MetricData{ - RequestSize: bw.BytesRead(), - ElapsedTime: elapsedTime, - }, metricOpts) - return res, nil } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go index 6be4c1fde..2fe5a1361 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go @@ -5,6 +5,6 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http // Version is the current release version of the otelhttp instrumentation. func Version() string { - return "0.61.0" + return "0.62.0" // This string is updated by the pre_release.sh script during release } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/MIGRATION.md b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/MIGRATION.md deleted file mode 100644 index 8a11ea28d..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/MIGRATION.md +++ /dev/null @@ -1,155 +0,0 @@ -# Semantic Convention Changes - -The `go.opentelemetry.io/otel/semconv/v1.30.0` should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.28.0` with the following exceptions. - -Note: `go.opentelemetry.io/otel/semconv/v1.29.0` does not exist due to bugs from the upstream [OpenTelemetry Semantic Conventions]. - -## Dropped deprecations - -The following declarations have been deprecated in the [OpenTelemetry Semantic Conventions]. -Refer to the respective documentation in that repository for deprecation instructions for each type. - -- `CodeColumn` -- `CodeColumnKey` -- `CodeFunction` -- `CodeFunctionKey` -- `DBCassandraConsistencyLevelAll` -- `DBCassandraConsistencyLevelAny` -- `DBCassandraConsistencyLevelEachQuorum` -- `DBCassandraConsistencyLevelKey` -- `DBCassandraConsistencyLevelLocalOne` -- `DBCassandraConsistencyLevelLocalQuorum` -- `DBCassandraConsistencyLevelLocalSerial` -- `DBCassandraConsistencyLevelOne` -- `DBCassandraConsistencyLevelQuorum` -- `DBCassandraConsistencyLevelSerial` -- `DBCassandraConsistencyLevelThree` -- `DBCassandraConsistencyLevelTwo` -- `DBCassandraCoordinatorDC` -- `DBCassandraCoordinatorDCKey` -- `DBCassandraCoordinatorID` -- `DBCassandraCoordinatorIDKey` -- `DBCassandraIdempotence` -- `DBCassandraIdempotenceKey` -- `DBCassandraPageSize` -- `DBCassandraPageSizeKey` -- `DBCassandraSpeculativeExecutionCount` -- `DBCassandraSpeculativeExecutionCountKey` -- `DBCosmosDBClientID` -- `DBCosmosDBClientIDKey` -- `DBCosmosDBConnectionModeDirect` -- `DBCosmosDBConnectionModeGateway` -- `DBCosmosDBConnectionModeKey` -- `DBCosmosDBOperationTypeBatch` -- `DBCosmosDBOperationTypeCreate` -- `DBCosmosDBOperationTypeDelete` -- `DBCosmosDBOperationTypeExecute` -- `DBCosmosDBOperationTypeExecuteJavascript` -- `DBCosmosDBOperationTypeHead` -- `DBCosmosDBOperationTypeHeadFeed` -- `DBCosmosDBOperationTypeInvalid` -- `DBCosmosDBOperationTypeKey` -- `DBCosmosDBOperationTypePatch` -- `DBCosmosDBOperationTypeQuery` -- `DBCosmosDBOperationTypeQueryPlan` -- `DBCosmosDBOperationTypeRead` -- `DBCosmosDBOperationTypeReadFeed` -- `DBCosmosDBOperationTypeReplace` -- `DBCosmosDBOperationTypeUpsert` -- `DBCosmosDBRequestCharge` -- `DBCosmosDBRequestChargeKey` -- `DBCosmosDBRequestContentLength` -- `DBCosmosDBRequestContentLengthKey` -- `DBCosmosDBSubStatusCode` -- `DBCosmosDBSubStatusCodeKey` -- `DBElasticsearchNodeName` -- `DBElasticsearchNodeNameKey` -- `DBSystemAdabas` -- `DBSystemCache` -- `DBSystemCassandra` -- `DBSystemClickhouse` -- `DBSystemCloudscape` -- `DBSystemCockroachdb` -- `DBSystemColdfusion` -- `DBSystemCosmosDB` -- `DBSystemCouchDB` -- `DBSystemCouchbase` -- `DBSystemDb2` -- `DBSystemDerby` -- `DBSystemDynamoDB` -- `DBSystemEDB` -- `DBSystemElasticsearch` -- `DBSystemFilemaker` -- `DBSystemFirebird` -- `DBSystemFirstSQL` -- `DBSystemGeode` -- `DBSystemH2` -- `DBSystemHBase` -- `DBSystemHSQLDB` -- `DBSystemHanaDB` -- `DBSystemHive` -- `DBSystemInfluxdb` -- `DBSystemInformix` -- `DBSystemIngres` -- `DBSystemInstantDB` -- `DBSystemInterbase` -- `DBSystemIntersystemsCache` -- `DBSystemKey` -- `DBSystemMSSQL` -- `DBSystemMariaDB` -- `DBSystemMaxDB` -- `DBSystemMemcached` -- `DBSystemMongoDB` -- `DBSystemMssqlcompact` -- `DBSystemMySQL` -- `DBSystemNeo4j` -- `DBSystemNetezza` -- `DBSystemOpensearch` -- `DBSystemOracle` -- `DBSystemOtherSQL` -- `DBSystemPervasive` -- `DBSystemPointbase` -- `DBSystemPostgreSQL` -- `DBSystemProgress` -- `DBSystemRedis` -- `DBSystemRedshift` -- `DBSystemSpanner` -- `DBSystemSqlite` -- `DBSystemSybase` -- `DBSystemTeradata` -- `DBSystemTrino` -- `DBSystemVertica` -- `EventName` -- `EventNameKey` -- `ExceptionEscaped` -- `ExceptionEscapedKey` -- `GenAIOpenaiRequestSeed` -- `GenAIOpenaiRequestSeedKey` -- `ProcessExecutableBuildIDProfiling` -- `ProcessExecutableBuildIDProfilingKey` -- `SystemNetworkStateClose` -- `SystemNetworkStateCloseWait` -- `SystemNetworkStateClosing` -- `SystemNetworkStateDelete` -- `SystemNetworkStateEstablished` -- `SystemNetworkStateFinWait1` -- `SystemNetworkStateFinWait2` -- `SystemNetworkStateKey` -- `SystemNetworkStateLastAck` -- `SystemNetworkStateListen` -- `SystemNetworkStateSynRecv` -- `SystemNetworkStateSynSent` -- `SystemNetworkStateTimeWait` -- `VCSRepositoryChangeID` -- `VCSRepositoryChangeIDKey` -- `VCSRepositoryChangeTitle` -- `VCSRepositoryChangeTitleKey` -- `VCSRepositoryRefName` -- `VCSRepositoryRefNameKey` -- `VCSRepositoryRefRevision` -- `VCSRepositoryRefRevisionKey` -- `VCSRepositoryRefTypeBranch` -- `VCSRepositoryRefTypeKey` -- `VCSRepositoryRefTypeTag` - -[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/README.md deleted file mode 100644 index 072ea6928..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semconv v1.30.0 - -[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.30.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.30.0) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/attribute_group.go deleted file mode 100644 index 60f3df0db..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/attribute_group.go +++ /dev/null @@ -1,12333 +0,0 @@ -// 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.30.0" - -import "go.opentelemetry.io/otel/attribute" - -// Namespace: android -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]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "33", "32" - // - // [here]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels - 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]. -// -// [here]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels -func AndroidOSAPILevel(val string) attribute.KeyValue { - return AndroidOSAPILevelKey.String(val) -} - -// Namespace: artifact -const ( - // ArtifactAttestationFilenameKey is the attribute Key conforming to the - // "artifact.attestation.filename" semantic conventions. It represents the - // provenance filename of the built attestation which directly relates to the - // build artifact filename. This filename SHOULD accompany the artifact at - // publish time. See the [SLSA Relationship] specification for more information. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "golang-binary-amd64-v0.1.0.attestation", - // "docker-image-amd64-v0.1.0.intoto.json1", "release-1.tar.gz.attestation", - // "file-name-package.tar.gz.intoto.json1" - // - // [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations - ArtifactAttestationFilenameKey = attribute.Key("artifact.attestation.filename") - - // ArtifactAttestationHashKey is the attribute Key conforming to the - // "artifact.attestation.hash" semantic conventions. It represents the full - // [hash value (see glossary)], of the built attestation. Some envelopes in the - // [software attestation space] also refer to this as the **digest**. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1b31dfcd5b7f9267bf2ff47651df1cfb9147b9e4df1f335accf65b4cda498408" - // - // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf - // [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec - ArtifactAttestationHashKey = attribute.Key("artifact.attestation.hash") - - // ArtifactAttestationIDKey is the attribute Key conforming to the - // "artifact.attestation.id" semantic conventions. It represents the id of the - // build [software attestation]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "123" - // - // [software attestation]: https://slsa.dev/attestation-model - ArtifactAttestationIDKey = attribute.Key("artifact.attestation.id") - - // ArtifactFilenameKey is the attribute Key conforming to the - // "artifact.filename" semantic conventions. It represents the human readable - // file name of the artifact, typically generated during build and release - // processes. Often includes the package name and version in the file name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "golang-binary-amd64-v0.1.0", "docker-image-amd64-v0.1.0", - // "release-1.tar.gz", "file-name-package.tar.gz" - // Note: This file name can also act as the [Package Name] - // in cases where the package ecosystem maps accordingly. - // Additionally, the artifact [can be published] - // for others, but that is not a guarantee. - // - // [Package Name]: https://slsa.dev/spec/v1.0/terminology#package-model - // [can be published]: https://slsa.dev/spec/v1.0/terminology#software-supply-chain - ArtifactFilenameKey = attribute.Key("artifact.filename") - - // ArtifactHashKey is the attribute Key conforming to the "artifact.hash" - // semantic conventions. It represents the full [hash value (see glossary)], - // often found in checksum.txt on a release of the artifact and used to verify - // package integrity. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9" - // Note: The specific algorithm used to create the cryptographic hash value is - // not defined. In situations where an artifact has multiple - // cryptographic hashes, it is up to the implementer to choose which - // hash value to set here; this should be the most secure hash algorithm - // that is suitable for the situation and consistent with the - // corresponding attestation. The implementer can then provide the other - // hash values through an additional set of attribute extensions as they - // deem necessary. - // - // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf - ArtifactHashKey = attribute.Key("artifact.hash") - - // ArtifactPurlKey is the attribute Key conforming to the "artifact.purl" - // semantic conventions. It represents the [Package URL] of the - // [package artifact] provides a standard way to identify and locate the - // packaged artifact. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "pkg:github/package-url/purl-spec@1209109710924", - // "pkg:npm/foo@12.12.3" - // - // [Package URL]: https://github.com/package-url/purl-spec - // [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model - ArtifactPurlKey = attribute.Key("artifact.purl") - - // ArtifactVersionKey is the attribute Key conforming to the "artifact.version" - // semantic conventions. It represents the version of the artifact. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "v0.1.0", "1.2.1", "122691-build" - ArtifactVersionKey = attribute.Key("artifact.version") -) - -// ArtifactAttestationFilename returns an attribute KeyValue conforming to the -// "artifact.attestation.filename" semantic conventions. It represents the -// provenance filename of the built attestation which directly relates to the -// build artifact filename. This filename SHOULD accompany the artifact at -// publish time. See the [SLSA Relationship] specification for more information. -// -// [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations -func ArtifactAttestationFilename(val string) attribute.KeyValue { - return ArtifactAttestationFilenameKey.String(val) -} - -// ArtifactAttestationHash returns an attribute KeyValue conforming to the -// "artifact.attestation.hash" semantic conventions. It represents the full -// [hash value (see glossary)], of the built attestation. Some envelopes in the -// [software attestation space] also refer to this as the **digest**. -// -// [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf -// [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec -func ArtifactAttestationHash(val string) attribute.KeyValue { - return ArtifactAttestationHashKey.String(val) -} - -// ArtifactAttestationID returns an attribute KeyValue conforming to the -// "artifact.attestation.id" semantic conventions. It represents the id of the -// build [software attestation]. -// -// [software attestation]: https://slsa.dev/attestation-model -func ArtifactAttestationID(val string) attribute.KeyValue { - return ArtifactAttestationIDKey.String(val) -} - -// ArtifactFilename returns an attribute KeyValue conforming to the -// "artifact.filename" semantic conventions. It represents the human readable -// file name of the artifact, typically generated during build and release -// processes. Often includes the package name and version in the file name. -func ArtifactFilename(val string) attribute.KeyValue { - return ArtifactFilenameKey.String(val) -} - -// ArtifactHash returns an attribute KeyValue conforming to the "artifact.hash" -// semantic conventions. It represents the full [hash value (see glossary)], -// often found in checksum.txt on a release of the artifact and used to verify -// package integrity. -// -// [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf -func ArtifactHash(val string) attribute.KeyValue { - return ArtifactHashKey.String(val) -} - -// ArtifactPurl returns an attribute KeyValue conforming to the "artifact.purl" -// semantic conventions. It represents the [Package URL] of the -// [package artifact] provides a standard way to identify and locate the packaged -// artifact. -// -// [Package URL]: https://github.com/package-url/purl-spec -// [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model -func ArtifactPurl(val string) attribute.KeyValue { - return ArtifactPurlKey.String(val) -} - -// ArtifactVersion returns an attribute KeyValue conforming to the -// "artifact.version" semantic conventions. It represents the version of the -// artifact. -func ArtifactVersion(val string) attribute.KeyValue { - return ArtifactVersionKey.String(val) -} - -// Namespace: aws -const ( - // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to the - // "aws.dynamodb.attribute_definitions" semantic conventions. It represents the - // JSON-serialized value of each item in the `AttributeDefinitions` request - // field. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "{ "AttributeName": "string", "AttributeType": "string" }" - AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") - - // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the - // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the - // value of the `AttributesToGet` request parameter. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "lives", "id" - AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") - - // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the - // "aws.dynamodb.consistent_read" semantic conventions. It represents the value - // of the `ConsistentRead` request parameter. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") - - // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the - // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the - // JSON-serialized value of each item in the `ConsumedCapacity` response field. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : - // { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": - // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, - // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, - // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, - // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": - // "string", "WriteCapacityUnits": number }" - AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") - - // AWSDynamoDBCountKey is the attribute Key conforming to the - // "aws.dynamodb.count" semantic conventions. It represents the value of the - // `Count` response parameter. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 10 - AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") - - // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the - // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the - // value of the `ExclusiveStartTableName` request parameter. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Users", "CatsTable" - AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") - - // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key conforming to - // the "aws.dynamodb.global_secondary_index_updates" semantic conventions. It - // represents the JSON-serialized value of each item in the - // `GlobalSecondaryIndexUpdates` request field. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "{ "Create": { "IndexName": "string", "KeySchema": [ { - // "AttributeName": "string", "KeyType": "string" } ], "Projection": { - // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, - // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": - // number } }" - AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") - - // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to the - // "aws.dynamodb.global_secondary_indexes" semantic conventions. It represents - // the JSON-serialized value of each item of the `GlobalSecondaryIndexes` - // request field. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "{ "IndexName": "string", "KeySchema": [ { "AttributeName": - // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ - // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { - // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }" - AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") - - // AWSDynamoDBIndexNameKey is the attribute Key conforming to the - // "aws.dynamodb.index_name" semantic conventions. It represents the value of - // the `IndexName` request parameter. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "name_to_group" - AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") - - // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to the - // "aws.dynamodb.item_collection_metrics" semantic conventions. It represents - // the JSON-serialized value of the `ItemCollectionMetrics` response field. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, - // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : - // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": - // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }" - AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") - - // AWSDynamoDBLimitKey is the attribute Key conforming to the - // "aws.dynamodb.limit" semantic conventions. It represents the value of the - // `Limit` request parameter. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 10 - AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") - - // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to the - // "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents - // the JSON-serialized value of each item of the `LocalSecondaryIndexes` request - // field. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": - // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", - // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], - // "ProjectionType": "string" } }" - AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") - - // AWSDynamoDBProjectionKey is the attribute Key conforming to the - // "aws.dynamodb.projection" semantic conventions. It represents the value of - // the `ProjectionExpression` request parameter. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Title", "Title, Price, Color", "Title, Description, RelatedItems, - // ProductReviews" - AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") - - // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to the - // "aws.dynamodb.provisioned_read_capacity" semantic conventions. It represents - // the value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") - - // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming to the - // "aws.dynamodb.provisioned_write_capacity" semantic conventions. It represents - // the value of the `ProvisionedThroughput.WriteCapacityUnits` request - // parameter. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") - - // AWSDynamoDBScanForwardKey is the attribute Key conforming to the - // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of - // the `ScanIndexForward` request parameter. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") - - // AWSDynamoDBScannedCountKey is the attribute Key conforming to the - // "aws.dynamodb.scanned_count" semantic conventions. It represents the value of - // the `ScannedCount` response parameter. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 50 - AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") - - // AWSDynamoDBSegmentKey is the attribute Key conforming to the - // "aws.dynamodb.segment" semantic conventions. It represents the value of the - // `Segment` request parameter. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 10 - AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") - - // AWSDynamoDBSelectKey is the attribute Key conforming to the - // "aws.dynamodb.select" semantic conventions. It represents the value of the - // `Select` request parameter. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "ALL_ATTRIBUTES", "COUNT" - AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") - - // AWSDynamoDBTableCountKey is the attribute Key conforming to the - // "aws.dynamodb.table_count" semantic conventions. It represents the number of - // items in the `TableNames` response parameter. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 20 - AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") - - // AWSDynamoDBTableNamesKey is the attribute Key conforming to the - // "aws.dynamodb.table_names" semantic conventions. It represents the keys in - // the `RequestItems` object field. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Users", "Cats" - AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") - - // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the - // "aws.dynamodb.total_segments" semantic conventions. It represents the value - // of the `TotalSegments` request parameter. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 100 - AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") - - // AWSECSClusterARNKey is the attribute Key conforming to the - // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an - // [ECS cluster]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster" - // - // [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html - 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]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9" - // - // [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html - 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] - // for an ECS task. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [launch type]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html - 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 a running [ECS task]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b", - // "arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd" - // - // [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids - AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") - - // AWSECSTaskFamilyKey is the attribute Key conforming to the - // "aws.ecs.task.family" semantic conventions. It represents the family name of - // the [ECS task definition] used to create the ECS task. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry-family" - // - // [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html - AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") - - // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id" - // semantic conventions. It represents the ID of a running ECS task. The ID MUST - // be extracted from `task.arn`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "10838bed-421f-43ef-870a-f43feacbbb5b", - // "23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd" - AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id") - - // AWSECSTaskRevisionKey is the attribute Key conforming to the - // "aws.ecs.task.revision" semantic conventions. It represents the revision for - // the task definition used to create the ECS task. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "8", "26" - AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") - - // 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: Recommended - // Stability: Development - // - // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster" - AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") - - // AWSExtendedRequestIDKey is the attribute Key conforming to the - // "aws.extended_request_id" semantic conventions. It represents the AWS - // extended request ID as returned in the response header `x-amz-id-2`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ=" - AWSExtendedRequestIDKey = attribute.Key("aws.extended_request_id") - - // AWSLambdaInvokedARNKey is the attribute Key conforming to the - // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked - // ARN as provided on the `Context` passed to the function ( - // `Lambda-Runtime-Invoked-Function-Arn` header on the - // `/runtime/invocation/next` applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "arn:aws:lambda:us-east-1:123456:function:myfunction:myalias" - // Note: This may be different from `cloud.resource_id` if an alias is involved. - AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") - - // 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: Recommended - // Stability: Development - // - // Examples: "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*" - // Note: See the [log group ARN format documentation]. - // - // [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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // 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]. One log group can - // contain several log streams, so these ARNs necessarily identify both a log - // group and a log stream. - // - // [log stream ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format - 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: Recommended - // Stability: Development - // - // Examples: "logs/main/10838bed-421f-43ef-870a-f43feacbbb5b" - AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") - - // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" - // semantic conventions. It represents the AWS request ID as returned in the - // response headers `x-amzn-requestid`, `x-amzn-request-id` or - // `x-amz-request-id`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "79b9da39-b7ae-508a-a6bc-864b2829c622", "C9ER4AJX75574TDJ" - AWSRequestIDKey = attribute.Key("aws.request_id") - - // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" - // semantic conventions. It represents the S3 bucket name the request refers to. - // Corresponds to the `--bucket` parameter of the [S3 API] operations. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "some-bucket-name" - // Note: The `bucket` attribute is applicable to all S3 operations that - // reference a bucket, i.e. that require the bucket name as a mandatory - // parameter. - // This applies to almost all S3 operations except `list-buckets`. - // - // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html - AWSS3BucketKey = attribute.Key("aws.s3.bucket") - - // AWSS3CopySourceKey is the attribute Key conforming to the - // "aws.s3.copy_source" semantic conventions. It represents the source object - // (in the form `bucket`/`key`) for the copy operation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "someFile.yml" - // Note: The `copy_source` attribute applies to S3 copy operations and - // corresponds to the `--copy-source` parameter - // of the [copy-object operation within the S3 API]. - // This applies in particular to the following operations: - // - // - [copy-object] - // - [upload-part-copy] - // - // - // [copy-object operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html - // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html - // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html - AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") - - // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" - // semantic conventions. It represents the delete request container that - // specifies the objects to be deleted. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean" - // Note: The `delete` attribute is only applicable to the [delete-object] - // operation. - // The `delete` attribute corresponds to the `--delete` parameter of the - // [delete-objects operation within the S3 API]. - // - // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html - // [delete-objects operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html - AWSS3DeleteKey = attribute.Key("aws.s3.delete") - - // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic - // conventions. It represents the S3 object key the request refers to. - // Corresponds to the `--key` parameter of the [S3 API] operations. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "someFile.yml" - // Note: The `key` attribute is applicable to all object-related S3 operations, - // i.e. that require the object key as a mandatory parameter. - // This applies in particular to the following operations: - // - // - [copy-object] - // - [delete-object] - // - [get-object] - // - [head-object] - // - [put-object] - // - [restore-object] - // - [select-object-content] - // - [abort-multipart-upload] - // - [complete-multipart-upload] - // - [create-multipart-upload] - // - [list-parts] - // - [upload-part] - // - [upload-part-copy] - // - // - // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html - // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html - // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html - // [get-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html - // [head-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html - // [put-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html - // [restore-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html - // [select-object-content]: https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html - // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html - // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html - // [create-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html - // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html - // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html - // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html - AWSS3KeyKey = attribute.Key("aws.s3.key") - - // AWSS3PartNumberKey is the attribute Key conforming to the - // "aws.s3.part_number" semantic conventions. It represents the part number of - // the part being uploaded in a multipart-upload operation. This is a positive - // integer between 1 and 10,000. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 3456 - // Note: The `part_number` attribute is only applicable to the [upload-part] - // and [upload-part-copy] operations. - // The `part_number` attribute corresponds to the `--part-number` parameter of - // the - // [upload-part operation within the S3 API]. - // - // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html - // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html - // [upload-part operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html - AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") - - // AWSS3UploadIDKey is the attribute Key conforming to the "aws.s3.upload_id" - // semantic conventions. It represents the upload ID that identifies the - // multipart upload. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ" - // Note: The `upload_id` attribute applies to S3 multipart-upload operations and - // corresponds to the `--upload-id` parameter - // of the [S3 API] multipart operations. - // This applies in particular to the following operations: - // - // - [abort-multipart-upload] - // - [complete-multipart-upload] - // - [list-parts] - // - [upload-part] - // - [upload-part-copy] - // - // - // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html - // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html - // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html - // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html - // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html - // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html - AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") -) - -// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming to -// the "aws.dynamodb.attribute_definitions" semantic conventions. It represents -// the JSON-serialized value of each item in the `AttributeDefinitions` request -// field. -func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) -} - -// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to the -// "aws.dynamodb.attributes_to_get" semantic conventions. It represents the value -// of the `AttributesToGet` request parameter. -func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributesToGetKey.StringSlice(val) -} - -// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the -// "aws.dynamodb.consistent_read" semantic conventions. It represents the value -// of the `ConsistentRead` request parameter. -func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { - return AWSDynamoDBConsistentReadKey.Bool(val) -} - -// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to the -// "aws.dynamodb.consumed_capacity" semantic conventions. It represents the -// JSON-serialized value of each item in the `ConsumedCapacity` response field. -func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { - return AWSDynamoDBConsumedCapacityKey.StringSlice(val) -} - -// AWSDynamoDBCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.count" semantic conventions. It represents the value of the -// `Count` response parameter. -func AWSDynamoDBCount(val int) attribute.KeyValue { - return AWSDynamoDBCountKey.Int(val) -} - -// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming to the -// "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the -// value of the `ExclusiveStartTableName` request parameter. -func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { - return AWSDynamoDBExclusiveStartTableKey.String(val) -} - -// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue -// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic -// conventions. It represents the JSON-serialized value of each item in the -// `GlobalSecondaryIndexUpdates` request field. -func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { - return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) -} - -// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue conforming to -// the "aws.dynamodb.global_secondary_indexes" semantic conventions. It -// represents the JSON-serialized value of each item of the -// `GlobalSecondaryIndexes` request field. -func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { - return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) -} - -// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the -// "aws.dynamodb.index_name" semantic conventions. It represents the value of the -// `IndexName` request parameter. -func AWSDynamoDBIndexName(val string) attribute.KeyValue { - return AWSDynamoDBIndexNameKey.String(val) -} - -// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming to -// the "aws.dynamodb.item_collection_metrics" semantic conventions. It represents -// the JSON-serialized value of the `ItemCollectionMetrics` response field. -func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { - return AWSDynamoDBItemCollectionMetricsKey.String(val) -} - -// AWSDynamoDBLimit returns an attribute KeyValue conforming to the -// "aws.dynamodb.limit" semantic conventions. It represents the value of the -// `Limit` request parameter. -func AWSDynamoDBLimit(val int) attribute.KeyValue { - return AWSDynamoDBLimitKey.Int(val) -} - -// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming to -// the "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents -// the JSON-serialized value of each item of the `LocalSecondaryIndexes` request -// field. -func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { - return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) -} - -// AWSDynamoDBProjection returns an attribute KeyValue conforming to the -// "aws.dynamodb.projection" semantic conventions. It represents the value of the -// `ProjectionExpression` request parameter. -func AWSDynamoDBProjection(val string) attribute.KeyValue { - return AWSDynamoDBProjectionKey.String(val) -} - -// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue conforming to -// the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It -// represents the value of the `ProvisionedThroughput.ReadCapacityUnits` request -// parameter. -func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { - return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) -} - -// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue conforming -// to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. It -// represents the value of the `ProvisionedThroughput.WriteCapacityUnits` request -// parameter. -func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { - return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) -} - -// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the -// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of -// the `ScanIndexForward` request parameter. -func AWSDynamoDBScanForward(val bool) attribute.KeyValue { - return AWSDynamoDBScanForwardKey.Bool(val) -} - -// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.scanned_count" semantic conventions. It represents the value of -// the `ScannedCount` response parameter. -func AWSDynamoDBScannedCount(val int) attribute.KeyValue { - return AWSDynamoDBScannedCountKey.Int(val) -} - -// AWSDynamoDBSegment returns an attribute KeyValue conforming to the -// "aws.dynamodb.segment" semantic conventions. It represents the value of the -// `Segment` request parameter. -func AWSDynamoDBSegment(val int) attribute.KeyValue { - return AWSDynamoDBSegmentKey.Int(val) -} - -// AWSDynamoDBSelect returns an attribute KeyValue conforming to the -// "aws.dynamodb.select" semantic conventions. It represents the value of the -// `Select` request parameter. -func AWSDynamoDBSelect(val string) attribute.KeyValue { - return AWSDynamoDBSelectKey.String(val) -} - -// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_count" semantic conventions. It represents the number of -// items in the `TableNames` response parameter. -func AWSDynamoDBTableCount(val int) attribute.KeyValue { - return AWSDynamoDBTableCountKey.Int(val) -} - -// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_names" semantic conventions. It represents the keys in the -// `RequestItems` object field. -func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { - return AWSDynamoDBTableNamesKey.StringSlice(val) -} - -// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the -// "aws.dynamodb.total_segments" semantic conventions. It represents the value of -// the `TotalSegments` request parameter. -func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { - return AWSDynamoDBTotalSegmentsKey.Int(val) -} - -// AWSECSClusterARN returns an attribute KeyValue conforming to the -// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an -// [ECS cluster]. -// -// [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]. -// -// [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 a running -// [ECS task]. -// -// [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids -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 family name of -// the [ECS task definition] used to create the ECS task. -// -// [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html -func AWSECSTaskFamily(val string) attribute.KeyValue { - return AWSECSTaskFamilyKey.String(val) -} - -// AWSECSTaskID returns an attribute KeyValue conforming to the "aws.ecs.task.id" -// semantic conventions. It represents the ID of a running ECS task. The ID MUST -// be extracted from `task.arn`. -func AWSECSTaskID(val string) attribute.KeyValue { - return AWSECSTaskIDKey.String(val) -} - -// AWSECSTaskRevision returns an attribute KeyValue conforming to the -// "aws.ecs.task.revision" semantic conventions. It represents the revision for -// the task definition used to create the ECS task. -func AWSECSTaskRevision(val string) attribute.KeyValue { - return AWSECSTaskRevisionKey.String(val) -} - -// 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) -} - -// AWSExtendedRequestID returns an attribute KeyValue conforming to the -// "aws.extended_request_id" semantic conventions. It represents the AWS extended -// request ID as returned in the response header `x-amz-id-2`. -func AWSExtendedRequestID(val string) attribute.KeyValue { - return AWSExtendedRequestIDKey.String(val) -} - -// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the -// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked -// ARN as provided on the `Context` passed to the function ( -// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` -// applicable). -func AWSLambdaInvokedARN(val string) attribute.KeyValue { - return AWSLambdaInvokedARNKey.String(val) -} - -// 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) -} - -// AWSRequestID returns an attribute KeyValue conforming to the "aws.request_id" -// semantic conventions. It represents the AWS request ID as returned in the -// response headers `x-amzn-requestid`, `x-amzn-request-id` or `x-amz-request-id` -// . -func AWSRequestID(val string) attribute.KeyValue { - return AWSRequestIDKey.String(val) -} - -// AWSS3Bucket returns an attribute KeyValue conforming to the "aws.s3.bucket" -// semantic conventions. It represents the S3 bucket name the request refers to. -// Corresponds to the `--bucket` parameter of the [S3 API] operations. -// -// [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html -func AWSS3Bucket(val string) attribute.KeyValue { - return AWSS3BucketKey.String(val) -} - -// AWSS3CopySource returns an attribute KeyValue conforming to the -// "aws.s3.copy_source" semantic conventions. It represents the source object (in -// the form `bucket`/`key`) for the copy operation. -func AWSS3CopySource(val string) attribute.KeyValue { - return AWSS3CopySourceKey.String(val) -} - -// AWSS3Delete returns an attribute KeyValue conforming to the "aws.s3.delete" -// semantic conventions. It represents the delete request container that -// specifies the objects to be deleted. -func AWSS3Delete(val string) attribute.KeyValue { - return AWSS3DeleteKey.String(val) -} - -// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" semantic -// conventions. It represents the S3 object key the request refers to. -// Corresponds to the `--key` parameter of the [S3 API] operations. -// -// [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html -func AWSS3Key(val string) attribute.KeyValue { - return AWSS3KeyKey.String(val) -} - -// AWSS3PartNumber returns an attribute KeyValue conforming to the -// "aws.s3.part_number" semantic conventions. It represents the part number of -// the part being uploaded in a multipart-upload operation. This is a positive -// integer between 1 and 10,000. -func AWSS3PartNumber(val int) attribute.KeyValue { - return AWSS3PartNumberKey.Int(val) -} - -// AWSS3UploadID returns an attribute KeyValue conforming to the -// "aws.s3.upload_id" semantic conventions. It represents the upload ID that -// identifies the multipart upload. -func AWSS3UploadID(val string) attribute.KeyValue { - return AWSS3UploadIDKey.String(val) -} - -// Enum values for aws.ecs.launchtype -var ( - // ec2 - // Stability: development - AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") - // fargate - // Stability: development - AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") -) - -// Namespace: az -const ( - // AzNamespaceKey is the attribute Key conforming to the "az.namespace" semantic - // conventions. It represents the [Azure Resource Provider Namespace] as - // recognized by the client. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Microsoft.Storage", "Microsoft.KeyVault", "Microsoft.ServiceBus" - // - // [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers - AzNamespaceKey = attribute.Key("az.namespace") - - // AzServiceRequestIDKey is the attribute Key conforming to the - // "az.service_request_id" semantic conventions. It represents the unique - // identifier of the service request. It's generated by the Azure service and - // returned with the response. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "00000000-0000-0000-0000-000000000000" - AzServiceRequestIDKey = attribute.Key("az.service_request_id") -) - -// AzNamespace returns an attribute KeyValue conforming to the "az.namespace" -// semantic conventions. It represents the [Azure Resource Provider Namespace] as -// recognized by the client. -// -// [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers -func AzNamespace(val string) attribute.KeyValue { - return AzNamespaceKey.String(val) -} - -// AzServiceRequestID returns an attribute KeyValue conforming to the -// "az.service_request_id" semantic conventions. It represents the unique -// identifier of the service request. It's generated by the Azure service and -// returned with the response. -func AzServiceRequestID(val string) attribute.KeyValue { - return AzServiceRequestIDKey.String(val) -} - -// Namespace: azure -const ( - // AzureClientIDKey is the attribute Key conforming to the "azure.client.id" - // semantic conventions. It represents the unique identifier of the client - // instance. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "3ba4827d-4422-483f-b59f-85b74211c11d", "storage-client-1" - AzureClientIDKey = attribute.Key("azure.client.id") - - // AzureCosmosDBConnectionModeKey is the attribute Key conforming to the - // "azure.cosmosdb.connection.mode" semantic conventions. It represents the - // cosmos client connection mode. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - AzureCosmosDBConnectionModeKey = attribute.Key("azure.cosmosdb.connection.mode") - - // AzureCosmosDBConsistencyLevelKey is the attribute Key conforming to the - // "azure.cosmosdb.consistency.level" semantic conventions. It represents the - // account or request [consistency level]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Eventual", "ConsistentPrefix", "BoundedStaleness", "Strong", - // "Session" - // - // [consistency level]: https://learn.microsoft.com/azure/cosmos-db/consistency-levels - AzureCosmosDBConsistencyLevelKey = attribute.Key("azure.cosmosdb.consistency.level") - - // AzureCosmosDBOperationContactedRegionsKey is the attribute Key conforming to - // the "azure.cosmosdb.operation.contacted_regions" semantic conventions. It - // represents the list of regions contacted during operation in the order that - // they were contacted. If there is more than one region listed, it indicates - // that the operation was performed on multiple regions i.e. cross-regional - // call. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "North Central US", "Australia East", "Australia Southeast" - // Note: Region name matches the format of `displayName` in [Azure Location API] - // - // [Azure Location API]: https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location - AzureCosmosDBOperationContactedRegionsKey = attribute.Key("azure.cosmosdb.operation.contacted_regions") - - // AzureCosmosDBOperationRequestChargeKey is the attribute Key conforming to the - // "azure.cosmosdb.operation.request_charge" semantic conventions. It represents - // the number of request units consumed by the operation. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 46.18, 1.0 - AzureCosmosDBOperationRequestChargeKey = attribute.Key("azure.cosmosdb.operation.request_charge") - - // AzureCosmosDBRequestBodySizeKey is the attribute Key conforming to the - // "azure.cosmosdb.request.body.size" semantic conventions. It represents the - // request payload size in bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - AzureCosmosDBRequestBodySizeKey = attribute.Key("azure.cosmosdb.request.body.size") - - // AzureCosmosDBResponseSubStatusCodeKey is the attribute Key conforming to the - // "azure.cosmosdb.response.sub_status_code" semantic conventions. It represents - // the cosmos DB sub status code. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1000, 1002 - AzureCosmosDBResponseSubStatusCodeKey = attribute.Key("azure.cosmosdb.response.sub_status_code") -) - -// AzureClientID returns an attribute KeyValue conforming to the -// "azure.client.id" semantic conventions. It represents the unique identifier of -// the client instance. -func AzureClientID(val string) attribute.KeyValue { - return AzureClientIDKey.String(val) -} - -// AzureCosmosDBOperationContactedRegions returns an attribute KeyValue -// conforming to the "azure.cosmosdb.operation.contacted_regions" semantic -// conventions. It represents the list of regions contacted during operation in -// the order that they were contacted. If there is more than one region listed, -// it indicates that the operation was performed on multiple regions i.e. -// cross-regional call. -func AzureCosmosDBOperationContactedRegions(val ...string) attribute.KeyValue { - return AzureCosmosDBOperationContactedRegionsKey.StringSlice(val) -} - -// AzureCosmosDBOperationRequestCharge returns an attribute KeyValue conforming -// to the "azure.cosmosdb.operation.request_charge" semantic conventions. It -// represents the number of request units consumed by the operation. -func AzureCosmosDBOperationRequestCharge(val float64) attribute.KeyValue { - return AzureCosmosDBOperationRequestChargeKey.Float64(val) -} - -// AzureCosmosDBRequestBodySize returns an attribute KeyValue conforming to the -// "azure.cosmosdb.request.body.size" semantic conventions. It represents the -// request payload size in bytes. -func AzureCosmosDBRequestBodySize(val int) attribute.KeyValue { - return AzureCosmosDBRequestBodySizeKey.Int(val) -} - -// AzureCosmosDBResponseSubStatusCode returns an attribute KeyValue conforming to -// the "azure.cosmosdb.response.sub_status_code" semantic conventions. It -// represents the cosmos DB sub status code. -func AzureCosmosDBResponseSubStatusCode(val int) attribute.KeyValue { - return AzureCosmosDBResponseSubStatusCodeKey.Int(val) -} - -// Enum values for azure.cosmosdb.connection.mode -var ( - // Gateway (HTTP) connection. - // Stability: development - AzureCosmosDBConnectionModeGateway = AzureCosmosDBConnectionModeKey.String("gateway") - // Direct connection. - // Stability: development - AzureCosmosDBConnectionModeDirect = AzureCosmosDBConnectionModeKey.String("direct") -) - -// Enum values for azure.cosmosdb.consistency.level -var ( - // strong - // Stability: development - AzureCosmosDBConsistencyLevelStrong = AzureCosmosDBConsistencyLevelKey.String("Strong") - // bounded_staleness - // Stability: development - AzureCosmosDBConsistencyLevelBoundedStaleness = AzureCosmosDBConsistencyLevelKey.String("BoundedStaleness") - // session - // Stability: development - AzureCosmosDBConsistencyLevelSession = AzureCosmosDBConsistencyLevelKey.String("Session") - // eventual - // Stability: development - AzureCosmosDBConsistencyLevelEventual = AzureCosmosDBConsistencyLevelKey.String("Eventual") - // consistent_prefix - // Stability: development - AzureCosmosDBConsistencyLevelConsistentPrefix = AzureCosmosDBConsistencyLevelKey.String("ConsistentPrefix") -) - -// Namespace: browser -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: Recommended - // Stability: Development - // - // Examples: " Not A;Brand 99", "Chromium 99", "Chrome 99" - // Note: This value is intended to be taken from the [UA client hints API] ( - // `navigator.userAgentData.brands`). - // - // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface - 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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // Examples: - // Note: This value is intended to be taken from the [UA client hints API] ( - // `navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be - // left unset. - // - // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface - 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: Recommended - // Stability: Development - // - // Examples: "Windows", "macOS", "Android" - // Note: This value is intended to be taken from the [UA client hints API] ( - // `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]. Note that some (but not all) of - // these values can overlap with values in the - // [`os.type` and `os.name` attributes]. However, for consistency, the values in - // the `browser.platform` attribute should capture the exact value that the user - // agent provides. - // - // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface - // [W3C User-Agent Client Hints specification]: https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform - // [`os.type` and `os.name` attributes]: ./os.md - 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) -} - -// Namespace: cassandra -const ( - // CassandraConsistencyLevelKey is the attribute Key conforming to the - // "cassandra.consistency.level" semantic conventions. It represents the - // consistency level of the query. Based on consistency values from [CQL]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [CQL]: https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html - CassandraConsistencyLevelKey = attribute.Key("cassandra.consistency.level") - - // CassandraCoordinatorDCKey is the attribute Key conforming to the - // "cassandra.coordinator.dc" semantic conventions. It represents the data - // center of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: us-west-2 - CassandraCoordinatorDCKey = attribute.Key("cassandra.coordinator.dc") - - // CassandraCoordinatorIDKey is the attribute Key conforming to the - // "cassandra.coordinator.id" semantic conventions. It represents the ID of the - // coordinating node for a query. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - CassandraCoordinatorIDKey = attribute.Key("cassandra.coordinator.id") - - // CassandraPageSizeKey is the attribute Key conforming to the - // "cassandra.page.size" semantic conventions. It represents the fetch size used - // for paging, i.e. how many rows will be returned at once. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 5000 - CassandraPageSizeKey = attribute.Key("cassandra.page.size") - - // CassandraQueryIdempotentKey is the attribute Key conforming to the - // "cassandra.query.idempotent" semantic conventions. It represents the whether - // or not the query is idempotent. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - CassandraQueryIdempotentKey = attribute.Key("cassandra.query.idempotent") - - // CassandraSpeculativeExecutionCountKey is the attribute Key conforming to the - // "cassandra.speculative_execution.count" semantic conventions. It represents - // the number of times a query was speculatively executed. Not set or `0` if the - // query was not executed speculatively. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0, 2 - CassandraSpeculativeExecutionCountKey = attribute.Key("cassandra.speculative_execution.count") -) - -// CassandraCoordinatorDC returns an attribute KeyValue conforming to the -// "cassandra.coordinator.dc" semantic conventions. It represents the data center -// of the coordinating node for a query. -func CassandraCoordinatorDC(val string) attribute.KeyValue { - return CassandraCoordinatorDCKey.String(val) -} - -// CassandraCoordinatorID returns an attribute KeyValue conforming to the -// "cassandra.coordinator.id" semantic conventions. It represents the ID of the -// coordinating node for a query. -func CassandraCoordinatorID(val string) attribute.KeyValue { - return CassandraCoordinatorIDKey.String(val) -} - -// CassandraPageSize returns an attribute KeyValue conforming to the -// "cassandra.page.size" semantic conventions. It represents the fetch size used -// for paging, i.e. how many rows will be returned at once. -func CassandraPageSize(val int) attribute.KeyValue { - return CassandraPageSizeKey.Int(val) -} - -// CassandraQueryIdempotent returns an attribute KeyValue conforming to the -// "cassandra.query.idempotent" semantic conventions. It represents the whether -// or not the query is idempotent. -func CassandraQueryIdempotent(val bool) attribute.KeyValue { - return CassandraQueryIdempotentKey.Bool(val) -} - -// CassandraSpeculativeExecutionCount returns an attribute KeyValue conforming to -// the "cassandra.speculative_execution.count" semantic conventions. It -// represents the number of times a query was speculatively executed. Not set or -// `0` if the query was not executed speculatively. -func CassandraSpeculativeExecutionCount(val int) attribute.KeyValue { - return CassandraSpeculativeExecutionCountKey.Int(val) -} - -// Enum values for cassandra.consistency.level -var ( - // all - // Stability: development - CassandraConsistencyLevelAll = CassandraConsistencyLevelKey.String("all") - // each_quorum - // Stability: development - CassandraConsistencyLevelEachQuorum = CassandraConsistencyLevelKey.String("each_quorum") - // quorum - // Stability: development - CassandraConsistencyLevelQuorum = CassandraConsistencyLevelKey.String("quorum") - // local_quorum - // Stability: development - CassandraConsistencyLevelLocalQuorum = CassandraConsistencyLevelKey.String("local_quorum") - // one - // Stability: development - CassandraConsistencyLevelOne = CassandraConsistencyLevelKey.String("one") - // two - // Stability: development - CassandraConsistencyLevelTwo = CassandraConsistencyLevelKey.String("two") - // three - // Stability: development - CassandraConsistencyLevelThree = CassandraConsistencyLevelKey.String("three") - // local_one - // Stability: development - CassandraConsistencyLevelLocalOne = CassandraConsistencyLevelKey.String("local_one") - // any - // Stability: development - CassandraConsistencyLevelAny = CassandraConsistencyLevelKey.String("any") - // serial - // Stability: development - CassandraConsistencyLevelSerial = CassandraConsistencyLevelKey.String("serial") - // local_serial - // Stability: development - CassandraConsistencyLevelLocalSerial = CassandraConsistencyLevelKey.String("local_serial") -) - -// Namespace: cicd -const ( - // CICDPipelineNameKey is the attribute Key conforming to the - // "cicd.pipeline.name" semantic conventions. It represents the human readable - // name of the pipeline within a CI/CD system. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Build and Test", "Lint", "Deploy Go Project", - // "deploy_to_environment" - CICDPipelineNameKey = attribute.Key("cicd.pipeline.name") - - // CICDPipelineResultKey is the attribute Key conforming to the - // "cicd.pipeline.result" semantic conventions. It represents the result of a - // pipeline run. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "success", "failure", "timeout", "skipped" - CICDPipelineResultKey = attribute.Key("cicd.pipeline.result") - - // CICDPipelineRunIDKey is the attribute Key conforming to the - // "cicd.pipeline.run.id" semantic conventions. It represents the unique - // identifier of a pipeline run within a CI/CD system. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "120912" - CICDPipelineRunIDKey = attribute.Key("cicd.pipeline.run.id") - - // CICDPipelineRunStateKey is the attribute Key conforming to the - // "cicd.pipeline.run.state" semantic conventions. It represents the pipeline - // run goes through these states during its lifecycle. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "pending", "executing", "finalizing" - CICDPipelineRunStateKey = attribute.Key("cicd.pipeline.run.state") - - // CICDPipelineTaskNameKey is the attribute Key conforming to the - // "cicd.pipeline.task.name" semantic conventions. It represents the human - // readable name of a task within a pipeline. Task here most closely aligns with - // a [computing process] in a pipeline. Other terms for tasks include commands, - // steps, and procedures. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Run GoLang Linter", "Go Build", "go-test", "deploy_binary" - // - // [computing process]: https://wikipedia.org/wiki/Pipeline_(computing) - CICDPipelineTaskNameKey = attribute.Key("cicd.pipeline.task.name") - - // CICDPipelineTaskRunIDKey is the attribute Key conforming to the - // "cicd.pipeline.task.run.id" semantic conventions. It represents the unique - // identifier of a task run within a pipeline. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "12097" - CICDPipelineTaskRunIDKey = attribute.Key("cicd.pipeline.task.run.id") - - // CICDPipelineTaskRunURLFullKey is the attribute Key conforming to the - // "cicd.pipeline.task.run.url.full" semantic conventions. It represents the - // [URL] of the pipeline run providing the complete address in order to locate - // and identify the pipeline run. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075" - // - // [URL]: https://wikipedia.org/wiki/URL - CICDPipelineTaskRunURLFullKey = attribute.Key("cicd.pipeline.task.run.url.full") - - // CICDPipelineTaskTypeKey is the attribute Key conforming to the - // "cicd.pipeline.task.type" semantic conventions. It represents the type of the - // task within a pipeline. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "build", "test", "deploy" - CICDPipelineTaskTypeKey = attribute.Key("cicd.pipeline.task.type") - - // CICDSystemComponentKey is the attribute Key conforming to the - // "cicd.system.component" semantic conventions. It represents the name of a - // component of the CICD system. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "controller", "scheduler", "agent" - CICDSystemComponentKey = attribute.Key("cicd.system.component") - - // CICDWorkerStateKey is the attribute Key conforming to the "cicd.worker.state" - // semantic conventions. It represents the state of a CICD worker / agent. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "idle", "busy", "down" - CICDWorkerStateKey = attribute.Key("cicd.worker.state") -) - -// CICDPipelineName returns an attribute KeyValue conforming to the -// "cicd.pipeline.name" semantic conventions. It represents the human readable -// name of the pipeline within a CI/CD system. -func CICDPipelineName(val string) attribute.KeyValue { - return CICDPipelineNameKey.String(val) -} - -// CICDPipelineRunID returns an attribute KeyValue conforming to the -// "cicd.pipeline.run.id" semantic conventions. It represents the unique -// identifier of a pipeline run within a CI/CD system. -func CICDPipelineRunID(val string) attribute.KeyValue { - return CICDPipelineRunIDKey.String(val) -} - -// CICDPipelineTaskName returns an attribute KeyValue conforming to the -// "cicd.pipeline.task.name" semantic conventions. It represents the human -// readable name of a task within a pipeline. Task here most closely aligns with -// a [computing process] in a pipeline. Other terms for tasks include commands, -// steps, and procedures. -// -// [computing process]: https://wikipedia.org/wiki/Pipeline_(computing) -func CICDPipelineTaskName(val string) attribute.KeyValue { - return CICDPipelineTaskNameKey.String(val) -} - -// CICDPipelineTaskRunID returns an attribute KeyValue conforming to the -// "cicd.pipeline.task.run.id" semantic conventions. It represents the unique -// identifier of a task run within a pipeline. -func CICDPipelineTaskRunID(val string) attribute.KeyValue { - return CICDPipelineTaskRunIDKey.String(val) -} - -// CICDPipelineTaskRunURLFull returns an attribute KeyValue conforming to the -// "cicd.pipeline.task.run.url.full" semantic conventions. It represents the -// [URL] of the pipeline run providing the complete address in order to locate -// and identify the pipeline run. -// -// [URL]: https://wikipedia.org/wiki/URL -func CICDPipelineTaskRunURLFull(val string) attribute.KeyValue { - return CICDPipelineTaskRunURLFullKey.String(val) -} - -// CICDSystemComponent returns an attribute KeyValue conforming to the -// "cicd.system.component" semantic conventions. It represents the name of a -// component of the CICD system. -func CICDSystemComponent(val string) attribute.KeyValue { - return CICDSystemComponentKey.String(val) -} - -// Enum values for cicd.pipeline.result -var ( - // The pipeline run finished successfully. - // Stability: development - CICDPipelineResultSuccess = CICDPipelineResultKey.String("success") - // The pipeline run did not finish successfully, eg. due to a compile error or a - // failing test. Such failures are usually detected by non-zero exit codes of - // the tools executed in the pipeline run. - // Stability: development - CICDPipelineResultFailure = CICDPipelineResultKey.String("failure") - // The pipeline run failed due to an error in the CICD system, eg. due to the - // worker being killed. - // Stability: development - CICDPipelineResultError = CICDPipelineResultKey.String("error") - // A timeout caused the pipeline run to be interrupted. - // Stability: development - CICDPipelineResultTimeout = CICDPipelineResultKey.String("timeout") - // The pipeline run was cancelled, eg. by a user manually cancelling the - // pipeline run. - // Stability: development - CICDPipelineResultCancellation = CICDPipelineResultKey.String("cancellation") - // The pipeline run was skipped, eg. due to a precondition not being met. - // Stability: development - CICDPipelineResultSkip = CICDPipelineResultKey.String("skip") -) - -// Enum values for cicd.pipeline.run.state -var ( - // The run pending state spans from the event triggering the pipeline run until - // the execution of the run starts (eg. time spent in a queue, provisioning - // agents, creating run resources). - // - // Stability: development - CICDPipelineRunStatePending = CICDPipelineRunStateKey.String("pending") - // The executing state spans the execution of any run tasks (eg. build, test). - // Stability: development - CICDPipelineRunStateExecuting = CICDPipelineRunStateKey.String("executing") - // The finalizing state spans from when the run has finished executing (eg. - // cleanup of run resources). - // Stability: development - CICDPipelineRunStateFinalizing = CICDPipelineRunStateKey.String("finalizing") -) - -// Enum values for cicd.pipeline.task.type -var ( - // build - // Stability: development - CICDPipelineTaskTypeBuild = CICDPipelineTaskTypeKey.String("build") - // test - // Stability: development - CICDPipelineTaskTypeTest = CICDPipelineTaskTypeKey.String("test") - // deploy - // Stability: development - CICDPipelineTaskTypeDeploy = CICDPipelineTaskTypeKey.String("deploy") -) - -// Enum values for cicd.worker.state -var ( - // The worker is not performing work for the CICD system. It is available to the - // CICD system to perform work on (online / idle). - // Stability: development - CICDWorkerStateAvailable = CICDWorkerStateKey.String("available") - // The worker is performing work for the CICD system. - // Stability: development - CICDWorkerStateBusy = CICDWorkerStateKey.String("busy") - // The worker is not available to the CICD system (disconnected / down). - // Stability: development - CICDWorkerStateOffline = CICDWorkerStateKey.String("offline") -) - -// Namespace: client -const ( - // ClientAddressKey is the attribute Key conforming to the "client.address" - // semantic conventions. It represents the client address - domain name if - // available without reverse DNS lookup; otherwise, IP address or Unix domain - // socket name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "client.example.com", "10.1.2.80", "/tmp/my.sock" - // Note: When observed from the server side, and when communicating through an - // intermediary, `client.address` SHOULD represent the client address behind any - // intermediaries, for example proxies, if it's available. - ClientAddressKey = attribute.Key("client.address") - - // ClientPortKey is the attribute Key conforming to the "client.port" semantic - // conventions. It represents the client port number. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: 65123 - // Note: When observed from the server side, and when communicating through an - // intermediary, `client.port` SHOULD represent the client port behind any - // intermediaries, for example proxies, if it's available. - ClientPortKey = attribute.Key("client.port") -) - -// ClientAddress returns an attribute KeyValue conforming to the "client.address" -// semantic conventions. It represents the client address - domain name if -// available without reverse DNS lookup; otherwise, IP address or Unix domain -// socket name. -func ClientAddress(val string) attribute.KeyValue { - return ClientAddressKey.String(val) -} - -// ClientPort returns an attribute KeyValue conforming to the "client.port" -// semantic conventions. It represents the client port number. -func ClientPort(val int) attribute.KeyValue { - return ClientPortKey.Int(val) -} - -// Namespace: cloud -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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // Examples: - // 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: Recommended - // Stability: Development - // - // Examples: - 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: Recommended - // Stability: Development - // - // Examples: "us-central1", "us-east-1" - // Note: Refer to your provider's docs to see the available regions, for example - // [Alibaba Cloud regions], [AWS regions], [Azure regions], - // [Google Cloud regions], or [Tencent Cloud regions]. - // - // [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 - // [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] on AWS, a - // [fully qualified resource ID] on Azure, a [full resource name] on GCP). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function", - // "//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID", - // "/subscriptions//resourceGroups/ - // /providers/Microsoft.Web/sites//functions/" - // 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]. - // Take care not to use the "invoked ARN" directly but replace any - // [alias suffix] - // with the resolved function version, as the same runtime instance may be - // invocable with - // multiple different aliases. - // - **GCP:** The [URI of the resource] - // - **Azure:** The [Fully Qualified Resource ID] of the invoked function, - // *not* the function app, having the form - // - // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/` - // . - // This means that a span attribute MUST be used, as an Azure function app - // can host multiple functions that would usually share - // a TracerProvider. - // - // - // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id - // [full resource name]: https://cloud.google.com/apis/design/resource_names#full_resource_name - // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - // [alias suffix]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html - // [URI of the resource]: https://cloud.google.com/iam/docs/full-resource-names - // [Fully Qualified Resource ID]: https://docs.microsoft.com/rest/api/resources/resources/get-by-id - CloudResourceIDKey = attribute.Key("cloud.resource_id") -) - -// 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] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] -// on GCP). -// -// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html -// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id -// [full resource name]: https://cloud.google.com/apis/design/resource_names#full_resource_name -func CloudResourceID(val string) attribute.KeyValue { - return CloudResourceIDKey.String(val) -} - -// Enum values for cloud.platform -var ( - // Alibaba Cloud Elastic Compute Service - // Stability: development - CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") - // Alibaba Cloud Function Compute - // Stability: development - CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc") - // Red Hat OpenShift on Alibaba Cloud - // Stability: development - CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift") - // AWS Elastic Compute Cloud - // Stability: development - CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") - // AWS Elastic Container Service - // Stability: development - CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") - // AWS Elastic Kubernetes Service - // Stability: development - CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") - // AWS Lambda - // Stability: development - CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") - // AWS Elastic Beanstalk - // Stability: development - CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") - // AWS App Runner - // Stability: development - CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") - // Red Hat OpenShift on AWS (ROSA) - // Stability: development - CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift") - // Azure Virtual Machines - // Stability: development - CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm") - // Azure Container Apps - // Stability: development - CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure_container_apps") - // Azure Container Instances - // Stability: development - CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances") - // Azure Kubernetes Service - // Stability: development - CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks") - // Azure Functions - // Stability: development - CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions") - // Azure App Service - // Stability: development - CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service") - // Azure Red Hat OpenShift - // Stability: development - CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift") - // Google Bare Metal Solution (BMS) - // Stability: development - CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") - // Google Cloud Compute Engine (GCE) - // Stability: development - CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") - // Google Cloud Run - // Stability: development - CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") - // Google Cloud Kubernetes Engine (GKE) - // Stability: development - CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") - // Google Cloud Functions (GCF) - // Stability: development - CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") - // Google Cloud App Engine (GAE) - // Stability: development - CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") - // Red Hat OpenShift on Google Cloud - // Stability: development - CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift") - // Red Hat OpenShift on IBM Cloud - // Stability: development - CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift") - // Compute on Oracle Cloud Infrastructure (OCI) - // Stability: development - CloudPlatformOracleCloudCompute = CloudPlatformKey.String("oracle_cloud_compute") - // Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI) - // Stability: development - CloudPlatformOracleCloudOke = CloudPlatformKey.String("oracle_cloud_oke") - // Tencent Cloud Cloud Virtual Machine (CVM) - // Stability: development - CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm") - // Tencent Cloud Elastic Kubernetes Service (EKS) - // Stability: development - CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") - // Tencent Cloud Serverless Cloud Function (SCF) - // Stability: development - CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") -) - -// Enum values for cloud.provider -var ( - // Alibaba Cloud - // Stability: development - CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") - // Amazon Web Services - // Stability: development - CloudProviderAWS = CloudProviderKey.String("aws") - // Microsoft Azure - // Stability: development - CloudProviderAzure = CloudProviderKey.String("azure") - // Google Cloud Platform - // Stability: development - CloudProviderGCP = CloudProviderKey.String("gcp") - // Heroku Platform as a Service - // Stability: development - CloudProviderHeroku = CloudProviderKey.String("heroku") - // IBM Cloud - // Stability: development - CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") - // Oracle Cloud Infrastructure (OCI) - // Stability: development - CloudProviderOracleCloud = CloudProviderKey.String("oracle_cloud") - // Tencent Cloud - // Stability: development - CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") -) - -// Namespace: cloudevents -const ( - // CloudeventsEventIDKey is the attribute Key conforming to the - // "cloudevents.event_id" semantic conventions. It represents the [event_id] - // uniquely identifies the event. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "123e4567-e89b-12d3-a456-426614174000", "0001" - // - // [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id - CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") - - // CloudeventsEventSourceKey is the attribute Key conforming to the - // "cloudevents.event_source" semantic conventions. It represents the [source] - // identifies the context in which an event happened. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "https://github.com/cloudevents", "/cloudevents/spec/pull/123", - // "my-service" - // - // [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1 - CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") - - // CloudeventsEventSpecVersionKey is the attribute Key conforming to the - // "cloudevents.event_spec_version" semantic conventions. It represents the - // [version of the CloudEvents specification] which the event uses. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1.0 - // - // [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion - CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") - - // CloudeventsEventSubjectKey is the attribute Key conforming to the - // "cloudevents.event_subject" semantic conventions. It represents the [subject] - // of the event in the context of the event producer (identified by source). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: mynewfile.jpg - // - // [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject - CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") - - // CloudeventsEventTypeKey is the attribute Key conforming to the - // "cloudevents.event_type" semantic conventions. It represents the [event_type] - // contains a value describing the type of event related to the originating - // occurrence. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "com.github.pull_request.opened", "com.example.object.deleted.v2" - // - // [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type - CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") -) - -// CloudeventsEventID returns an attribute KeyValue conforming to the -// "cloudevents.event_id" semantic conventions. It represents the [event_id] -// uniquely identifies the event. -// -// [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id -func CloudeventsEventID(val string) attribute.KeyValue { - return CloudeventsEventIDKey.String(val) -} - -// CloudeventsEventSource returns an attribute KeyValue conforming to the -// "cloudevents.event_source" semantic conventions. It represents the [source] -// identifies the context in which an event happened. -// -// [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1 -func CloudeventsEventSource(val string) attribute.KeyValue { - return CloudeventsEventSourceKey.String(val) -} - -// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to the -// "cloudevents.event_spec_version" semantic conventions. It represents the -// [version of the CloudEvents specification] which the event uses. -// -// [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion -func CloudeventsEventSpecVersion(val string) attribute.KeyValue { - return CloudeventsEventSpecVersionKey.String(val) -} - -// CloudeventsEventSubject returns an attribute KeyValue conforming to the -// "cloudevents.event_subject" semantic conventions. It represents the [subject] -// of the event in the context of the event producer (identified by source). -// -// [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject -func CloudeventsEventSubject(val string) attribute.KeyValue { - return CloudeventsEventSubjectKey.String(val) -} - -// CloudeventsEventType returns an attribute KeyValue conforming to the -// "cloudevents.event_type" semantic conventions. It represents the [event_type] -// contains a value describing the type of event related to the originating -// occurrence. -// -// [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type -func CloudeventsEventType(val string) attribute.KeyValue { - return CloudeventsEventTypeKey.String(val) -} - -// Namespace: cloudfoundry -const ( - // CloudfoundryAppIDKey is the attribute Key conforming to the - // "cloudfoundry.app.id" semantic conventions. It represents the guid of the - // application. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.application_id`. This is the same value as - // reported by `cf app --guid`. - CloudfoundryAppIDKey = attribute.Key("cloudfoundry.app.id") - - // CloudfoundryAppInstanceIDKey is the attribute Key conforming to the - // "cloudfoundry.app.instance.id" semantic conventions. It represents the index - // of the application instance. 0 when just one instance is active. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0", "1" - // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope] - // . - // It is used for logs and metrics emitted by CloudFoundry. It is - // supposed to contain the application instance index for applications - // deployed on the runtime. - // - // Application instrumentation should use the value from environment - // variable `CF_INSTANCE_INDEX`. - // - // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope - CloudfoundryAppInstanceIDKey = attribute.Key("cloudfoundry.app.instance.id") - - // CloudfoundryAppNameKey is the attribute Key conforming to the - // "cloudfoundry.app.name" semantic conventions. It represents the name of the - // application. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-app-name" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.application_name`. This is the same value - // as reported by `cf apps`. - CloudfoundryAppNameKey = attribute.Key("cloudfoundry.app.name") - - // CloudfoundryOrgIDKey is the attribute Key conforming to the - // "cloudfoundry.org.id" semantic conventions. It represents the guid of the - // CloudFoundry org the application is running in. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.org_id`. This is the same value as - // reported by `cf org --guid`. - CloudfoundryOrgIDKey = attribute.Key("cloudfoundry.org.id") - - // CloudfoundryOrgNameKey is the attribute Key conforming to the - // "cloudfoundry.org.name" semantic conventions. It represents the name of the - // CloudFoundry organization the app is running in. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-org-name" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.org_name`. This is the same value as - // reported by `cf orgs`. - CloudfoundryOrgNameKey = attribute.Key("cloudfoundry.org.name") - - // CloudfoundryProcessIDKey is the attribute Key conforming to the - // "cloudfoundry.process.id" semantic conventions. It represents the UID - // identifying the process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to - // `VCAP_APPLICATION.app_id` for applications deployed to the runtime. - // For system components, this could be the actual PID. - CloudfoundryProcessIDKey = attribute.Key("cloudfoundry.process.id") - - // CloudfoundryProcessTypeKey is the attribute Key conforming to the - // "cloudfoundry.process.type" semantic conventions. It represents the type of - // process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "web" - // Note: CloudFoundry applications can consist of multiple jobs. Usually the - // main process will be of type `web`. There can be additional background - // tasks or side-cars with different process types. - CloudfoundryProcessTypeKey = attribute.Key("cloudfoundry.process.type") - - // CloudfoundrySpaceIDKey is the attribute Key conforming to the - // "cloudfoundry.space.id" semantic conventions. It represents the guid of the - // CloudFoundry space the application is running in. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.space_id`. This is the same value as - // reported by `cf space --guid`. - CloudfoundrySpaceIDKey = attribute.Key("cloudfoundry.space.id") - - // CloudfoundrySpaceNameKey is the attribute Key conforming to the - // "cloudfoundry.space.name" semantic conventions. It represents the name of the - // CloudFoundry space the application is running in. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-space-name" - // Note: Application instrumentation should use the value from environment - // variable `VCAP_APPLICATION.space_name`. This is the same value as - // reported by `cf spaces`. - CloudfoundrySpaceNameKey = attribute.Key("cloudfoundry.space.name") - - // CloudfoundrySystemIDKey is the attribute Key conforming to the - // "cloudfoundry.system.id" semantic conventions. It represents a guid or - // another name describing the event source. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "cf/gorouter" - // Note: CloudFoundry defines the `source_id` in the [Loggregator v2 envelope]. - // It is used for logs and metrics emitted by CloudFoundry. It is - // supposed to contain the component name, e.g. "gorouter", for - // CloudFoundry components. - // - // When system components are instrumented, values from the - // [Bosh spec] - // should be used. The `system.id` should be set to - // `spec.deployment/spec.name`. - // - // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope - // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec - CloudfoundrySystemIDKey = attribute.Key("cloudfoundry.system.id") - - // CloudfoundrySystemInstanceIDKey is the attribute Key conforming to the - // "cloudfoundry.system.instance.id" semantic conventions. It represents a guid - // describing the concrete instance of the event source. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" - // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope] - // . - // It is used for logs and metrics emitted by CloudFoundry. It is - // supposed to contain the vm id for CloudFoundry components. - // - // When system components are instrumented, values from the - // [Bosh spec] - // should be used. The `system.instance.id` should be set to `spec.id`. - // - // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope - // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec - CloudfoundrySystemInstanceIDKey = attribute.Key("cloudfoundry.system.instance.id") -) - -// CloudfoundryAppID returns an attribute KeyValue conforming to the -// "cloudfoundry.app.id" semantic conventions. It represents the guid of the -// application. -func CloudfoundryAppID(val string) attribute.KeyValue { - return CloudfoundryAppIDKey.String(val) -} - -// CloudfoundryAppInstanceID returns an attribute KeyValue conforming to the -// "cloudfoundry.app.instance.id" semantic conventions. It represents the index -// of the application instance. 0 when just one instance is active. -func CloudfoundryAppInstanceID(val string) attribute.KeyValue { - return CloudfoundryAppInstanceIDKey.String(val) -} - -// CloudfoundryAppName returns an attribute KeyValue conforming to the -// "cloudfoundry.app.name" semantic conventions. It represents the name of the -// application. -func CloudfoundryAppName(val string) attribute.KeyValue { - return CloudfoundryAppNameKey.String(val) -} - -// CloudfoundryOrgID returns an attribute KeyValue conforming to the -// "cloudfoundry.org.id" semantic conventions. It represents the guid of the -// CloudFoundry org the application is running in. -func CloudfoundryOrgID(val string) attribute.KeyValue { - return CloudfoundryOrgIDKey.String(val) -} - -// CloudfoundryOrgName returns an attribute KeyValue conforming to the -// "cloudfoundry.org.name" semantic conventions. It represents the name of the -// CloudFoundry organization the app is running in. -func CloudfoundryOrgName(val string) attribute.KeyValue { - return CloudfoundryOrgNameKey.String(val) -} - -// CloudfoundryProcessID returns an attribute KeyValue conforming to the -// "cloudfoundry.process.id" semantic conventions. It represents the UID -// identifying the process. -func CloudfoundryProcessID(val string) attribute.KeyValue { - return CloudfoundryProcessIDKey.String(val) -} - -// CloudfoundryProcessType returns an attribute KeyValue conforming to the -// "cloudfoundry.process.type" semantic conventions. It represents the type of -// process. -func CloudfoundryProcessType(val string) attribute.KeyValue { - return CloudfoundryProcessTypeKey.String(val) -} - -// CloudfoundrySpaceID returns an attribute KeyValue conforming to the -// "cloudfoundry.space.id" semantic conventions. It represents the guid of the -// CloudFoundry space the application is running in. -func CloudfoundrySpaceID(val string) attribute.KeyValue { - return CloudfoundrySpaceIDKey.String(val) -} - -// CloudfoundrySpaceName returns an attribute KeyValue conforming to the -// "cloudfoundry.space.name" semantic conventions. It represents the name of the -// CloudFoundry space the application is running in. -func CloudfoundrySpaceName(val string) attribute.KeyValue { - return CloudfoundrySpaceNameKey.String(val) -} - -// CloudfoundrySystemID returns an attribute KeyValue conforming to the -// "cloudfoundry.system.id" semantic conventions. It represents a guid or another -// name describing the event source. -func CloudfoundrySystemID(val string) attribute.KeyValue { - return CloudfoundrySystemIDKey.String(val) -} - -// CloudfoundrySystemInstanceID returns an attribute KeyValue conforming to the -// "cloudfoundry.system.instance.id" semantic conventions. It represents a guid -// describing the concrete instance of the event source. -func CloudfoundrySystemInstanceID(val string) attribute.KeyValue { - return CloudfoundrySystemInstanceIDKey.String(val) -} - -// Namespace: code -const ( - // CodeColumnNumberKey is the attribute Key conforming to the - // "code.column.number" semantic conventions. It represents the column number in - // `code.file.path` best representing the operation. It SHOULD point within the - // code unit named in `code.function.name`. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - CodeColumnNumberKey = attribute.Key("code.column.number") - - // CodeFilePathKey is the attribute Key conforming to the "code.file.path" - // semantic conventions. It represents the source code file name that identifies - // the code unit as uniquely as possible (preferably an absolute file path). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: /usr/local/MyApplication/content_root/app/index.php - CodeFilePathKey = attribute.Key("code.file.path") - - // CodeFilepathKey is the attribute Key conforming to the "code.filepath" - // semantic conventions. It represents the deprecated, use `code.file.path` - // instead. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: /usr/local/MyApplication/content_root/app/index.php - CodeFilepathKey = attribute.Key("code.filepath") - - // CodeFunctionNameKey is the attribute Key conforming to the - // "code.function.name" semantic conventions. It represents the method or - // function name, or equivalent (usually rightmost part of the code unit's - // name). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: serveRequest - CodeFunctionNameKey = attribute.Key("code.function.name") - - // CodeLineNumberKey is the attribute Key conforming to the "code.line.number" - // semantic conventions. It represents the line number in `code.file.path` best - // representing the operation. It SHOULD point within the code unit named in - // `code.function.name`. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - CodeLineNumberKey = attribute.Key("code.line.number") - - // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" - // semantic conventions. It represents the "namespace" within which - // `code.function.name` is defined. Usually the qualified class or module name, - // such that `code.namespace` + some separator + `code.function.name` form a - // unique identifier for the code unit. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: com.example.MyHttpService - CodeNamespaceKey = attribute.Key("code.namespace") - - // CodeStacktraceKey is the attribute Key conforming to the "code.stacktrace" - // semantic conventions. It represents a stacktrace as a string in the natural - // representation for the language runtime. The representation is to be - // determined and documented by each language SIG. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at - // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at - // com.example.GenerateTrace.main(GenerateTrace.java:5) - CodeStacktraceKey = attribute.Key("code.stacktrace") -) - -// CodeColumnNumber returns an attribute KeyValue conforming to the -// "code.column.number" semantic conventions. It represents the column number in -// `code.file.path` best representing the operation. It SHOULD point within the -// code unit named in `code.function.name`. -func CodeColumnNumber(val int) attribute.KeyValue { - return CodeColumnNumberKey.Int(val) -} - -// CodeFilePath returns an attribute KeyValue conforming to the "code.file.path" -// semantic conventions. It represents the source code file name that identifies -// the code unit as uniquely as possible (preferably an absolute file path). -func CodeFilePath(val string) attribute.KeyValue { - return CodeFilePathKey.String(val) -} - -// CodeFilepath returns an attribute KeyValue conforming to the "code.filepath" -// semantic conventions. It represents the deprecated, use `code.file.path` -// instead. -func CodeFilepath(val string) attribute.KeyValue { - return CodeFilepathKey.String(val) -} - -// CodeFunctionName returns an attribute KeyValue conforming to the -// "code.function.name" semantic conventions. It represents the method or -// function name, or equivalent (usually rightmost part of the code unit's name). -func CodeFunctionName(val string) attribute.KeyValue { - return CodeFunctionNameKey.String(val) -} - -// CodeLineNumber returns an attribute KeyValue conforming to the -// "code.line.number" semantic conventions. It represents the line number in -// `code.file.path` best representing the operation. It SHOULD point within the -// code unit named in `code.function.name`. -func CodeLineNumber(val int) attribute.KeyValue { - return CodeLineNumberKey.Int(val) -} - -// CodeNamespace returns an attribute KeyValue conforming to the "code.namespace" -// semantic conventions. It represents the "namespace" within which -// `code.function.name` is defined. Usually the qualified class or module name, -// such that `code.namespace` + some separator + `code.function.name` form a -// unique identifier for the code unit. -func CodeNamespace(val string) attribute.KeyValue { - return CodeNamespaceKey.String(val) -} - -// CodeStacktrace returns an attribute KeyValue conforming to the -// "code.stacktrace" semantic conventions. It represents a stacktrace as a string -// in the natural representation for the language runtime. The representation is -// to be determined and documented by each language SIG. -func CodeStacktrace(val string) attribute.KeyValue { - return CodeStacktraceKey.String(val) -} - -// Namespace: container -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: Recommended - // Stability: Development - // - // 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. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // 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. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "otelcontribcol --config config.yaml" - ContainerCommandLineKey = attribute.Key("container.command_line") - - // ContainerCsiPluginNameKey is the attribute Key conforming to the - // "container.csi.plugin.name" semantic conventions. It represents the name of - // the CSI ([Container Storage Interface]) plugin used by the volume. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "pd.csi.storage.gke.io" - // Note: This can sometimes be referred to as a "driver" in CSI implementations. - // This should represent the `name` field of the GetPluginInfo RPC. - // - // [Container Storage Interface]: https://github.com/container-storage-interface/spec - ContainerCsiPluginNameKey = attribute.Key("container.csi.plugin.name") - - // ContainerCsiVolumeIDKey is the attribute Key conforming to the - // "container.csi.volume.id" semantic conventions. It represents the unique - // volume ID returned by the CSI ([Container Storage Interface]) plugin. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk" - // Note: This can sometimes be referred to as a "volume handle" in CSI - // implementations. This should represent the `Volume.volume_id` field in CSI - // spec. - // - // [Container Storage Interface]: https://github.com/container-storage-interface/spec - ContainerCsiVolumeIDKey = attribute.Key("container.csi.volume.id") - - // 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]. The UUID might be abbreviated. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "a3bf90e006b2" - // - // [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification - 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: Recommended - // Stability: Development - // - // 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] - // endpoint. - // K8s defines a link to the container registry repository with digest - // `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"` - // . - // The ID is assigned 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. - // - // [API]: https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect - 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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // Examples: - // "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", - // "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" - // Note: [Docker] and [CRI] report those under the `RepoDigests` field. - // - // [Docker]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect - // [CRI]: https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238 - 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]. Should be only - // the `` section of the full name for example from - // `registry.example.com/my-org/my-image:`. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "v1.27.1", "3.5.7-0" - // - // [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect - 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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // 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. -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. -func ContainerCommandLine(val string) attribute.KeyValue { - return ContainerCommandLineKey.String(val) -} - -// ContainerCsiPluginName returns an attribute KeyValue conforming to the -// "container.csi.plugin.name" semantic conventions. It represents the name of -// the CSI ([Container Storage Interface]) plugin used by the volume. -// -// [Container Storage Interface]: https://github.com/container-storage-interface/spec -func ContainerCsiPluginName(val string) attribute.KeyValue { - return ContainerCsiPluginNameKey.String(val) -} - -// ContainerCsiVolumeID returns an attribute KeyValue conforming to the -// "container.csi.volume.id" semantic conventions. It represents the unique -// volume ID returned by the CSI ([Container Storage Interface]) plugin. -// -// [Container Storage Interface]: https://github.com/container-storage-interface/spec -func ContainerCsiVolumeID(val string) attribute.KeyValue { - return ContainerCsiVolumeIDKey.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]. The UUID might be abbreviated. -// -// [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification -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]. Should be only the -// `` section of the full name for example from -// `registry.example.com/my-org/my-image:`. -// -// [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect -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) -} - -// Namespace: cpu -const ( - // CPUModeKey is the attribute Key conforming to the "cpu.mode" semantic - // conventions. It represents the mode of the CPU. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "user", "system" - CPUModeKey = attribute.Key("cpu.mode") -) - -// Enum values for cpu.mode -var ( - // user - // Stability: development - CPUModeUser = CPUModeKey.String("user") - // system - // Stability: development - CPUModeSystem = CPUModeKey.String("system") - // nice - // Stability: development - CPUModeNice = CPUModeKey.String("nice") - // idle - // Stability: development - CPUModeIdle = CPUModeKey.String("idle") - // iowait - // Stability: development - CPUModeIowait = CPUModeKey.String("iowait") - // interrupt - // Stability: development - CPUModeInterrupt = CPUModeKey.String("interrupt") - // steal - // Stability: development - CPUModeSteal = CPUModeKey.String("steal") - // kernel - // Stability: development - CPUModeKernel = CPUModeKey.String("kernel") -) - -// Namespace: db -const ( - // DBClientConnectionPoolNameKey is the attribute Key conforming to the - // "db.client.connection.pool.name" semantic conventions. It represents the name - // of the connection pool; unique within the instrumented application. In case - // the connection pool implementation doesn't provide a name, instrumentation - // SHOULD use a combination of parameters that would make the name unique, for - // example, combining attributes `server.address`, `server.port`, and - // `db.namespace`, formatted as `server.address:server.port/db.namespace`. - // Instrumentations that generate connection pool name following different - // patterns SHOULD document it. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "myDataSource" - DBClientConnectionPoolNameKey = attribute.Key("db.client.connection.pool.name") - - // DBClientConnectionStateKey is the attribute Key conforming to the - // "db.client.connection.state" semantic conventions. It represents the state of - // a connection in the pool. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "idle" - DBClientConnectionStateKey = attribute.Key("db.client.connection.state") - - // DBCollectionNameKey is the attribute Key conforming to the - // "db.collection.name" semantic conventions. It represents the name of a - // collection (table, container) within the database. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: "public.users", "customers" - // Note: It is RECOMMENDED to capture the value as provided by the application - // without attempting to do any case normalization. - // - // The collection name SHOULD NOT be extracted from `db.query.text`, - // unless the query format is known to only ever have a single collection name - // present. - // - // For batch operations, if the individual operations are known to have the same - // collection name - // then that collection name SHOULD be used. - DBCollectionNameKey = attribute.Key("db.collection.name") - - // DBNamespaceKey is the attribute Key conforming to the "db.namespace" semantic - // conventions. It represents the name of the database, fully qualified within - // the server address and port. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: "customers", "test.users" - // Note: If a database system has multiple namespace components, they SHOULD be - // concatenated (potentially using database system specific conventions) from - // most general to most specific namespace component, and more specific - // namespaces SHOULD NOT be captured without the more general namespaces, to - // ensure that "startswith" queries for the more general namespaces will be - // valid. - // Semantic conventions for individual database systems SHOULD document what - // `db.namespace` means in the context of that system. - // It is RECOMMENDED to capture the value as provided by the application without - // attempting to do any case normalization. - DBNamespaceKey = attribute.Key("db.namespace") - - // DBOperationBatchSizeKey is the attribute Key conforming to the - // "db.operation.batch.size" semantic conventions. It represents the number of - // queries included in a batch operation. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: 2, 3, 4 - // Note: Operations are only considered batches when they contain two or more - // operations, and so `db.operation.batch.size` SHOULD never be `1`. - DBOperationBatchSizeKey = attribute.Key("db.operation.batch.size") - - // DBOperationNameKey is the attribute Key conforming to the "db.operation.name" - // semantic conventions. It represents the name of the operation or command - // being executed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: "findAndModify", "HMSET", "SELECT" - // Note: It is RECOMMENDED to capture the value as provided by the application - // without attempting to do any case normalization. - // - // The operation name SHOULD NOT be extracted from `db.query.text`, - // unless the query format is known to only ever have a single operation name - // present. - // - // For batch operations, if the individual operations are known to have the same - // operation name - // then that operation name SHOULD be used prepended by `BATCH `, - // otherwise `db.operation.name` SHOULD be `BATCH` or some other database - // system specific term if more applicable. - DBOperationNameKey = attribute.Key("db.operation.name") - - // DBQuerySummaryKey is the attribute Key conforming to the "db.query.summary" - // semantic conventions. It represents the low cardinality representation of a - // database query text. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: "SELECT wuser_table", "INSERT shipping_details SELECT orders", "get - // user by id" - // Note: `db.query.summary` provides static summary of the query text. It - // describes a class of database queries and is useful as a grouping key, - // especially when analyzing telemetry for database calls involving complex - // queries. - // Summary may be available to the instrumentation through instrumentation hooks - // or other means. If it is not available, instrumentations that support query - // parsing SHOULD generate a summary following [Generating query summary] - // section. - // - // [Generating query summary]: ../../docs/database/database-spans.md#generating-a-summary-of-the-query-text - DBQuerySummaryKey = attribute.Key("db.query.summary") - - // DBQueryTextKey is the attribute Key conforming to the "db.query.text" - // semantic conventions. It represents the database query being executed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: "SELECT * FROM wuser_table where username = ?", "SET mykey ?" - // Note: For sanitization see [Sanitization of `db.query.text`]. - // For batch operations, if the individual operations are known to have the same - // query text then that query text SHOULD be used, otherwise all of the - // individual query texts SHOULD be concatenated with separator `; ` or some - // other database system specific separator if more applicable. - // Even though parameterized query text can potentially have sensitive data, by - // using a parameterized query the user is giving a strong signal that any - // sensitive data will be passed as parameter values, and the benefit to - // observability of capturing the static part of the query text by default - // outweighs the risk. - // - // [Sanitization of `db.query.text`]: ../../docs/database/database-spans.md#sanitization-of-dbquerytext - DBQueryTextKey = attribute.Key("db.query.text") - - // DBResponseReturnedRowsKey is the attribute Key conforming to the - // "db.response.returned_rows" semantic conventions. It represents the number of - // rows returned by the operation. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 10, 30, 1000 - DBResponseReturnedRowsKey = attribute.Key("db.response.returned_rows") - - // DBResponseStatusCodeKey is the attribute Key conforming to the - // "db.response.status_code" semantic conventions. It represents the database - // response status code. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: "102", "ORA-17002", "08P01", "404" - // Note: The status code returned by the database. Usually it represents an - // error code, but may also represent partial success, warning, or differentiate - // between various types of successful outcomes. - // Semantic conventions for individual database systems SHOULD document what - // `db.response.status_code` means in the context of that system. - DBResponseStatusCodeKey = attribute.Key("db.response.status_code") - - // DBSystemNameKey is the attribute Key conforming to the "db.system.name" - // semantic conventions. It represents the database management system (DBMS) - // product as identified by the client instrumentation. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Release_Candidate - // - // Examples: - // Note: The actual DBMS may differ from the one identified by the client. For - // example, when using PostgreSQL client libraries to connect to a CockroachDB, - // the `db.system.name` is set to `postgresql` based on the instrumentation's - // best knowledge. - DBSystemNameKey = attribute.Key("db.system.name") -) - -// DBClientConnectionPoolName returns an attribute KeyValue conforming to the -// "db.client.connection.pool.name" semantic conventions. It represents the name -// of the connection pool; unique within the instrumented application. In case -// the connection pool implementation doesn't provide a name, instrumentation -// SHOULD use a combination of parameters that would make the name unique, for -// example, combining attributes `server.address`, `server.port`, and -// `db.namespace`, formatted as `server.address:server.port/db.namespace`. -// Instrumentations that generate connection pool name following different -// patterns SHOULD document it. -func DBClientConnectionPoolName(val string) attribute.KeyValue { - return DBClientConnectionPoolNameKey.String(val) -} - -// DBCollectionName returns an attribute KeyValue conforming to the -// "db.collection.name" semantic conventions. It represents the name of a -// collection (table, container) within the database. -func DBCollectionName(val string) attribute.KeyValue { - return DBCollectionNameKey.String(val) -} - -// DBNamespace returns an attribute KeyValue conforming to the "db.namespace" -// semantic conventions. It represents the name of the database, fully qualified -// within the server address and port. -func DBNamespace(val string) attribute.KeyValue { - return DBNamespaceKey.String(val) -} - -// DBOperationBatchSize returns an attribute KeyValue conforming to the -// "db.operation.batch.size" semantic conventions. It represents the number of -// queries included in a batch operation. -func DBOperationBatchSize(val int) attribute.KeyValue { - return DBOperationBatchSizeKey.Int(val) -} - -// DBOperationName returns an attribute KeyValue conforming to the -// "db.operation.name" semantic conventions. It represents the name of the -// operation or command being executed. -func DBOperationName(val string) attribute.KeyValue { - return DBOperationNameKey.String(val) -} - -// DBQuerySummary returns an attribute KeyValue conforming to the -// "db.query.summary" semantic conventions. It represents the low cardinality -// representation of a database query text. -func DBQuerySummary(val string) attribute.KeyValue { - return DBQuerySummaryKey.String(val) -} - -// DBQueryText returns an attribute KeyValue conforming to the "db.query.text" -// semantic conventions. It represents the database query being executed. -func DBQueryText(val string) attribute.KeyValue { - return DBQueryTextKey.String(val) -} - -// DBResponseReturnedRows returns an attribute KeyValue conforming to the -// "db.response.returned_rows" semantic conventions. It represents the number of -// rows returned by the operation. -func DBResponseReturnedRows(val int) attribute.KeyValue { - return DBResponseReturnedRowsKey.Int(val) -} - -// DBResponseStatusCode returns an attribute KeyValue conforming to the -// "db.response.status_code" semantic conventions. It represents the database -// response status code. -func DBResponseStatusCode(val string) attribute.KeyValue { - return DBResponseStatusCodeKey.String(val) -} - -// Enum values for db.client.connection.state -var ( - // idle - // Stability: development - DBClientConnectionStateIdle = DBClientConnectionStateKey.String("idle") - // used - // Stability: development - DBClientConnectionStateUsed = DBClientConnectionStateKey.String("used") -) - -// Enum values for db.system.name -var ( - // Some other SQL database. Fallback only. - // Stability: development - DBSystemNameOtherSQL = DBSystemNameKey.String("other_sql") - // [Adabas (Adaptable Database System)] - // Stability: development - // - // [Adabas (Adaptable Database System)]: https://documentation.softwareag.com/?pf=adabas - DBSystemNameSoftwareagAdabas = DBSystemNameKey.String("softwareag.adabas") - // [Actian Ingres] - // Stability: development - // - // [Actian Ingres]: https://www.actian.com/databases/ingres/ - DBSystemNameActianIngres = DBSystemNameKey.String("actian.ingres") - // [Amazon DynamoDB] - // Stability: development - // - // [Amazon DynamoDB]: https://aws.amazon.com/pm/dynamodb/ - DBSystemNameAWSDynamoDB = DBSystemNameKey.String("aws.dynamodb") - // [Amazon Redshift] - // Stability: development - // - // [Amazon Redshift]: https://aws.amazon.com/redshift/ - DBSystemNameAWSRedshift = DBSystemNameKey.String("aws.redshift") - // [Azure Cosmos DB] - // Stability: development - // - // [Azure Cosmos DB]: https://learn.microsoft.com/azure/cosmos-db - DBSystemNameAzureCosmosDB = DBSystemNameKey.String("azure.cosmosdb") - // [InterSystems Caché] - // Stability: development - // - // [InterSystems Caché]: https://www.intersystems.com/products/cache/ - DBSystemNameIntersystemsCache = DBSystemNameKey.String("intersystems.cache") - // [Apache Cassandra] - // Stability: development - // - // [Apache Cassandra]: https://cassandra.apache.org/ - DBSystemNameCassandra = DBSystemNameKey.String("cassandra") - // [ClickHouse] - // Stability: development - // - // [ClickHouse]: https://clickhouse.com/ - DBSystemNameClickhouse = DBSystemNameKey.String("clickhouse") - // [CockroachDB] - // Stability: development - // - // [CockroachDB]: https://www.cockroachlabs.com/ - DBSystemNameCockroachdb = DBSystemNameKey.String("cockroachdb") - // [Couchbase] - // Stability: development - // - // [Couchbase]: https://www.couchbase.com/ - DBSystemNameCouchbase = DBSystemNameKey.String("couchbase") - // [Apache CouchDB] - // Stability: development - // - // [Apache CouchDB]: https://couchdb.apache.org/ - DBSystemNameCouchDB = DBSystemNameKey.String("couchdb") - // [Apache Derby] - // Stability: development - // - // [Apache Derby]: https://db.apache.org/derby/ - DBSystemNameDerby = DBSystemNameKey.String("derby") - // [Elasticsearch] - // Stability: development - // - // [Elasticsearch]: https://www.elastic.co/elasticsearch - DBSystemNameElasticsearch = DBSystemNameKey.String("elasticsearch") - // [Firebird] - // Stability: development - // - // [Firebird]: https://www.firebirdsql.org/ - DBSystemNameFirebirdsql = DBSystemNameKey.String("firebirdsql") - // [Google Cloud Spanner] - // Stability: development - // - // [Google Cloud Spanner]: https://cloud.google.com/spanner - DBSystemNameGCPSpanner = DBSystemNameKey.String("gcp.spanner") - // [Apache Geode] - // Stability: development - // - // [Apache Geode]: https://geode.apache.org/ - DBSystemNameGeode = DBSystemNameKey.String("geode") - // [H2 Database] - // Stability: development - // - // [H2 Database]: https://h2database.com/ - DBSystemNameH2database = DBSystemNameKey.String("h2database") - // [Apache HBase] - // Stability: development - // - // [Apache HBase]: https://hbase.apache.org/ - DBSystemNameHBase = DBSystemNameKey.String("hbase") - // [Apache Hive] - // Stability: development - // - // [Apache Hive]: https://hive.apache.org/ - DBSystemNameHive = DBSystemNameKey.String("hive") - // [HyperSQL Database] - // Stability: development - // - // [HyperSQL Database]: https://hsqldb.org/ - DBSystemNameHSQLDB = DBSystemNameKey.String("hsqldb") - // [IBM Db2] - // Stability: development - // - // [IBM Db2]: https://www.ibm.com/db2 - DBSystemNameIbmDb2 = DBSystemNameKey.String("ibm.db2") - // [IBM Informix] - // Stability: development - // - // [IBM Informix]: https://www.ibm.com/products/informix - DBSystemNameIbmInformix = DBSystemNameKey.String("ibm.informix") - // [IBM Netezza] - // Stability: development - // - // [IBM Netezza]: https://www.ibm.com/products/netezza - DBSystemNameIbmNetezza = DBSystemNameKey.String("ibm.netezza") - // [InfluxDB] - // Stability: development - // - // [InfluxDB]: https://www.influxdata.com/ - DBSystemNameInfluxdb = DBSystemNameKey.String("influxdb") - // [Instant] - // Stability: development - // - // [Instant]: https://www.instantdb.com/ - DBSystemNameInstantDB = DBSystemNameKey.String("instantdb") - // [MariaDB] - // Stability: release_candidate - // - // [MariaDB]: https://mariadb.org/ - DBSystemNameMariaDB = DBSystemNameKey.String("mariadb") - // [Memcached] - // Stability: development - // - // [Memcached]: https://memcached.org/ - DBSystemNameMemcached = DBSystemNameKey.String("memcached") - // [MongoDB] - // Stability: development - // - // [MongoDB]: https://www.mongodb.com/ - DBSystemNameMongoDB = DBSystemNameKey.String("mongodb") - // [Microsoft SQL Server] - // Stability: release_candidate - // - // [Microsoft SQL Server]: https://www.microsoft.com/sql-server - DBSystemNameMicrosoftSQLServer = DBSystemNameKey.String("microsoft.sql_server") - // [MySQL] - // Stability: release_candidate - // - // [MySQL]: https://www.mysql.com/ - DBSystemNameMySQL = DBSystemNameKey.String("mysql") - // [Neo4j] - // Stability: development - // - // [Neo4j]: https://neo4j.com/ - DBSystemNameNeo4j = DBSystemNameKey.String("neo4j") - // [OpenSearch] - // Stability: development - // - // [OpenSearch]: https://opensearch.org/ - DBSystemNameOpensearch = DBSystemNameKey.String("opensearch") - // [Oracle Database] - // Stability: development - // - // [Oracle Database]: https://www.oracle.com/database/ - DBSystemNameOracleDB = DBSystemNameKey.String("oracle.db") - // [PostgreSQL] - // Stability: release_candidate - // - // [PostgreSQL]: https://www.postgresql.org/ - DBSystemNamePostgreSQL = DBSystemNameKey.String("postgresql") - // [Redis] - // Stability: development - // - // [Redis]: https://redis.io/ - DBSystemNameRedis = DBSystemNameKey.String("redis") - // [SAP HANA] - // Stability: development - // - // [SAP HANA]: https://www.sap.com/products/technology-platform/hana/what-is-sap-hana.html - DBSystemNameSapHana = DBSystemNameKey.String("sap.hana") - // [SAP MaxDB] - // Stability: development - // - // [SAP MaxDB]: https://maxdb.sap.com/ - DBSystemNameSapMaxDB = DBSystemNameKey.String("sap.maxdb") - // [SQLite] - // Stability: development - // - // [SQLite]: https://www.sqlite.org/ - DBSystemNameSqlite = DBSystemNameKey.String("sqlite") - // [Teradata] - // Stability: development - // - // [Teradata]: https://www.teradata.com/ - DBSystemNameTeradata = DBSystemNameKey.String("teradata") - // [Trino] - // Stability: development - // - // [Trino]: https://trino.io/ - DBSystemNameTrino = DBSystemNameKey.String("trino") -) - -// Namespace: deployment -const ( - // DeploymentEnvironmentNameKey is the attribute Key conforming to the - // "deployment.environment.name" semantic conventions. It represents the name of - // the [deployment environment] (aka deployment tier). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "staging", "production" - // Note: `deployment.environment.name` does not affect the uniqueness - // constraints defined through - // the `service.namespace`, `service.name` and `service.instance.id` resource - // attributes. - // This implies that resources carrying the following attribute combinations - // MUST be - // considered to be identifying the same service: - // - // - `service.name=frontend`, `deployment.environment.name=production` - // - `service.name=frontend`, `deployment.environment.name=staging`. - // - // - // [deployment environment]: https://wikipedia.org/wiki/Deployment_environment - DeploymentEnvironmentNameKey = attribute.Key("deployment.environment.name") - - // DeploymentIDKey is the attribute Key conforming to the "deployment.id" - // semantic conventions. It represents the id of the deployment. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1208" - DeploymentIDKey = attribute.Key("deployment.id") - - // DeploymentNameKey is the attribute Key conforming to the "deployment.name" - // semantic conventions. It represents the name of the deployment. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "deploy my app", "deploy-frontend" - DeploymentNameKey = attribute.Key("deployment.name") - - // DeploymentStatusKey is the attribute Key conforming to the - // "deployment.status" semantic conventions. It represents the status of the - // deployment. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - DeploymentStatusKey = attribute.Key("deployment.status") -) - -// DeploymentEnvironmentName returns an attribute KeyValue conforming to the -// "deployment.environment.name" semantic conventions. It represents the name of -// the [deployment environment] (aka deployment tier). -// -// [deployment environment]: https://wikipedia.org/wiki/Deployment_environment -func DeploymentEnvironmentName(val string) attribute.KeyValue { - return DeploymentEnvironmentNameKey.String(val) -} - -// DeploymentID returns an attribute KeyValue conforming to the "deployment.id" -// semantic conventions. It represents the id of the deployment. -func DeploymentID(val string) attribute.KeyValue { - return DeploymentIDKey.String(val) -} - -// DeploymentName returns an attribute KeyValue conforming to the -// "deployment.name" semantic conventions. It represents the name of the -// deployment. -func DeploymentName(val string) attribute.KeyValue { - return DeploymentNameKey.String(val) -} - -// Enum values for deployment.status -var ( - // failed - // Stability: development - DeploymentStatusFailed = DeploymentStatusKey.String("failed") - // succeeded - // Stability: development - DeploymentStatusSucceeded = DeploymentStatusKey.String("succeeded") -) - -// Namespace: destination -const ( - // DestinationAddressKey is the attribute Key conforming to the - // "destination.address" semantic conventions. It represents the destination - // address - domain name if available without reverse DNS lookup; otherwise, IP - // address or Unix domain socket name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "destination.example.com", "10.1.2.80", "/tmp/my.sock" - // Note: When observed from the source side, and when communicating through an - // intermediary, `destination.address` SHOULD represent the destination address - // behind any intermediaries, for example proxies, if it's available. - DestinationAddressKey = attribute.Key("destination.address") - - // DestinationPortKey is the attribute Key conforming to the "destination.port" - // semantic conventions. It represents the destination port number. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 3389, 2888 - DestinationPortKey = attribute.Key("destination.port") -) - -// DestinationAddress returns an attribute KeyValue conforming to the -// "destination.address" semantic conventions. It represents the destination -// address - domain name if available without reverse DNS lookup; otherwise, IP -// address or Unix domain socket name. -func DestinationAddress(val string) attribute.KeyValue { - return DestinationAddressKey.String(val) -} - -// DestinationPort returns an attribute KeyValue conforming to the -// "destination.port" semantic conventions. It represents the destination port -// number. -func DestinationPort(val int) attribute.KeyValue { - return DestinationPortKey.Int(val) -} - -// Namespace: device -const ( - // DeviceIDKey is the attribute Key conforming to the "device.id" semantic - // conventions. It represents a unique identifier representing the device. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // 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]. 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] 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. - // - // [vendor identifier]: https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor - // [here]: https://developer.android.com/training/articles/user-data-ids - DeviceIDKey = attribute.Key("device.id") - - // DeviceManufacturerKey is the attribute Key conforming to the - // "device.manufacturer" semantic conventions. It represents the name of the - // device manufacturer. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Apple", "Samsung" - // Note: The Android OS provides this field via [Build]. iOS apps SHOULD - // hardcode the value `Apple`. - // - // [Build]: https://developer.android.com/reference/android/os/Build#MANUFACTURER - DeviceManufacturerKey = attribute.Key("device.manufacturer") - - // DeviceModelIdentifierKey is the attribute Key conforming to the - // "device.model.identifier" semantic conventions. It represents the model - // identifier for the device. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "iPhone3,4", "SM-G920F" - // Note: It's recommended this value represents a machine-readable version of - // the model identifier rather than the market or consumer-friendly name of the - // device. - DeviceModelIdentifierKey = attribute.Key("device.model.identifier") - - // DeviceModelNameKey is the attribute Key conforming to the "device.model.name" - // semantic conventions. It represents the marketing name for the device model. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "iPhone 6s Plus", "Samsung Galaxy S6" - // Note: It's recommended this value represents a human-readable version of the - // device model rather than a machine-readable alternative. - DeviceModelNameKey = attribute.Key("device.model.name") -) - -// DeviceID returns an attribute KeyValue conforming to the "device.id" semantic -// conventions. It represents a unique identifier representing the device. -func DeviceID(val string) attribute.KeyValue { - return DeviceIDKey.String(val) -} - -// DeviceManufacturer returns an attribute KeyValue conforming to the -// "device.manufacturer" semantic conventions. It represents the name of the -// device manufacturer. -func DeviceManufacturer(val string) attribute.KeyValue { - return DeviceManufacturerKey.String(val) -} - -// DeviceModelIdentifier returns an attribute KeyValue conforming to the -// "device.model.identifier" semantic conventions. It represents the model -// identifier for the device. -func DeviceModelIdentifier(val string) attribute.KeyValue { - return DeviceModelIdentifierKey.String(val) -} - -// DeviceModelName returns an attribute KeyValue conforming to the -// "device.model.name" semantic conventions. It represents the marketing name for -// the device model. -func DeviceModelName(val string) attribute.KeyValue { - return DeviceModelNameKey.String(val) -} - -// Namespace: disk -const ( - // DiskIoDirectionKey is the attribute Key conforming to the "disk.io.direction" - // semantic conventions. It represents the disk IO operation direction. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "read" - DiskIoDirectionKey = attribute.Key("disk.io.direction") -) - -// Enum values for disk.io.direction -var ( - // read - // Stability: development - DiskIoDirectionRead = DiskIoDirectionKey.String("read") - // write - // Stability: development - DiskIoDirectionWrite = DiskIoDirectionKey.String("write") -) - -// Namespace: dns -const ( - // DNSQuestionNameKey is the attribute Key conforming to the "dns.question.name" - // semantic conventions. It represents the name being queried. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "www.example.com", "opentelemetry.io" - // Note: If the name field contains non-printable characters (below 32 or above - // 126), those characters should be represented as escaped base 10 integers - // (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, - // and line feeds should be converted to \t, \r, and \n respectively. - DNSQuestionNameKey = attribute.Key("dns.question.name") -) - -// DNSQuestionName returns an attribute KeyValue conforming to the -// "dns.question.name" semantic conventions. It represents the name being -// queried. -func DNSQuestionName(val string) attribute.KeyValue { - return DNSQuestionNameKey.String(val) -} - -// Namespace: elasticsearch -const ( - // ElasticsearchNodeNameKey is the attribute Key conforming to the - // "elasticsearch.node.name" semantic conventions. It represents the represents - // the human-readable identifier of the node/instance to which a request was - // routed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "instance-0000000001" - ElasticsearchNodeNameKey = attribute.Key("elasticsearch.node.name") -) - -// ElasticsearchNodeName returns an attribute KeyValue conforming to the -// "elasticsearch.node.name" semantic conventions. It represents the represents -// the human-readable identifier of the node/instance to which a request was -// routed. -func ElasticsearchNodeName(val string) attribute.KeyValue { - return ElasticsearchNodeNameKey.String(val) -} - -// Namespace: error -const ( - // ErrorTypeKey is the attribute Key conforming to the "error.type" semantic - // conventions. It represents the describes a class of error the operation ended - // with. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "timeout", "java.net.UnknownHostException", - // "server_certificate_invalid", "500" - // Note: The `error.type` SHOULD be predictable, and SHOULD have low - // cardinality. - // - // When `error.type` is set to a type (e.g., an exception type), its - // canonical class name identifying the type within the artifact SHOULD be used. - // - // Instrumentations SHOULD document the list of errors they report. - // - // The cardinality of `error.type` within one instrumentation library SHOULD be - // low. - // Telemetry consumers that aggregate data from multiple instrumentation - // libraries and applications - // should be prepared for `error.type` to have high cardinality at query time - // when no - // additional filters are applied. - // - // If the operation has completed successfully, instrumentations SHOULD NOT set - // `error.type`. - // - // If a specific domain defines its own set of error identifiers (such as HTTP - // or gRPC status codes), - // it's RECOMMENDED to: - // - // - Use a domain-specific attribute - // - Set `error.type` to capture all errors, regardless of whether they are - // defined within the domain-specific set or not. - ErrorTypeKey = attribute.Key("error.type") -) - -// Enum values for error.type -var ( - // A fallback error value to be used when the instrumentation doesn't define a - // custom value. - // - // Stability: stable - ErrorTypeOther = ErrorTypeKey.String("_OTHER") -) - -// Namespace: exception -const ( - // ExceptionMessageKey is the attribute Key conforming to the - // "exception.message" semantic conventions. It represents the exception - // message. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "Division by zero", "Can't convert 'int' object to str implicitly" - ExceptionMessageKey = attribute.Key("exception.message") - - // ExceptionStacktraceKey is the attribute Key conforming to the - // "exception.stacktrace" semantic conventions. It represents a stacktrace as a - // string in the natural representation for the language runtime. The - // representation is to be determined and documented by each language SIG. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: Exception in thread "main" java.lang.RuntimeException: Test - // exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at - // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at - // com.example.GenerateTrace.main(GenerateTrace.java:5) - ExceptionStacktraceKey = attribute.Key("exception.stacktrace") - - // ExceptionTypeKey is the attribute Key conforming to the "exception.type" - // semantic conventions. It represents the type of the exception (its - // fully-qualified class name, if applicable). The dynamic type of the exception - // should be preferred over the static type in languages that support it. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "java.net.ConnectException", "OSError" - ExceptionTypeKey = attribute.Key("exception.type") -) - -// ExceptionMessage returns an attribute KeyValue conforming to the -// "exception.message" semantic conventions. It represents the exception message. -func ExceptionMessage(val string) attribute.KeyValue { - return ExceptionMessageKey.String(val) -} - -// ExceptionStacktrace returns an attribute KeyValue conforming to the -// "exception.stacktrace" semantic conventions. It represents a stacktrace as a -// string in the natural representation for the language runtime. The -// representation is to be determined and documented by each language SIG. -func ExceptionStacktrace(val string) attribute.KeyValue { - return ExceptionStacktraceKey.String(val) -} - -// ExceptionType returns an attribute KeyValue conforming to the "exception.type" -// semantic conventions. It represents the type of the exception (its -// fully-qualified class name, if applicable). The dynamic type of the exception -// should be preferred over the static type in languages that support it. -func ExceptionType(val string) attribute.KeyValue { - return ExceptionTypeKey.String(val) -} - -// Namespace: faas -const ( - // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" - // semantic conventions. It represents a boolean that is true if the serverless - // function is executed for the first time (aka cold-start). - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - FaaSColdstartKey = attribute.Key("faas.coldstart") - - // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic - // conventions. It represents a string containing the schedule period as - // [Cron Expression]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0/5 * * * ? * - // - // [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm - FaaSCronKey = attribute.Key("faas.cron") - - // FaaSDocumentCollectionKey is the attribute Key conforming to the - // "faas.document.collection" semantic conventions. It represents the name of - // the source on which the triggering operation was performed. For example, in - // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the - // database name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "myBucketName", "myDbName" - FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") - - // FaaSDocumentNameKey is the attribute Key conforming to the - // "faas.document.name" semantic conventions. It represents the document - // name/table subjected to the operation. For example, in Cloud Storage or S3 is - // the name of the file, and in Cosmos DB the table name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "myFile.txt", "myTableName" - FaaSDocumentNameKey = attribute.Key("faas.document.name") - - // FaaSDocumentOperationKey is the attribute Key conforming to the - // "faas.document.operation" semantic conventions. It represents the describes - // the type of the operation that was performed on the data. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - FaaSDocumentOperationKey = attribute.Key("faas.document.operation") - - // FaaSDocumentTimeKey is the attribute Key conforming to the - // "faas.document.time" semantic conventions. It represents a string containing - // the time when the data was accessed in the [ISO 8601] format expressed in - // [UTC]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 2020-01-23T13:47:06Z - // - // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html - // [UTC]: https://www.w3.org/TR/NOTE-datetime - FaaSDocumentTimeKey = attribute.Key("faas.document.time") - - // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" - // semantic conventions. It represents the execution environment ID as a string, - // that will be potentially reused for other invocations to the same - // function/function version. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de" - // Note: - **AWS Lambda:** Use the (full) log stream name. - FaaSInstanceKey = attribute.Key("faas.instance") - - // FaaSInvocationIDKey is the attribute Key conforming to the - // "faas.invocation_id" semantic conventions. It represents the invocation ID of - // the current function invocation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: af9d5aa4-a685-4c5f-a22b-444f80b3cc28 - FaaSInvocationIDKey = attribute.Key("faas.invocation_id") - - // FaaSInvokedNameKey is the attribute Key conforming to the "faas.invoked_name" - // semantic conventions. It represents the name of the invoked function. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: my-function - // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked - // function. - FaaSInvokedNameKey = attribute.Key("faas.invoked_name") - - // FaaSInvokedProviderKey is the attribute Key conforming to the - // "faas.invoked_provider" semantic conventions. It represents the cloud - // provider of the invoked function. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: SHOULD be equal to the `cloud.provider` resource attribute of the - // invoked function. - FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") - - // FaaSInvokedRegionKey is the attribute Key conforming to the - // "faas.invoked_region" semantic conventions. It represents the cloud region of - // the invoked function. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: eu-central-1 - // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked - // function. - FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") - - // FaaSMaxMemoryKey is the attribute Key conforming to the "faas.max_memory" - // semantic conventions. It represents the amount of memory available to the - // serverless function converted to Bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Note: It's recommended to set this attribute since e.g. too little memory can - // easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, - // the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this - // information (which must be multiplied by 1,048,576). - FaaSMaxMemoryKey = attribute.Key("faas.max_memory") - - // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic - // conventions. It represents the name of the single function that this runtime - // instance executes. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-function", "myazurefunctionapp/some-function-name" - // Note: This is the name of the function as configured/deployed on the FaaS - // platform and is usually different from the name of the callback - // function (which may be stored in the - // [`code.namespace`/`code.function.name`] - // span attributes). - // - // For some cloud providers, the above definition is ambiguous. The following - // definition of function name MUST be used for this attribute - // (and consequently the span name) for the listed cloud providers/products: - // - // - **Azure:** The full name `/`, i.e., function app name - // followed by a forward slash followed by the function name (this form - // can also be seen in the resource JSON for the function). - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider (see also the `cloud.resource_id` attribute). - // - // - // [`code.namespace`/`code.function.name`]: /docs/general/attributes.md#source-code-attributes - FaaSNameKey = attribute.Key("faas.name") - - // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic - // conventions. It represents a string containing the function invocation time - // in the [ISO 8601] format expressed in [UTC]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 2020-01-23T13:47:06Z - // - // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html - // [UTC]: https://www.w3.org/TR/NOTE-datetime - FaaSTimeKey = attribute.Key("faas.time") - - // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" semantic - // conventions. It represents the type of the trigger which caused this function - // invocation. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - FaaSTriggerKey = attribute.Key("faas.trigger") - - // FaaSVersionKey is the attribute Key conforming to the "faas.version" semantic - // conventions. It represents the immutable version of the function being - // executed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "26", "pinkfroid-00002" - // Note: Depending on the cloud provider and platform, use: - // - // - **AWS Lambda:** The [function version] - // (an integer represented as a decimal string). - // - **Google Cloud Run (Services):** The [revision] - // (i.e., the function name plus the revision suffix). - // - **Google Cloud Functions:** The value of the - // [`K_REVISION` environment variable]. - // - **Azure Functions:** Not applicable. Do not set this attribute. - // - // - // [function version]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html - // [revision]: https://cloud.google.com/run/docs/managing/revisions - // [`K_REVISION` environment variable]: https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically - FaaSVersionKey = attribute.Key("faas.version") -) - -// FaaSColdstart returns an attribute KeyValue conforming to the "faas.coldstart" -// semantic conventions. It represents a boolean that is true if the serverless -// function is executed for the first time (aka cold-start). -func FaaSColdstart(val bool) attribute.KeyValue { - return FaaSColdstartKey.Bool(val) -} - -// FaaSCron returns an attribute KeyValue conforming to the "faas.cron" semantic -// conventions. It represents a string containing the schedule period as -// [Cron Expression]. -// -// [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm -func FaaSCron(val string) attribute.KeyValue { - return FaaSCronKey.String(val) -} - -// FaaSDocumentCollection returns an attribute KeyValue conforming to the -// "faas.document.collection" semantic conventions. It represents the name of the -// source on which the triggering operation was performed. For example, in Cloud -// Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database -// name. -func FaaSDocumentCollection(val string) attribute.KeyValue { - return FaaSDocumentCollectionKey.String(val) -} - -// FaaSDocumentName returns an attribute KeyValue conforming to the -// "faas.document.name" semantic conventions. It represents the document -// name/table subjected to the operation. For example, in Cloud Storage or S3 is -// the name of the file, and in Cosmos DB the table name. -func FaaSDocumentName(val string) attribute.KeyValue { - return FaaSDocumentNameKey.String(val) -} - -// FaaSDocumentTime returns an attribute KeyValue conforming to the -// "faas.document.time" semantic conventions. It represents a string containing -// the time when the data was accessed in the [ISO 8601] format expressed in -// [UTC]. -// -// [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html -// [UTC]: https://www.w3.org/TR/NOTE-datetime -func FaaSDocumentTime(val string) attribute.KeyValue { - return FaaSDocumentTimeKey.String(val) -} - -// FaaSInstance returns an attribute KeyValue conforming to the "faas.instance" -// semantic conventions. It represents the execution environment ID as a string, -// that will be potentially reused for other invocations to the same -// function/function version. -func FaaSInstance(val string) attribute.KeyValue { - return FaaSInstanceKey.String(val) -} - -// FaaSInvocationID returns an attribute KeyValue conforming to the -// "faas.invocation_id" semantic conventions. It represents the invocation ID of -// the current function invocation. -func FaaSInvocationID(val string) attribute.KeyValue { - return FaaSInvocationIDKey.String(val) -} - -// FaaSInvokedName returns an attribute KeyValue conforming to the -// "faas.invoked_name" semantic conventions. It represents the name of the -// invoked function. -func FaaSInvokedName(val string) attribute.KeyValue { - return FaaSInvokedNameKey.String(val) -} - -// FaaSInvokedRegion returns an attribute KeyValue conforming to the -// "faas.invoked_region" semantic conventions. It represents the cloud region of -// the invoked function. -func FaaSInvokedRegion(val string) attribute.KeyValue { - return FaaSInvokedRegionKey.String(val) -} - -// FaaSMaxMemory returns an attribute KeyValue conforming to the -// "faas.max_memory" semantic conventions. It represents the amount of memory -// available to the serverless function converted to Bytes. -func FaaSMaxMemory(val int) attribute.KeyValue { - return FaaSMaxMemoryKey.Int(val) -} - -// FaaSName returns an attribute KeyValue conforming to the "faas.name" semantic -// conventions. It represents the name of the single function that this runtime -// instance executes. -func FaaSName(val string) attribute.KeyValue { - return FaaSNameKey.String(val) -} - -// FaaSTime returns an attribute KeyValue conforming to the "faas.time" semantic -// conventions. It represents a string containing the function invocation time in -// the [ISO 8601] format expressed in [UTC]. -// -// [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html -// [UTC]: https://www.w3.org/TR/NOTE-datetime -func FaaSTime(val string) attribute.KeyValue { - return FaaSTimeKey.String(val) -} - -// FaaSVersion returns an attribute KeyValue conforming to the "faas.version" -// semantic conventions. It represents the immutable version of the function -// being executed. -func FaaSVersion(val string) attribute.KeyValue { - return FaaSVersionKey.String(val) -} - -// Enum values for faas.document.operation -var ( - // When a new object is created. - // Stability: development - FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") - // When an object is modified. - // Stability: development - FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") - // When an object is deleted. - // Stability: development - FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") -) - -// Enum values for faas.invoked_provider -var ( - // Alibaba Cloud - // Stability: development - FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") - // Amazon Web Services - // Stability: development - FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") - // Microsoft Azure - // Stability: development - FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") - // Google Cloud Platform - // Stability: development - FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") - // Tencent Cloud - // Stability: development - FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") -) - -// Enum values for faas.trigger -var ( - // A response to some data source operation such as a database or filesystem - // read/write - // Stability: development - FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") - // To provide an answer to an inbound HTTP request - // Stability: development - FaaSTriggerHTTP = FaaSTriggerKey.String("http") - // A function is set to be executed when messages are sent to a messaging system - // Stability: development - FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") - // A function is scheduled to be executed regularly - // Stability: development - FaaSTriggerTimer = FaaSTriggerKey.String("timer") - // If none of the others apply - // Stability: development - FaaSTriggerOther = FaaSTriggerKey.String("other") -) - -// Namespace: feature_flag -const ( - // FeatureFlagContextIDKey is the attribute Key conforming to the - // "feature_flag.context.id" semantic conventions. It represents the unique - // identifier for the flag evaluation context. For example, the targeting key. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "5157782b-2203-4c80-a857-dbbd5e7761db" - FeatureFlagContextIDKey = attribute.Key("feature_flag.context.id") - - // FeatureFlagEvaluationErrorMessageKey is the attribute Key conforming to the - // "feature_flag.evaluation.error.message" semantic conventions. It represents a - // message explaining the nature of an error occurring during flag evaluation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Flag `header-color` expected type `string` but found type `number` - // " - FeatureFlagEvaluationErrorMessageKey = attribute.Key("feature_flag.evaluation.error.message") - - // FeatureFlagEvaluationReasonKey is the attribute Key conforming to the - // "feature_flag.evaluation.reason" semantic conventions. It represents the - // reason code which shows how a feature flag value was determined. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "static", "targeting_match", "error", "default" - FeatureFlagEvaluationReasonKey = attribute.Key("feature_flag.evaluation.reason") - - // FeatureFlagKeyKey is the attribute Key conforming to the "feature_flag.key" - // semantic conventions. It represents the lookup key of the feature flag. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "logo-color" - FeatureFlagKeyKey = attribute.Key("feature_flag.key") - - // FeatureFlagProviderNameKey is the attribute Key conforming to the - // "feature_flag.provider_name" semantic conventions. It represents the - // identifies the feature flag provider. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Flag Manager" - FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name") - - // FeatureFlagSetIDKey is the attribute Key conforming to the - // "feature_flag.set.id" semantic conventions. It represents the identifier of - // the [flag set] to which the feature flag belongs. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "proj-1", "ab98sgs", "service1/dev" - // - // [flag set]: https://openfeature.dev/specification/glossary/#flag-set - FeatureFlagSetIDKey = attribute.Key("feature_flag.set.id") - - // FeatureFlagVariantKey is the attribute Key conforming to the - // "feature_flag.variant" semantic conventions. It represents a semantic - // identifier for an evaluated flag value. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "red", "true", "on" - // Note: A semantic identifier, commonly referred to as a variant, provides a - // means - // for referring to a value without including the value itself. This can - // provide additional context for understanding the meaning behind a value. - // For example, the variant `red` maybe be used for the value `#c05543`. - FeatureFlagVariantKey = attribute.Key("feature_flag.variant") - - // FeatureFlagVersionKey is the attribute Key conforming to the - // "feature_flag.version" semantic conventions. It represents the version of the - // ruleset used during the evaluation. This may be any stable value which - // uniquely identifies the ruleset. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1", "01ABCDEF" - FeatureFlagVersionKey = attribute.Key("feature_flag.version") -) - -// FeatureFlagContextID returns an attribute KeyValue conforming to the -// "feature_flag.context.id" semantic conventions. It represents the unique -// identifier for the flag evaluation context. For example, the targeting key. -func FeatureFlagContextID(val string) attribute.KeyValue { - return FeatureFlagContextIDKey.String(val) -} - -// FeatureFlagEvaluationErrorMessage returns an attribute KeyValue conforming to -// the "feature_flag.evaluation.error.message" semantic conventions. It -// represents a message explaining the nature of an error occurring during flag -// evaluation. -func FeatureFlagEvaluationErrorMessage(val string) attribute.KeyValue { - return FeatureFlagEvaluationErrorMessageKey.String(val) -} - -// FeatureFlagKey returns an attribute KeyValue conforming to the -// "feature_flag.key" semantic conventions. It represents the lookup key of the -// feature flag. -func FeatureFlagKey(val string) attribute.KeyValue { - return FeatureFlagKeyKey.String(val) -} - -// FeatureFlagProviderName returns an attribute KeyValue conforming to the -// "feature_flag.provider_name" semantic conventions. It represents the -// identifies the feature flag provider. -func FeatureFlagProviderName(val string) attribute.KeyValue { - return FeatureFlagProviderNameKey.String(val) -} - -// FeatureFlagSetID returns an attribute KeyValue conforming to the -// "feature_flag.set.id" semantic conventions. It represents the identifier of -// the [flag set] to which the feature flag belongs. -// -// [flag set]: https://openfeature.dev/specification/glossary/#flag-set -func FeatureFlagSetID(val string) attribute.KeyValue { - return FeatureFlagSetIDKey.String(val) -} - -// FeatureFlagVariant returns an attribute KeyValue conforming to the -// "feature_flag.variant" semantic conventions. It represents a semantic -// identifier for an evaluated flag value. -func FeatureFlagVariant(val string) attribute.KeyValue { - return FeatureFlagVariantKey.String(val) -} - -// FeatureFlagVersion returns an attribute KeyValue conforming to the -// "feature_flag.version" semantic conventions. It represents the version of the -// ruleset used during the evaluation. This may be any stable value which -// uniquely identifies the ruleset. -func FeatureFlagVersion(val string) attribute.KeyValue { - return FeatureFlagVersionKey.String(val) -} - -// Enum values for feature_flag.evaluation.reason -var ( - // The resolved value is static (no dynamic evaluation). - // Stability: development - FeatureFlagEvaluationReasonStatic = FeatureFlagEvaluationReasonKey.String("static") - // The resolved value fell back to a pre-configured value (no dynamic evaluation - // occurred or dynamic evaluation yielded no result). - // Stability: development - FeatureFlagEvaluationReasonDefault = FeatureFlagEvaluationReasonKey.String("default") - // The resolved value was the result of a dynamic evaluation, such as a rule or - // specific user-targeting. - // Stability: development - FeatureFlagEvaluationReasonTargetingMatch = FeatureFlagEvaluationReasonKey.String("targeting_match") - // The resolved value was the result of pseudorandom assignment. - // Stability: development - FeatureFlagEvaluationReasonSplit = FeatureFlagEvaluationReasonKey.String("split") - // The resolved value was retrieved from cache. - // Stability: development - FeatureFlagEvaluationReasonCached = FeatureFlagEvaluationReasonKey.String("cached") - // The resolved value was the result of the flag being disabled in the - // management system. - // Stability: development - FeatureFlagEvaluationReasonDisabled = FeatureFlagEvaluationReasonKey.String("disabled") - // The reason for the resolved value could not be determined. - // Stability: development - FeatureFlagEvaluationReasonUnknown = FeatureFlagEvaluationReasonKey.String("unknown") - // The resolved value is non-authoritative or possibly out of date - // Stability: development - FeatureFlagEvaluationReasonStale = FeatureFlagEvaluationReasonKey.String("stale") - // The resolved value was the result of an error. - // Stability: development - FeatureFlagEvaluationReasonError = FeatureFlagEvaluationReasonKey.String("error") -) - -// Namespace: file -const ( - // FileAccessedKey is the attribute Key conforming to the "file.accessed" - // semantic conventions. It represents the time when the file was last accessed, - // in ISO 8601 format. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021-01-01T12:00:00Z" - // Note: This attribute might not be supported by some file systems — NFS, - // FAT32, in embedded OS, etc. - FileAccessedKey = attribute.Key("file.accessed") - - // FileAttributesKey is the attribute Key conforming to the "file.attributes" - // semantic conventions. It represents the array of file attributes. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "readonly", "hidden" - // Note: Attributes names depend on the OS or file system. Here’s a - // non-exhaustive list of values expected for this attribute: `archive`, - // `compressed`, `directory`, `encrypted`, `execute`, `hidden`, `immutable`, - // `journaled`, `read`, `readonly`, `symbolic link`, `system`, `temporary`, - // `write`. - FileAttributesKey = attribute.Key("file.attributes") - - // FileChangedKey is the attribute Key conforming to the "file.changed" semantic - // conventions. It represents the time when the file attributes or metadata was - // last changed, in ISO 8601 format. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021-01-01T12:00:00Z" - // Note: `file.changed` captures the time when any of the file's properties or - // attributes (including the content) are changed, while `file.modified` - // captures the timestamp when the file content is modified. - FileChangedKey = attribute.Key("file.changed") - - // FileCreatedKey is the attribute Key conforming to the "file.created" semantic - // conventions. It represents the time when the file was created, in ISO 8601 - // format. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021-01-01T12:00:00Z" - // Note: This attribute might not be supported by some file systems — NFS, - // FAT32, in embedded OS, etc. - FileCreatedKey = attribute.Key("file.created") - - // FileDirectoryKey is the attribute Key conforming to the "file.directory" - // semantic conventions. It represents the directory where the file is located. - // It should include the drive letter, when appropriate. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/home/user", "C:\Program Files\MyApp" - FileDirectoryKey = attribute.Key("file.directory") - - // FileExtensionKey is the attribute Key conforming to the "file.extension" - // semantic conventions. It represents the file extension, excluding the leading - // dot. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "png", "gz" - // Note: When the file name has multiple extensions (example.tar.gz), only the - // last one should be captured ("gz", not "tar.gz"). - FileExtensionKey = attribute.Key("file.extension") - - // FileForkNameKey is the attribute Key conforming to the "file.fork_name" - // semantic conventions. It represents the name of the fork. A fork is - // additional data associated with a filesystem object. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Zone.Identifer" - // Note: On Linux, a resource fork is used to store additional data with a - // filesystem object. A file always has at least one fork for the data portion, - // and additional forks may exist. - // On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default - // data stream for a file is just called $DATA. Zone.Identifier is commonly used - // by Windows to track contents downloaded from the Internet. An ADS is - // typically of the form: C:\path\to\filename.extension:some_fork_name, and - // some_fork_name is the value that should populate `fork_name`. - // `filename.extension` should populate `file.name`, and `extension` should - // populate `file.extension`. The full path, `file.path`, will include the fork - // name. - FileForkNameKey = attribute.Key("file.fork_name") - - // FileGroupIDKey is the attribute Key conforming to the "file.group.id" - // semantic conventions. It represents the primary Group ID (GID) of the file. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1000" - FileGroupIDKey = attribute.Key("file.group.id") - - // FileGroupNameKey is the attribute Key conforming to the "file.group.name" - // semantic conventions. It represents the primary group name of the file. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "users" - FileGroupNameKey = attribute.Key("file.group.name") - - // FileInodeKey is the attribute Key conforming to the "file.inode" semantic - // conventions. It represents the inode representing the file in the filesystem. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "256383" - FileInodeKey = attribute.Key("file.inode") - - // FileModeKey is the attribute Key conforming to the "file.mode" semantic - // conventions. It represents the mode of the file in octal representation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0640" - FileModeKey = attribute.Key("file.mode") - - // FileModifiedKey is the attribute Key conforming to the "file.modified" - // semantic conventions. It represents the time when the file content was last - // modified, in ISO 8601 format. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021-01-01T12:00:00Z" - FileModifiedKey = attribute.Key("file.modified") - - // FileNameKey is the attribute Key conforming to the "file.name" semantic - // conventions. It represents the name of the file including the extension, - // without the directory. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "example.png" - FileNameKey = attribute.Key("file.name") - - // FileOwnerIDKey is the attribute Key conforming to the "file.owner.id" - // semantic conventions. It represents the user ID (UID) or security identifier - // (SID) of the file owner. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1000" - FileOwnerIDKey = attribute.Key("file.owner.id") - - // FileOwnerNameKey is the attribute Key conforming to the "file.owner.name" - // semantic conventions. It represents the username of the file owner. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "root" - FileOwnerNameKey = attribute.Key("file.owner.name") - - // FilePathKey is the attribute Key conforming to the "file.path" semantic - // conventions. It represents the full path to the file, including the file - // name. It should include the drive letter, when appropriate. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/home/alice/example.png", "C:\Program Files\MyApp\myapp.exe" - FilePathKey = attribute.Key("file.path") - - // FileSizeKey is the attribute Key conforming to the "file.size" semantic - // conventions. It represents the file size in bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - FileSizeKey = attribute.Key("file.size") - - // FileSymbolicLinkTargetPathKey is the attribute Key conforming to the - // "file.symbolic_link.target_path" semantic conventions. It represents the path - // to the target of a symbolic link. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/usr/bin/python3" - // Note: This attribute is only applicable to symbolic links. - FileSymbolicLinkTargetPathKey = attribute.Key("file.symbolic_link.target_path") -) - -// FileAccessed returns an attribute KeyValue conforming to the "file.accessed" -// semantic conventions. It represents the time when the file was last accessed, -// in ISO 8601 format. -func FileAccessed(val string) attribute.KeyValue { - return FileAccessedKey.String(val) -} - -// FileAttributes returns an attribute KeyValue conforming to the -// "file.attributes" semantic conventions. It represents the array of file -// attributes. -func FileAttributes(val ...string) attribute.KeyValue { - return FileAttributesKey.StringSlice(val) -} - -// FileChanged returns an attribute KeyValue conforming to the "file.changed" -// semantic conventions. It represents the time when the file attributes or -// metadata was last changed, in ISO 8601 format. -func FileChanged(val string) attribute.KeyValue { - return FileChangedKey.String(val) -} - -// FileCreated returns an attribute KeyValue conforming to the "file.created" -// semantic conventions. It represents the time when the file was created, in ISO -// 8601 format. -func FileCreated(val string) attribute.KeyValue { - return FileCreatedKey.String(val) -} - -// FileDirectory returns an attribute KeyValue conforming to the "file.directory" -// semantic conventions. It represents the directory where the file is located. -// It should include the drive letter, when appropriate. -func FileDirectory(val string) attribute.KeyValue { - return FileDirectoryKey.String(val) -} - -// FileExtension returns an attribute KeyValue conforming to the "file.extension" -// semantic conventions. It represents the file extension, excluding the leading -// dot. -func FileExtension(val string) attribute.KeyValue { - return FileExtensionKey.String(val) -} - -// FileForkName returns an attribute KeyValue conforming to the "file.fork_name" -// semantic conventions. It represents the name of the fork. A fork is additional -// data associated with a filesystem object. -func FileForkName(val string) attribute.KeyValue { - return FileForkNameKey.String(val) -} - -// FileGroupID returns an attribute KeyValue conforming to the "file.group.id" -// semantic conventions. It represents the primary Group ID (GID) of the file. -func FileGroupID(val string) attribute.KeyValue { - return FileGroupIDKey.String(val) -} - -// FileGroupName returns an attribute KeyValue conforming to the -// "file.group.name" semantic conventions. It represents the primary group name -// of the file. -func FileGroupName(val string) attribute.KeyValue { - return FileGroupNameKey.String(val) -} - -// FileInode returns an attribute KeyValue conforming to the "file.inode" -// semantic conventions. It represents the inode representing the file in the -// filesystem. -func FileInode(val string) attribute.KeyValue { - return FileInodeKey.String(val) -} - -// FileMode returns an attribute KeyValue conforming to the "file.mode" semantic -// conventions. It represents the mode of the file in octal representation. -func FileMode(val string) attribute.KeyValue { - return FileModeKey.String(val) -} - -// FileModified returns an attribute KeyValue conforming to the "file.modified" -// semantic conventions. It represents the time when the file content was last -// modified, in ISO 8601 format. -func FileModified(val string) attribute.KeyValue { - return FileModifiedKey.String(val) -} - -// FileName returns an attribute KeyValue conforming to the "file.name" semantic -// conventions. It represents the name of the file including the extension, -// without the directory. -func FileName(val string) attribute.KeyValue { - return FileNameKey.String(val) -} - -// FileOwnerID returns an attribute KeyValue conforming to the "file.owner.id" -// semantic conventions. It represents the user ID (UID) or security identifier -// (SID) of the file owner. -func FileOwnerID(val string) attribute.KeyValue { - return FileOwnerIDKey.String(val) -} - -// FileOwnerName returns an attribute KeyValue conforming to the -// "file.owner.name" semantic conventions. It represents the username of the file -// owner. -func FileOwnerName(val string) attribute.KeyValue { - return FileOwnerNameKey.String(val) -} - -// FilePath returns an attribute KeyValue conforming to the "file.path" semantic -// conventions. It represents the full path to the file, including the file name. -// It should include the drive letter, when appropriate. -func FilePath(val string) attribute.KeyValue { - return FilePathKey.String(val) -} - -// FileSize returns an attribute KeyValue conforming to the "file.size" semantic -// conventions. It represents the file size in bytes. -func FileSize(val int) attribute.KeyValue { - return FileSizeKey.Int(val) -} - -// FileSymbolicLinkTargetPath returns an attribute KeyValue conforming to the -// "file.symbolic_link.target_path" semantic conventions. It represents the path -// to the target of a symbolic link. -func FileSymbolicLinkTargetPath(val string) attribute.KeyValue { - return FileSymbolicLinkTargetPathKey.String(val) -} - -// Namespace: gcp -const ( - // GCPClientServiceKey is the attribute Key conforming to the - // "gcp.client.service" semantic conventions. It represents the identifies the - // Google Cloud service for which the official client library is intended. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "appengine", "run", "firestore", "alloydb", "spanner" - // Note: Intended to be a stable identifier for Google Cloud client libraries - // that is uniform across implementation languages. The value should be derived - // from the canonical service domain for the service; for example, - // 'foo.googleapis.com' should result in a value of 'foo'. - GCPClientServiceKey = attribute.Key("gcp.client.service") - - // GCPCloudRunJobExecutionKey is the attribute Key conforming to the - // "gcp.cloud_run.job.execution" semantic conventions. It represents the name of - // the Cloud Run [execution] being run for the Job, as set by the - // [`CLOUD_RUN_EXECUTION`] environment variable. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "job-name-xxxx", "sample-job-mdw84" - // - // [execution]: https://cloud.google.com/run/docs/managing/job-executions - // [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars - 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`] - // environment variable. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0, 1 - // - // [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars - GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") - - // 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] - // . - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-host1234.example.com", - // "sample-vm.us-west1-b.c.my-project.internal" - // - // [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm - 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]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "instance-1", "my-vm-name" - // - // [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names - GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name") -) - -// GCPClientService returns an attribute KeyValue conforming to the -// "gcp.client.service" semantic conventions. It represents the identifies the -// Google Cloud service for which the official client library is intended. -func GCPClientService(val string) attribute.KeyValue { - return GCPClientServiceKey.String(val) -} - -// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.execution" semantic conventions. It represents the name of -// the Cloud Run [execution] being run for the Job, as set by the -// [`CLOUD_RUN_EXECUTION`] environment variable. -// -// [execution]: https://cloud.google.com/run/docs/managing/job-executions -// [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars -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`] -// environment variable. -// -// [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars -func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { - return GCPCloudRunJobTaskIndexKey.Int(val) -} - -// 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] -// . -// -// [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]. -// -// [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) -} - -// Namespace: gen_ai -const ( - // GenAIOpenaiRequestResponseFormatKey is the attribute Key conforming to the - // "gen_ai.openai.request.response_format" semantic conventions. It represents - // the response format that is requested. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "json" - GenAIOpenaiRequestResponseFormatKey = attribute.Key("gen_ai.openai.request.response_format") - - // GenAIOpenaiRequestServiceTierKey is the attribute Key conforming to the - // "gen_ai.openai.request.service_tier" semantic conventions. It represents the - // service tier requested. May be a specific tier, default, or auto. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "auto", "default" - GenAIOpenaiRequestServiceTierKey = attribute.Key("gen_ai.openai.request.service_tier") - - // GenAIOpenaiResponseServiceTierKey is the attribute Key conforming to the - // "gen_ai.openai.response.service_tier" semantic conventions. It represents the - // service tier used for the response. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "scale", "default" - GenAIOpenaiResponseServiceTierKey = attribute.Key("gen_ai.openai.response.service_tier") - - // GenAIOpenaiResponseSystemFingerprintKey is the attribute Key conforming to - // the "gen_ai.openai.response.system_fingerprint" semantic conventions. It - // represents a fingerprint to track any eventual change in the Generative AI - // environment. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "fp_44709d6fcb" - GenAIOpenaiResponseSystemFingerprintKey = attribute.Key("gen_ai.openai.response.system_fingerprint") - - // GenAIOperationNameKey is the attribute Key conforming to the - // "gen_ai.operation.name" semantic conventions. It represents the name of the - // operation being performed. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: If one of the predefined values applies, but specific system uses a - // different name it's RECOMMENDED to document it in the semantic conventions - // for specific GenAI system and use system-specific name in the - // instrumentation. If a different name is not documented, instrumentation - // libraries SHOULD use applicable predefined value. - GenAIOperationNameKey = attribute.Key("gen_ai.operation.name") - - // GenAIRequestEncodingFormatsKey is the attribute Key conforming to the - // "gen_ai.request.encoding_formats" semantic conventions. It represents the - // encoding formats requested in an embeddings operation, if specified. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "base64"], ["float", "binary" - // Note: In some GenAI systems the encoding formats are called embedding types. - // Also, some GenAI systems only accept a single format per request. - GenAIRequestEncodingFormatsKey = attribute.Key("gen_ai.request.encoding_formats") - - // GenAIRequestFrequencyPenaltyKey is the attribute Key conforming to the - // "gen_ai.request.frequency_penalty" semantic conventions. It represents the - // frequency penalty setting for the GenAI request. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0.1 - GenAIRequestFrequencyPenaltyKey = attribute.Key("gen_ai.request.frequency_penalty") - - // GenAIRequestMaxTokensKey is the attribute Key conforming to the - // "gen_ai.request.max_tokens" semantic conventions. It represents the maximum - // number of tokens the model generates for a request. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 100 - GenAIRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens") - - // GenAIRequestModelKey is the attribute Key conforming to the - // "gen_ai.request.model" semantic conventions. It represents the name of the - // GenAI model a request is being made to. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: gpt-4 - GenAIRequestModelKey = attribute.Key("gen_ai.request.model") - - // GenAIRequestPresencePenaltyKey is the attribute Key conforming to the - // "gen_ai.request.presence_penalty" semantic conventions. It represents the - // presence penalty setting for the GenAI request. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0.1 - GenAIRequestPresencePenaltyKey = attribute.Key("gen_ai.request.presence_penalty") - - // GenAIRequestSeedKey is the attribute Key conforming to the - // "gen_ai.request.seed" semantic conventions. It represents the requests with - // same seed value more likely to return same result. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 100 - GenAIRequestSeedKey = attribute.Key("gen_ai.request.seed") - - // GenAIRequestStopSequencesKey is the attribute Key conforming to the - // "gen_ai.request.stop_sequences" semantic conventions. It represents the list - // of sequences that the model will use to stop generating further tokens. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "forest", "lived" - GenAIRequestStopSequencesKey = attribute.Key("gen_ai.request.stop_sequences") - - // GenAIRequestTemperatureKey is the attribute Key conforming to the - // "gen_ai.request.temperature" semantic conventions. It represents the - // temperature setting for the GenAI request. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0.0 - GenAIRequestTemperatureKey = attribute.Key("gen_ai.request.temperature") - - // GenAIRequestTopKKey is the attribute Key conforming to the - // "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling - // setting for the GenAI request. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1.0 - GenAIRequestTopKKey = attribute.Key("gen_ai.request.top_k") - - // GenAIRequestTopPKey is the attribute Key conforming to the - // "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling - // setting for the GenAI request. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1.0 - GenAIRequestTopPKey = attribute.Key("gen_ai.request.top_p") - - // GenAIResponseFinishReasonsKey is the attribute Key conforming to the - // "gen_ai.response.finish_reasons" semantic conventions. It represents the - // array of reasons the model stopped generating tokens, corresponding to each - // generation received. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "stop"], ["stop", "length" - GenAIResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons") - - // GenAIResponseIDKey is the attribute Key conforming to the - // "gen_ai.response.id" semantic conventions. It represents the unique - // identifier for the completion. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "chatcmpl-123" - GenAIResponseIDKey = attribute.Key("gen_ai.response.id") - - // GenAIResponseModelKey is the attribute Key conforming to the - // "gen_ai.response.model" semantic conventions. It represents the name of the - // model that generated the response. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "gpt-4-0613" - GenAIResponseModelKey = attribute.Key("gen_ai.response.model") - - // GenAISystemKey is the attribute Key conforming to the "gen_ai.system" - // semantic conventions. It represents the Generative AI product as identified - // by the client or server instrumentation. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: openai - // Note: The `gen_ai.system` describes a family of GenAI models with specific - // model identified - // by `gen_ai.request.model` and `gen_ai.response.model` attributes. - // - // The actual GenAI product may differ from the one identified by the client. - // Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI - // client - // libraries. In such cases, the `gen_ai.system` is set to `openai` based on the - // instrumentation's best knowledge, instead of the actual system. The - // `server.address` - // attribute may help identify the actual system in use for `openai`. - // - // For custom model, a custom friendly name SHOULD be used. - // If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER` - // . - GenAISystemKey = attribute.Key("gen_ai.system") - - // GenAITokenTypeKey is the attribute Key conforming to the "gen_ai.token.type" - // semantic conventions. It represents the type of token being counted. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "input", "output" - GenAITokenTypeKey = attribute.Key("gen_ai.token.type") - - // GenAIUsageInputTokensKey is the attribute Key conforming to the - // "gen_ai.usage.input_tokens" semantic conventions. It represents the number of - // tokens used in the GenAI input (prompt). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 100 - GenAIUsageInputTokensKey = attribute.Key("gen_ai.usage.input_tokens") - - // GenAIUsageOutputTokensKey is the attribute Key conforming to the - // "gen_ai.usage.output_tokens" semantic conventions. It represents the number - // of tokens used in the GenAI response (completion). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 180 - GenAIUsageOutputTokensKey = attribute.Key("gen_ai.usage.output_tokens") -) - -// GenAIOpenaiResponseServiceTier returns an attribute KeyValue conforming to the -// "gen_ai.openai.response.service_tier" semantic conventions. It represents the -// service tier used for the response. -func GenAIOpenaiResponseServiceTier(val string) attribute.KeyValue { - return GenAIOpenaiResponseServiceTierKey.String(val) -} - -// GenAIOpenaiResponseSystemFingerprint returns an attribute KeyValue conforming -// to the "gen_ai.openai.response.system_fingerprint" semantic conventions. It -// represents a fingerprint to track any eventual change in the Generative AI -// environment. -func GenAIOpenaiResponseSystemFingerprint(val string) attribute.KeyValue { - return GenAIOpenaiResponseSystemFingerprintKey.String(val) -} - -// GenAIRequestEncodingFormats returns an attribute KeyValue conforming to the -// "gen_ai.request.encoding_formats" semantic conventions. It represents the -// encoding formats requested in an embeddings operation, if specified. -func GenAIRequestEncodingFormats(val ...string) attribute.KeyValue { - return GenAIRequestEncodingFormatsKey.StringSlice(val) -} - -// GenAIRequestFrequencyPenalty returns an attribute KeyValue conforming to the -// "gen_ai.request.frequency_penalty" semantic conventions. It represents the -// frequency penalty setting for the GenAI request. -func GenAIRequestFrequencyPenalty(val float64) attribute.KeyValue { - return GenAIRequestFrequencyPenaltyKey.Float64(val) -} - -// GenAIRequestMaxTokens returns an attribute KeyValue conforming to the -// "gen_ai.request.max_tokens" semantic conventions. It represents the maximum -// number of tokens the model generates for a request. -func GenAIRequestMaxTokens(val int) attribute.KeyValue { - return GenAIRequestMaxTokensKey.Int(val) -} - -// GenAIRequestModel returns an attribute KeyValue conforming to the -// "gen_ai.request.model" semantic conventions. It represents the name of the -// GenAI model a request is being made to. -func GenAIRequestModel(val string) attribute.KeyValue { - return GenAIRequestModelKey.String(val) -} - -// GenAIRequestPresencePenalty returns an attribute KeyValue conforming to the -// "gen_ai.request.presence_penalty" semantic conventions. It represents the -// presence penalty setting for the GenAI request. -func GenAIRequestPresencePenalty(val float64) attribute.KeyValue { - return GenAIRequestPresencePenaltyKey.Float64(val) -} - -// GenAIRequestSeed returns an attribute KeyValue conforming to the -// "gen_ai.request.seed" semantic conventions. It represents the requests with -// same seed value more likely to return same result. -func GenAIRequestSeed(val int) attribute.KeyValue { - return GenAIRequestSeedKey.Int(val) -} - -// GenAIRequestStopSequences returns an attribute KeyValue conforming to the -// "gen_ai.request.stop_sequences" semantic conventions. It represents the list -// of sequences that the model will use to stop generating further tokens. -func GenAIRequestStopSequences(val ...string) attribute.KeyValue { - return GenAIRequestStopSequencesKey.StringSlice(val) -} - -// GenAIRequestTemperature returns an attribute KeyValue conforming to the -// "gen_ai.request.temperature" semantic conventions. It represents the -// temperature setting for the GenAI request. -func GenAIRequestTemperature(val float64) attribute.KeyValue { - return GenAIRequestTemperatureKey.Float64(val) -} - -// GenAIRequestTopK returns an attribute KeyValue conforming to the -// "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling -// setting for the GenAI request. -func GenAIRequestTopK(val float64) attribute.KeyValue { - return GenAIRequestTopKKey.Float64(val) -} - -// GenAIRequestTopP returns an attribute KeyValue conforming to the -// "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling -// setting for the GenAI request. -func GenAIRequestTopP(val float64) attribute.KeyValue { - return GenAIRequestTopPKey.Float64(val) -} - -// GenAIResponseFinishReasons returns an attribute KeyValue conforming to the -// "gen_ai.response.finish_reasons" semantic conventions. It represents the array -// of reasons the model stopped generating tokens, corresponding to each -// generation received. -func GenAIResponseFinishReasons(val ...string) attribute.KeyValue { - return GenAIResponseFinishReasonsKey.StringSlice(val) -} - -// GenAIResponseID returns an attribute KeyValue conforming to the -// "gen_ai.response.id" semantic conventions. It represents the unique identifier -// for the completion. -func GenAIResponseID(val string) attribute.KeyValue { - return GenAIResponseIDKey.String(val) -} - -// GenAIResponseModel returns an attribute KeyValue conforming to the -// "gen_ai.response.model" semantic conventions. It represents the name of the -// model that generated the response. -func GenAIResponseModel(val string) attribute.KeyValue { - return GenAIResponseModelKey.String(val) -} - -// GenAIUsageInputTokens returns an attribute KeyValue conforming to the -// "gen_ai.usage.input_tokens" semantic conventions. It represents the number of -// tokens used in the GenAI input (prompt). -func GenAIUsageInputTokens(val int) attribute.KeyValue { - return GenAIUsageInputTokensKey.Int(val) -} - -// GenAIUsageOutputTokens returns an attribute KeyValue conforming to the -// "gen_ai.usage.output_tokens" semantic conventions. It represents the number of -// tokens used in the GenAI response (completion). -func GenAIUsageOutputTokens(val int) attribute.KeyValue { - return GenAIUsageOutputTokensKey.Int(val) -} - -// Enum values for gen_ai.openai.request.response_format -var ( - // Text response format - // Stability: development - GenAIOpenaiRequestResponseFormatText = GenAIOpenaiRequestResponseFormatKey.String("text") - // JSON object response format - // Stability: development - GenAIOpenaiRequestResponseFormatJSONObject = GenAIOpenaiRequestResponseFormatKey.String("json_object") - // JSON schema response format - // Stability: development - GenAIOpenaiRequestResponseFormatJSONSchema = GenAIOpenaiRequestResponseFormatKey.String("json_schema") -) - -// Enum values for gen_ai.openai.request.service_tier -var ( - // The system will utilize scale tier credits until they are exhausted. - // Stability: development - GenAIOpenaiRequestServiceTierAuto = GenAIOpenaiRequestServiceTierKey.String("auto") - // The system will utilize the default scale tier. - // Stability: development - GenAIOpenaiRequestServiceTierDefault = GenAIOpenaiRequestServiceTierKey.String("default") -) - -// Enum values for gen_ai.operation.name -var ( - // Chat completion operation such as [OpenAI Chat API] - // Stability: development - // - // [OpenAI Chat API]: https://platform.openai.com/docs/api-reference/chat - GenAIOperationNameChat = GenAIOperationNameKey.String("chat") - // Text completions operation such as [OpenAI Completions API (Legacy)] - // Stability: development - // - // [OpenAI Completions API (Legacy)]: https://platform.openai.com/docs/api-reference/completions - GenAIOperationNameTextCompletion = GenAIOperationNameKey.String("text_completion") - // Embeddings operation such as [OpenAI Create embeddings API] - // Stability: development - // - // [OpenAI Create embeddings API]: https://platform.openai.com/docs/api-reference/embeddings/create - GenAIOperationNameEmbeddings = GenAIOperationNameKey.String("embeddings") -) - -// Enum values for gen_ai.system -var ( - // OpenAI - // Stability: development - GenAISystemOpenai = GenAISystemKey.String("openai") - // Vertex AI - // Stability: development - GenAISystemVertexAI = GenAISystemKey.String("vertex_ai") - // Gemini - // Stability: development - GenAISystemGemini = GenAISystemKey.String("gemini") - // Anthropic - // Stability: development - GenAISystemAnthropic = GenAISystemKey.String("anthropic") - // Cohere - // Stability: development - GenAISystemCohere = GenAISystemKey.String("cohere") - // Azure AI Inference - // Stability: development - GenAISystemAzAIInference = GenAISystemKey.String("az.ai.inference") - // Azure OpenAI - // Stability: development - GenAISystemAzAIOpenai = GenAISystemKey.String("az.ai.openai") - // IBM Watsonx AI - // Stability: development - GenAISystemIbmWatsonxAI = GenAISystemKey.String("ibm.watsonx.ai") - // AWS Bedrock - // Stability: development - GenAISystemAWSBedrock = GenAISystemKey.String("aws.bedrock") - // Perplexity - // Stability: development - GenAISystemPerplexity = GenAISystemKey.String("perplexity") - // xAI - // Stability: development - GenAISystemXai = GenAISystemKey.String("xai") - // DeepSeek - // Stability: development - GenAISystemDeepseek = GenAISystemKey.String("deepseek") - // Groq - // Stability: development - GenAISystemGroq = GenAISystemKey.String("groq") - // Mistral AI - // Stability: development - GenAISystemMistralAI = GenAISystemKey.String("mistral_ai") -) - -// Enum values for gen_ai.token.type -var ( - // Input tokens (prompt, input, etc.) - // Stability: development - GenAITokenTypeInput = GenAITokenTypeKey.String("input") - // Output tokens (completion, response, etc.) - // Stability: development - GenAITokenTypeCompletion = GenAITokenTypeKey.String("output") -) - -// Namespace: geo -const ( - // GeoContinentCodeKey is the attribute Key conforming to the - // "geo.continent.code" semantic conventions. It represents the two-letter code - // representing continent’s name. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - GeoContinentCodeKey = attribute.Key("geo.continent.code") - - // GeoCountryIsoCodeKey is the attribute Key conforming to the - // "geo.country.iso_code" semantic conventions. It represents the two-letter ISO - // Country Code ([ISO 3166-1 alpha2]). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "CA" - // - // [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes - GeoCountryIsoCodeKey = attribute.Key("geo.country.iso_code") - - // GeoLocalityNameKey is the attribute Key conforming to the "geo.locality.name" - // semantic conventions. It represents the locality name. Represents the name of - // a city, town, village, or similar populated place. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Montreal", "Berlin" - GeoLocalityNameKey = attribute.Key("geo.locality.name") - - // GeoLocationLatKey is the attribute Key conforming to the "geo.location.lat" - // semantic conventions. It represents the latitude of the geo location in - // [WGS84]. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 45.505918 - // - // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 - GeoLocationLatKey = attribute.Key("geo.location.lat") - - // GeoLocationLonKey is the attribute Key conforming to the "geo.location.lon" - // semantic conventions. It represents the longitude of the geo location in - // [WGS84]. - // - // Type: double - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: -73.61483 - // - // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 - GeoLocationLonKey = attribute.Key("geo.location.lon") - - // GeoPostalCodeKey is the attribute Key conforming to the "geo.postal_code" - // semantic conventions. It represents the postal code associated with the - // location. Values appropriate for this field may also be known as a postcode - // or ZIP code and will vary widely from country to country. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "94040" - GeoPostalCodeKey = attribute.Key("geo.postal_code") - - // GeoRegionIsoCodeKey is the attribute Key conforming to the - // "geo.region.iso_code" semantic conventions. It represents the region ISO code - // ([ISO 3166-2]). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "CA-QC" - // - // [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2 - GeoRegionIsoCodeKey = attribute.Key("geo.region.iso_code") -) - -// GeoCountryIsoCode returns an attribute KeyValue conforming to the -// "geo.country.iso_code" semantic conventions. It represents the two-letter ISO -// Country Code ([ISO 3166-1 alpha2]). -// -// [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes -func GeoCountryIsoCode(val string) attribute.KeyValue { - return GeoCountryIsoCodeKey.String(val) -} - -// GeoLocalityName returns an attribute KeyValue conforming to the -// "geo.locality.name" semantic conventions. It represents the locality name. -// Represents the name of a city, town, village, or similar populated place. -func GeoLocalityName(val string) attribute.KeyValue { - return GeoLocalityNameKey.String(val) -} - -// GeoLocationLat returns an attribute KeyValue conforming to the -// "geo.location.lat" semantic conventions. It represents the latitude of the geo -// location in [WGS84]. -// -// [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 -func GeoLocationLat(val float64) attribute.KeyValue { - return GeoLocationLatKey.Float64(val) -} - -// GeoLocationLon returns an attribute KeyValue conforming to the -// "geo.location.lon" semantic conventions. It represents the longitude of the -// geo location in [WGS84]. -// -// [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 -func GeoLocationLon(val float64) attribute.KeyValue { - return GeoLocationLonKey.Float64(val) -} - -// GeoPostalCode returns an attribute KeyValue conforming to the -// "geo.postal_code" semantic conventions. It represents the postal code -// associated with the location. Values appropriate for this field may also be -// known as a postcode or ZIP code and will vary widely from country to country. -func GeoPostalCode(val string) attribute.KeyValue { - return GeoPostalCodeKey.String(val) -} - -// GeoRegionIsoCode returns an attribute KeyValue conforming to the -// "geo.region.iso_code" semantic conventions. It represents the region ISO code -// ([ISO 3166-2]). -// -// [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2 -func GeoRegionIsoCode(val string) attribute.KeyValue { - return GeoRegionIsoCodeKey.String(val) -} - -// Enum values for geo.continent.code -var ( - // Africa - // Stability: development - GeoContinentCodeAf = GeoContinentCodeKey.String("AF") - // Antarctica - // Stability: development - GeoContinentCodeAn = GeoContinentCodeKey.String("AN") - // Asia - // Stability: development - GeoContinentCodeAs = GeoContinentCodeKey.String("AS") - // Europe - // Stability: development - GeoContinentCodeEu = GeoContinentCodeKey.String("EU") - // North America - // Stability: development - GeoContinentCodeNa = GeoContinentCodeKey.String("NA") - // Oceania - // Stability: development - GeoContinentCodeOc = GeoContinentCodeKey.String("OC") - // South America - // Stability: development - GeoContinentCodeSa = GeoContinentCodeKey.String("SA") -) - -// Namespace: go -const ( - // GoMemoryTypeKey is the attribute Key conforming to the "go.memory.type" - // semantic conventions. It represents the type of memory. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "other", "stack" - GoMemoryTypeKey = attribute.Key("go.memory.type") -) - -// Enum values for go.memory.type -var ( - // Memory allocated from the heap that is reserved for stack space, whether or - // not it is currently in-use. - // Stability: development - GoMemoryTypeStack = GoMemoryTypeKey.String("stack") - // Memory used by the Go runtime, excluding other categories of memory usage - // described in this enumeration. - // Stability: development - GoMemoryTypeOther = GoMemoryTypeKey.String("other") -) - -// Namespace: graphql -const ( - // GraphqlDocumentKey is the attribute Key conforming to the "graphql.document" - // semantic conventions. It represents the GraphQL document being executed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: query findBookById { bookById(id: ?) { name } } - // Note: The value may be sanitized to exclude sensitive information. - GraphqlDocumentKey = attribute.Key("graphql.document") - - // GraphqlOperationNameKey is the attribute Key conforming to the - // "graphql.operation.name" semantic conventions. It represents the name of the - // operation being executed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: findBookById - GraphqlOperationNameKey = attribute.Key("graphql.operation.name") - - // GraphqlOperationTypeKey is the attribute Key conforming to the - // "graphql.operation.type" semantic conventions. It represents the type of the - // operation being executed. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "query", "mutation", "subscription" - GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") -) - -// GraphqlDocument returns an attribute KeyValue conforming to the -// "graphql.document" semantic conventions. It represents the GraphQL document -// being executed. -func GraphqlDocument(val string) attribute.KeyValue { - return GraphqlDocumentKey.String(val) -} - -// GraphqlOperationName returns an attribute KeyValue conforming to the -// "graphql.operation.name" semantic conventions. It represents the name of the -// operation being executed. -func GraphqlOperationName(val string) attribute.KeyValue { - return GraphqlOperationNameKey.String(val) -} - -// Enum values for graphql.operation.type -var ( - // GraphQL query - // Stability: development - GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") - // GraphQL mutation - // Stability: development - GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") - // GraphQL subscription - // Stability: development - GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") -) - -// Namespace: heroku -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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // 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: Recommended - // Stability: Development - // - // 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) -} - -// Namespace: host -const ( - // HostArchKey is the attribute Key conforming to the "host.arch" semantic - // conventions. It represents the CPU architecture the host system is running - // on. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - HostArchKey = attribute.Key("host.arch") - - // HostCPUCacheL2SizeKey is the attribute Key conforming to the - // "host.cpu.cache.l2.size" semantic conventions. It represents the amount of - // level 2 memory cache available to the processor (in Bytes). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 12288000 - HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size") - - // HostCPUFamilyKey is the attribute Key conforming to the "host.cpu.family" - // semantic conventions. It represents the family or generation of the CPU. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "6", "PA-RISC 1.1e" - HostCPUFamilyKey = attribute.Key("host.cpu.family") - - // HostCPUModelIDKey is the attribute Key conforming to the "host.cpu.model.id" - // semantic conventions. It represents the model identifier. It provides more - // granular information about the CPU, distinguishing it from other CPUs within - // the same family. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "6", "9000/778/B180L" - HostCPUModelIDKey = attribute.Key("host.cpu.model.id") - - // HostCPUModelNameKey is the attribute Key conforming to the - // "host.cpu.model.name" semantic conventions. It represents the model - // designation of the processor. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz" - HostCPUModelNameKey = attribute.Key("host.cpu.model.name") - - // HostCPUSteppingKey is the attribute Key conforming to the "host.cpu.stepping" - // semantic conventions. It represents the stepping or core revisions. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1", "r1p1" - HostCPUSteppingKey = attribute.Key("host.cpu.stepping") - - // HostCPUVendorIDKey is the attribute Key conforming to the - // "host.cpu.vendor.id" semantic conventions. It represents the processor - // manufacturer identifier. A maximum 12-character string. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "GenuineIntel" - // Note: [CPUID] command returns the vendor ID string in EBX, EDX and ECX - // registers. Writing these to memory in this order results in a 12-character - // string. - // - // [CPUID]: https://wiki.osdev.org/CPUID - HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id") - - // HostIDKey is the attribute Key conforming to the "host.id" semantic - // conventions. It represents the unique host ID. For Cloud, this must be the - // instance_id assigned by the cloud provider. For non-containerized systems, - // this should be the `machine-id`. See the table below for the sources to use - // to determine the `machine-id` based on operating system. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "fdbf79e8af94cb7f9e8df36789187052" - HostIDKey = attribute.Key("host.id") - - // HostImageIDKey is the attribute Key conforming to the "host.image.id" - // semantic conventions. It represents the vM image ID or host OS image ID. For - // Cloud, this value is from the provider. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "ami-07b06b442921831e5" - HostImageIDKey = attribute.Key("host.image.id") - - // HostImageNameKey is the attribute Key conforming to the "host.image.name" - // semantic conventions. It represents the name of the VM image or OS install - // the host was instantiated from. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "infra-ami-eks-worker-node-7d4ec78312", "CentOS-8-x86_64-1905" - HostImageNameKey = attribute.Key("host.image.name") - - // HostImageVersionKey is the attribute Key conforming to the - // "host.image.version" semantic conventions. It represents the version string - // of the VM image or host OS as defined in [Version Attributes]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0.1" - // - // [Version Attributes]: /docs/resource/README.md#version-attributes - HostImageVersionKey = attribute.Key("host.image.version") - - // HostIPKey is the attribute Key conforming to the "host.ip" semantic - // conventions. It represents the available IP addresses of the host, excluding - // loopback interfaces. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "192.168.1.140", "fe80::abc2:4a28:737a:609e" - // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 - // addresses MUST be specified in the [RFC 5952] format. - // - // [RFC 5952]: https://www.rfc-editor.org/rfc/rfc5952.html - HostIPKey = attribute.Key("host.ip") - - // HostMacKey is the attribute Key conforming to the "host.mac" semantic - // conventions. It represents the available MAC addresses of the host, excluding - // loopback interfaces. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "AC-DE-48-23-45-67", "AC-DE-48-23-45-67-01-9F" - // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form]: as - // hyphen-separated octets in uppercase hexadecimal form from most to least - // significant. - // - // [IEEE RA hexadecimal form]: https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf - HostMacKey = attribute.Key("host.mac") - - // HostNameKey is the attribute Key conforming to the "host.name" semantic - // conventions. It represents the name of the host. On Unix systems, it may - // contain what the hostname command returns, or the fully qualified hostname, - // or another name specified by the user. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry-test" - HostNameKey = attribute.Key("host.name") - - // HostTypeKey is the attribute Key conforming to the "host.type" semantic - // conventions. It represents the type of host. For Cloud, this must be the - // machine type. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "n1-standard-1" - HostTypeKey = attribute.Key("host.type") -) - -// HostCPUCacheL2Size returns an attribute KeyValue conforming to the -// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of -// level 2 memory cache available to the processor (in Bytes). -func HostCPUCacheL2Size(val int) attribute.KeyValue { - return HostCPUCacheL2SizeKey.Int(val) -} - -// HostCPUFamily returns an attribute KeyValue conforming to the -// "host.cpu.family" semantic conventions. It represents the family or generation -// of the CPU. -func HostCPUFamily(val string) attribute.KeyValue { - return HostCPUFamilyKey.String(val) -} - -// HostCPUModelID returns an attribute KeyValue conforming to the -// "host.cpu.model.id" semantic conventions. It represents the model identifier. -// It provides more granular information about the CPU, distinguishing it from -// other CPUs within the same family. -func HostCPUModelID(val string) attribute.KeyValue { - return HostCPUModelIDKey.String(val) -} - -// HostCPUModelName returns an attribute KeyValue conforming to the -// "host.cpu.model.name" semantic conventions. It represents the model -// designation of the processor. -func HostCPUModelName(val string) attribute.KeyValue { - return HostCPUModelNameKey.String(val) -} - -// HostCPUStepping returns an attribute KeyValue conforming to the -// "host.cpu.stepping" semantic conventions. It represents the stepping or core -// revisions. -func HostCPUStepping(val string) attribute.KeyValue { - return HostCPUSteppingKey.String(val) -} - -// HostCPUVendorID returns an attribute KeyValue conforming to the -// "host.cpu.vendor.id" semantic conventions. It represents the processor -// manufacturer identifier. A maximum 12-character string. -func HostCPUVendorID(val string) attribute.KeyValue { - return HostCPUVendorIDKey.String(val) -} - -// HostID returns an attribute KeyValue conforming to the "host.id" semantic -// conventions. It represents the unique host ID. For Cloud, this must be the -// instance_id assigned by the cloud provider. For non-containerized systems, -// this should be the `machine-id`. See the table below for the sources to use to -// determine the `machine-id` based on operating system. -func HostID(val string) attribute.KeyValue { - return HostIDKey.String(val) -} - -// HostImageID returns an attribute KeyValue conforming to the "host.image.id" -// semantic conventions. It represents the vM image ID or host OS image ID. For -// Cloud, this value is from the provider. -func HostImageID(val string) attribute.KeyValue { - return HostImageIDKey.String(val) -} - -// HostImageName returns an attribute KeyValue conforming to the -// "host.image.name" semantic conventions. It represents the name of the VM image -// or OS install the host was instantiated from. -func HostImageName(val string) attribute.KeyValue { - return HostImageNameKey.String(val) -} - -// HostImageVersion returns an attribute KeyValue conforming to the -// "host.image.version" semantic conventions. It represents the version string of -// the VM image or host OS as defined in [Version Attributes]. -// -// [Version Attributes]: /docs/resource/README.md#version-attributes -func HostImageVersion(val string) attribute.KeyValue { - return HostImageVersionKey.String(val) -} - -// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic -// conventions. It represents the available IP addresses of the host, excluding -// loopback interfaces. -func HostIP(val ...string) attribute.KeyValue { - return HostIPKey.StringSlice(val) -} - -// HostMac returns an attribute KeyValue conforming to the "host.mac" semantic -// conventions. It represents the available MAC addresses of the host, excluding -// loopback interfaces. -func HostMac(val ...string) attribute.KeyValue { - return HostMacKey.StringSlice(val) -} - -// HostName returns an attribute KeyValue conforming to the "host.name" semantic -// conventions. It represents the name of the host. On Unix systems, it may -// contain what the hostname command returns, or the fully qualified hostname, or -// another name specified by the user. -func HostName(val string) attribute.KeyValue { - return HostNameKey.String(val) -} - -// HostType returns an attribute KeyValue conforming to the "host.type" semantic -// conventions. It represents the type of host. For Cloud, this must be the -// machine type. -func HostType(val string) attribute.KeyValue { - return HostTypeKey.String(val) -} - -// Enum values for host.arch -var ( - // AMD64 - // Stability: development - HostArchAMD64 = HostArchKey.String("amd64") - // ARM32 - // Stability: development - HostArchARM32 = HostArchKey.String("arm32") - // ARM64 - // Stability: development - HostArchARM64 = HostArchKey.String("arm64") - // Itanium - // Stability: development - HostArchIA64 = HostArchKey.String("ia64") - // 32-bit PowerPC - // Stability: development - HostArchPPC32 = HostArchKey.String("ppc32") - // 64-bit PowerPC - // Stability: development - HostArchPPC64 = HostArchKey.String("ppc64") - // IBM z/Architecture - // Stability: development - HostArchS390x = HostArchKey.String("s390x") - // 32-bit x86 - // Stability: development - HostArchX86 = HostArchKey.String("x86") -) - -// Namespace: http -const ( - // HTTPConnectionStateKey is the attribute Key conforming to the - // "http.connection.state" semantic conventions. It represents the state of the - // HTTP connection in the HTTP connection pool. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "active", "idle" - HTTPConnectionStateKey = attribute.Key("http.connection.state") - - // HTTPRequestBodySizeKey is the attribute Key conforming to the - // "http.request.body.size" semantic conventions. It represents the size of the - // request payload body in bytes. This is the number of bytes transferred - // excluding headers and is often, but not always, present as the - // [Content-Length] header. For requests using transport encoding, this should - // be the compressed size. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length - HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") - - // HTTPRequestMethodKey is the attribute Key conforming to the - // "http.request.method" semantic conventions. It represents the hTTP request - // method. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "GET", "POST", "HEAD" - // Note: HTTP request method value SHOULD be "known" to the instrumentation. - // By default, this convention defines "known" methods as the ones listed in - // [RFC9110] - // and the PATCH method defined in [RFC5789]. - // - // If the HTTP request method is not known to instrumentation, it MUST set the - // `http.request.method` attribute to `_OTHER`. - // - // If the HTTP instrumentation could end up converting valid HTTP request - // methods to `_OTHER`, then it MUST provide a way to override - // the list of known HTTP methods. If this override is done via environment - // variable, then the environment variable MUST be named - // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of - // case-sensitive known HTTP methods - // (this list MUST be a full override of the default known method, it is not a - // list of known methods in addition to the defaults). - // - // HTTP method names are case-sensitive and `http.request.method` attribute - // value MUST match a known HTTP method name exactly. - // Instrumentations for specific web frameworks that consider HTTP methods to be - // case insensitive, SHOULD populate a canonical equivalent. - // Tracing instrumentations that do so, MUST also set - // `http.request.method_original` to the original value. - // - // [RFC9110]: https://www.rfc-editor.org/rfc/rfc9110.html#name-methods - // [RFC5789]: https://www.rfc-editor.org/rfc/rfc5789.html - HTTPRequestMethodKey = attribute.Key("http.request.method") - - // HTTPRequestMethodOriginalKey is the attribute Key conforming to the - // "http.request.method_original" semantic conventions. It represents the - // original HTTP method sent by the client in the request line. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "GeT", "ACL", "foo" - HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") - - // HTTPRequestResendCountKey is the attribute Key conforming to the - // "http.request.resend_count" semantic conventions. It represents the ordinal - // number of request resending attempt (for any reason, including redirects). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Stable - // - // Note: The resend count SHOULD be updated each time an HTTP request gets - // resent by the client, regardless of what was the cause of the resending (e.g. - // redirection, authorization failure, 503 Server Unavailable, network issues, - // or any other). - HTTPRequestResendCountKey = attribute.Key("http.request.resend_count") - - // HTTPRequestSizeKey is the attribute Key conforming to the "http.request.size" - // semantic conventions. It represents the total size of the request in bytes. - // This should be the total number of bytes sent over the wire, including the - // request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request - // body if any. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - HTTPRequestSizeKey = attribute.Key("http.request.size") - - // HTTPResponseBodySizeKey is the attribute Key conforming to the - // "http.response.body.size" semantic conventions. It represents the size of the - // response payload body in bytes. This is the number of bytes transferred - // excluding headers and is often, but not always, present as the - // [Content-Length] header. For requests using transport encoding, this should - // be the compressed size. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length - HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") - - // HTTPResponseSizeKey is the attribute Key conforming to the - // "http.response.size" semantic conventions. It represents the total size of - // the response in bytes. This should be the total number of bytes sent over the - // wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), - // headers, and response body and trailers if any. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - HTTPResponseSizeKey = attribute.Key("http.response.size") - - // HTTPResponseStatusCodeKey is the attribute Key conforming to the - // "http.response.status_code" semantic conventions. It represents the - // [HTTP response status code]. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: 200 - // - // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 - HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") - - // HTTPRouteKey is the attribute Key conforming to the "http.route" semantic - // conventions. It represents the matched route, that is, the path template in - // the format used by the respective server framework. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "/users/:userID?", "{controller}/{action}/{id?}" - // Note: MUST NOT be populated when this is not supported by the HTTP server - // framework as the route attribute should have low-cardinality and the URI path - // can NOT substitute it. - // SHOULD include the [application root] if there is one. - // - // [application root]: /docs/http/http-spans.md#http-server-definitions - HTTPRouteKey = attribute.Key("http.route") -) - -// HTTPRequestBodySize returns an attribute KeyValue conforming to the -// "http.request.body.size" semantic conventions. It represents the size of the -// request payload body in bytes. This is the number of bytes transferred -// excluding headers and is often, but not always, present as the -// [Content-Length] header. For requests using transport encoding, this should be -// the compressed size. -// -// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length -func HTTPRequestBodySize(val int) attribute.KeyValue { - return HTTPRequestBodySizeKey.Int(val) -} - -// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the -// "http.request.method_original" semantic conventions. It represents the -// original HTTP method sent by the client in the request line. -func HTTPRequestMethodOriginal(val string) attribute.KeyValue { - return HTTPRequestMethodOriginalKey.String(val) -} - -// HTTPRequestResendCount returns an attribute KeyValue conforming to the -// "http.request.resend_count" semantic conventions. It represents the ordinal -// number of request resending attempt (for any reason, including redirects). -func HTTPRequestResendCount(val int) attribute.KeyValue { - return HTTPRequestResendCountKey.Int(val) -} - -// HTTPRequestSize returns an attribute KeyValue conforming to the -// "http.request.size" semantic conventions. It represents the total size of the -// request in bytes. This should be the total number of bytes sent over the wire, -// including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, -// and request body if any. -func HTTPRequestSize(val int) attribute.KeyValue { - return HTTPRequestSizeKey.Int(val) -} - -// HTTPResponseBodySize returns an attribute KeyValue conforming to the -// "http.response.body.size" semantic conventions. It represents the size of the -// response payload body in bytes. This is the number of bytes transferred -// excluding headers and is often, but not always, present as the -// [Content-Length] header. For requests using transport encoding, this should be -// the compressed size. -// -// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length -func HTTPResponseBodySize(val int) attribute.KeyValue { - return HTTPResponseBodySizeKey.Int(val) -} - -// HTTPResponseSize returns an attribute KeyValue conforming to the -// "http.response.size" semantic conventions. It represents the total size of the -// response in bytes. This should be the total number of bytes sent over the -// wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), -// headers, and response body and trailers if any. -func HTTPResponseSize(val int) attribute.KeyValue { - return HTTPResponseSizeKey.Int(val) -} - -// HTTPResponseStatusCode returns an attribute KeyValue conforming to the -// "http.response.status_code" semantic conventions. It represents the -// [HTTP response status code]. -// -// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 -func HTTPResponseStatusCode(val int) attribute.KeyValue { - return HTTPResponseStatusCodeKey.Int(val) -} - -// HTTPRoute returns an attribute KeyValue conforming to the "http.route" -// semantic conventions. It represents the matched route, that is, the path -// template in the format used by the respective server framework. -func HTTPRoute(val string) attribute.KeyValue { - return HTTPRouteKey.String(val) -} - -// Enum values for http.connection.state -var ( - // active state. - // Stability: development - HTTPConnectionStateActive = HTTPConnectionStateKey.String("active") - // idle state. - // Stability: development - HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle") -) - -// Enum values for http.request.method -var ( - // CONNECT method. - // Stability: stable - HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") - // DELETE method. - // Stability: stable - HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") - // GET method. - // Stability: stable - HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") - // HEAD method. - // Stability: stable - HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") - // OPTIONS method. - // Stability: stable - HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") - // PATCH method. - // Stability: stable - HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") - // POST method. - // Stability: stable - HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") - // PUT method. - // Stability: stable - HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") - // TRACE method. - // Stability: stable - HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") - // Any HTTP method that the instrumentation has no prior knowledge of. - // Stability: stable - HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") -) - -// Namespace: hw -const ( - // HwIDKey is the attribute Key conforming to the "hw.id" semantic conventions. - // It represents an identifier for the hardware component, unique within the - // monitored host. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "win32battery_battery_testsysa33_1" - HwIDKey = attribute.Key("hw.id") - - // HwNameKey is the attribute Key conforming to the "hw.name" semantic - // conventions. It represents an easily-recognizable name for the hardware - // component. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "eth0" - HwNameKey = attribute.Key("hw.name") - - // HwParentKey is the attribute Key conforming to the "hw.parent" semantic - // conventions. It represents the unique identifier of the parent component - // (typically the `hw.id` attribute of the enclosure, or disk controller). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "dellStorage_perc_0" - HwParentKey = attribute.Key("hw.parent") - - // HwStateKey is the attribute Key conforming to the "hw.state" semantic - // conventions. It represents the current state of the component. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - HwStateKey = attribute.Key("hw.state") - - // HwTypeKey is the attribute Key conforming to the "hw.type" semantic - // conventions. It represents the type of the component. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: Describes the category of the hardware component for which `hw.state` - // is being reported. For example, `hw.type=temperature` along with - // `hw.state=degraded` would indicate that the temperature of the hardware - // component has been reported as `degraded`. - HwTypeKey = attribute.Key("hw.type") -) - -// HwID returns an attribute KeyValue conforming to the "hw.id" semantic -// conventions. It represents an identifier for the hardware component, unique -// within the monitored host. -func HwID(val string) attribute.KeyValue { - return HwIDKey.String(val) -} - -// HwName returns an attribute KeyValue conforming to the "hw.name" semantic -// conventions. It represents an easily-recognizable name for the hardware -// component. -func HwName(val string) attribute.KeyValue { - return HwNameKey.String(val) -} - -// HwParent returns an attribute KeyValue conforming to the "hw.parent" semantic -// conventions. It represents the unique identifier of the parent component -// (typically the `hw.id` attribute of the enclosure, or disk controller). -func HwParent(val string) attribute.KeyValue { - return HwParentKey.String(val) -} - -// Enum values for hw.state -var ( - // Ok - // Stability: development - HwStateOk = HwStateKey.String("ok") - // Degraded - // Stability: development - HwStateDegraded = HwStateKey.String("degraded") - // Failed - // Stability: development - HwStateFailed = HwStateKey.String("failed") -) - -// Enum values for hw.type -var ( - // Battery - // Stability: development - HwTypeBattery = HwTypeKey.String("battery") - // CPU - // Stability: development - HwTypeCPU = HwTypeKey.String("cpu") - // Disk controller - // Stability: development - HwTypeDiskController = HwTypeKey.String("disk_controller") - // Enclosure - // Stability: development - HwTypeEnclosure = HwTypeKey.String("enclosure") - // Fan - // Stability: development - HwTypeFan = HwTypeKey.String("fan") - // GPU - // Stability: development - HwTypeGpu = HwTypeKey.String("gpu") - // Logical disk - // Stability: development - HwTypeLogicalDisk = HwTypeKey.String("logical_disk") - // Memory - // Stability: development - HwTypeMemory = HwTypeKey.String("memory") - // Network - // Stability: development - HwTypeNetwork = HwTypeKey.String("network") - // Physical disk - // Stability: development - HwTypePhysicalDisk = HwTypeKey.String("physical_disk") - // Power supply - // Stability: development - HwTypePowerSupply = HwTypeKey.String("power_supply") - // Tape drive - // Stability: development - HwTypeTapeDrive = HwTypeKey.String("tape_drive") - // Temperature - // Stability: development - HwTypeTemperature = HwTypeKey.String("temperature") - // Voltage - // Stability: development - HwTypeVoltage = HwTypeKey.String("voltage") -) - -// Namespace: k8s -const ( - // K8SClusterNameKey is the attribute Key conforming to the "k8s.cluster.name" - // semantic conventions. It represents the name of the cluster. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry-cluster" - K8SClusterNameKey = attribute.Key("k8s.cluster.name") - - // K8SClusterUIDKey is the attribute Key conforming to the "k8s.cluster.uid" - // semantic conventions. It represents a pseudo-ID for the cluster, set to the - // UID of the `kube-system` namespace. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" - // Note: K8s doesn't have support for obtaining a cluster ID. If this is ever - // added, we will recommend collecting the `k8s.cluster.uid` through the - // official APIs. In the meantime, we are able to use the `uid` of the - // `kube-system` namespace as a proxy for cluster ID. Read on for the - // rationale. - // - // Every object created in a K8s cluster is assigned a distinct UID. The - // `kube-system` namespace is used by Kubernetes itself and will exist - // for the lifetime of the cluster. Using the `uid` of the `kube-system` - // namespace is a reasonable proxy for the K8s ClusterID as it will only - // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - // UUIDs as standardized by - // [ISO/IEC 9834-8 and ITU-T X.667]. - // Which states: - // - // > If generated according to one of the mechanisms defined in Rec. - // > ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - // > different from all other UUIDs generated before 3603 A.D., or is - // > extremely likely to be different (depending on the mechanism chosen). - // - // Therefore, UIDs between clusters should be extremely unlikely to - // conflict. - // - // [ISO/IEC 9834-8 and ITU-T X.667]: https://www.itu.int/ITU-T/studygroups/com17/oid.html - K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") - - // K8SContainerNameKey is the attribute Key conforming to the - // "k8s.container.name" semantic conventions. It represents the name of the - // Container from Pod specification, must be unique within a Pod. Container - // runtime usually uses different globally unique name (`container.name`). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "redis" - K8SContainerNameKey = attribute.Key("k8s.container.name") - - // K8SContainerRestartCountKey is the attribute Key conforming to the - // "k8s.container.restart_count" semantic conventions. It represents the number - // of times the container was restarted. This attribute can be used to identify - // a particular container (running or stopped) within a container spec. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") - - // K8SContainerStatusLastTerminatedReasonKey is the attribute Key conforming to - // the "k8s.container.status.last_terminated_reason" semantic conventions. It - // represents the last terminated reason of the Container. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Evicted", "Error" - K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason") - - // K8SCronJobNameKey is the attribute Key conforming to the "k8s.cronjob.name" - // semantic conventions. It represents the name of the CronJob. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry" - K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") - - // K8SCronJobUIDKey is the attribute Key conforming to the "k8s.cronjob.uid" - // semantic conventions. It represents the UID of the CronJob. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") - - // K8SDaemonSetNameKey is the attribute Key conforming to the - // "k8s.daemonset.name" semantic conventions. It represents the name of the - // DaemonSet. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry" - K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") - - // K8SDaemonSetUIDKey is the attribute Key conforming to the "k8s.daemonset.uid" - // semantic conventions. It represents the UID of the DaemonSet. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") - - // K8SDeploymentNameKey is the attribute Key conforming to the - // "k8s.deployment.name" semantic conventions. It represents the name of the - // Deployment. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry" - K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") - - // K8SDeploymentUIDKey is the attribute Key conforming to the - // "k8s.deployment.uid" semantic conventions. It represents the UID of the - // Deployment. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") - - // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" semantic - // conventions. It represents the name of the Job. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry" - K8SJobNameKey = attribute.Key("k8s.job.name") - - // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" semantic - // conventions. It represents the UID of the Job. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SJobUIDKey = attribute.Key("k8s.job.uid") - - // K8SNamespaceNameKey is the attribute Key conforming to the - // "k8s.namespace.name" semantic conventions. It represents the name of the - // namespace that the pod is running in. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "default" - K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") - - // K8SNamespacePhaseKey is the attribute Key conforming to the - // "k8s.namespace.phase" semantic conventions. It represents the phase of the - // K8s namespace. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "active", "terminating" - // Note: This attribute aligns with the `phase` field of the - // [K8s NamespaceStatus] - // - // [K8s NamespaceStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core - K8SNamespacePhaseKey = attribute.Key("k8s.namespace.phase") - - // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" - // semantic conventions. It represents the name of the Node. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "node-1" - K8SNodeNameKey = attribute.Key("k8s.node.name") - - // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" semantic - // conventions. It represents the UID of the Node. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2" - K8SNodeUIDKey = attribute.Key("k8s.node.uid") - - // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" semantic - // conventions. It represents the name of the Pod. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry-pod-autoconf" - K8SPodNameKey = attribute.Key("k8s.pod.name") - - // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" semantic - // conventions. It represents the UID of the Pod. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SPodUIDKey = attribute.Key("k8s.pod.uid") - - // K8SReplicaSetNameKey is the attribute Key conforming to the - // "k8s.replicaset.name" semantic conventions. It represents the name of the - // ReplicaSet. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry" - K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") - - // K8SReplicaSetUIDKey is the attribute Key conforming to the - // "k8s.replicaset.uid" semantic conventions. It represents the UID of the - // ReplicaSet. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") - - // K8SStatefulSetNameKey is the attribute Key conforming to the - // "k8s.statefulset.name" semantic conventions. It represents the name of the - // StatefulSet. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "opentelemetry" - K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") - - // K8SStatefulSetUIDKey is the attribute Key conforming to the - // "k8s.statefulset.uid" semantic conventions. It represents the UID of the - // StatefulSet. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" - K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") - - // K8SVolumeNameKey is the attribute Key conforming to the "k8s.volume.name" - // semantic conventions. It represents the name of the K8s volume. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "volume0" - K8SVolumeNameKey = attribute.Key("k8s.volume.name") - - // K8SVolumeTypeKey is the attribute Key conforming to the "k8s.volume.type" - // semantic conventions. It represents the type of the K8s volume. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "emptyDir", "persistentVolumeClaim" - K8SVolumeTypeKey = attribute.Key("k8s.volume.type") -) - -// K8SClusterName returns an attribute KeyValue conforming to the -// "k8s.cluster.name" semantic conventions. It represents the name of the -// cluster. -func K8SClusterName(val string) attribute.KeyValue { - return K8SClusterNameKey.String(val) -} - -// K8SClusterUID returns an attribute KeyValue conforming to the -// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the -// cluster, set to the UID of the `kube-system` namespace. -func K8SClusterUID(val string) attribute.KeyValue { - return K8SClusterUIDKey.String(val) -} - -// K8SContainerName returns an attribute KeyValue conforming to the -// "k8s.container.name" semantic conventions. It represents the name of the -// Container from Pod specification, must be unique within a Pod. Container -// runtime usually uses different globally unique name (`container.name`). -func K8SContainerName(val string) attribute.KeyValue { - return K8SContainerNameKey.String(val) -} - -// K8SContainerRestartCount returns an attribute KeyValue conforming to the -// "k8s.container.restart_count" semantic conventions. It represents the number -// of times the container was restarted. This attribute can be used to identify a -// particular container (running or stopped) within a container spec. -func K8SContainerRestartCount(val int) attribute.KeyValue { - return K8SContainerRestartCountKey.Int(val) -} - -// K8SContainerStatusLastTerminatedReason returns an attribute KeyValue -// conforming to the "k8s.container.status.last_terminated_reason" semantic -// conventions. It represents the last terminated reason of the Container. -func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue { - return K8SContainerStatusLastTerminatedReasonKey.String(val) -} - -// K8SCronJobName returns an attribute KeyValue conforming to the -// "k8s.cronjob.name" semantic conventions. It represents the name of the -// CronJob. -func K8SCronJobName(val string) attribute.KeyValue { - return K8SCronJobNameKey.String(val) -} - -// K8SCronJobUID returns an attribute KeyValue conforming to the -// "k8s.cronjob.uid" semantic conventions. It represents the UID of the CronJob. -func K8SCronJobUID(val string) attribute.KeyValue { - return K8SCronJobUIDKey.String(val) -} - -// K8SDaemonSetName returns an attribute KeyValue conforming to the -// "k8s.daemonset.name" semantic conventions. It represents the name of the -// DaemonSet. -func K8SDaemonSetName(val string) attribute.KeyValue { - return K8SDaemonSetNameKey.String(val) -} - -// K8SDaemonSetUID returns an attribute KeyValue conforming to the -// "k8s.daemonset.uid" semantic conventions. It represents the UID of the -// DaemonSet. -func K8SDaemonSetUID(val string) attribute.KeyValue { - return K8SDaemonSetUIDKey.String(val) -} - -// K8SDeploymentName returns an attribute KeyValue conforming to the -// "k8s.deployment.name" semantic conventions. It represents the name of the -// Deployment. -func K8SDeploymentName(val string) attribute.KeyValue { - return K8SDeploymentNameKey.String(val) -} - -// K8SDeploymentUID returns an attribute KeyValue conforming to the -// "k8s.deployment.uid" semantic conventions. It represents the UID of the -// Deployment. -func K8SDeploymentUID(val string) attribute.KeyValue { - return K8SDeploymentUIDKey.String(val) -} - -// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" -// semantic conventions. It represents the name of the Job. -func K8SJobName(val string) attribute.KeyValue { - return K8SJobNameKey.String(val) -} - -// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" -// semantic conventions. It represents the UID of the Job. -func K8SJobUID(val string) attribute.KeyValue { - return K8SJobUIDKey.String(val) -} - -// K8SNamespaceName returns an attribute KeyValue conforming to the -// "k8s.namespace.name" semantic conventions. It represents the name of the -// namespace that the pod is running in. -func K8SNamespaceName(val string) attribute.KeyValue { - return K8SNamespaceNameKey.String(val) -} - -// K8SNodeName returns an attribute KeyValue conforming to the "k8s.node.name" -// semantic conventions. It represents the name of the Node. -func K8SNodeName(val string) attribute.KeyValue { - return K8SNodeNameKey.String(val) -} - -// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" -// semantic conventions. It represents the UID of the Node. -func K8SNodeUID(val string) attribute.KeyValue { - return K8SNodeUIDKey.String(val) -} - -// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" -// semantic conventions. It represents the name of the Pod. -func K8SPodName(val string) attribute.KeyValue { - return K8SPodNameKey.String(val) -} - -// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" -// semantic conventions. It represents the UID of the Pod. -func K8SPodUID(val string) attribute.KeyValue { - return K8SPodUIDKey.String(val) -} - -// K8SReplicaSetName returns an attribute KeyValue conforming to the -// "k8s.replicaset.name" semantic conventions. It represents the name of the -// ReplicaSet. -func K8SReplicaSetName(val string) attribute.KeyValue { - return K8SReplicaSetNameKey.String(val) -} - -// K8SReplicaSetUID returns an attribute KeyValue conforming to the -// "k8s.replicaset.uid" semantic conventions. It represents the UID of the -// ReplicaSet. -func K8SReplicaSetUID(val string) attribute.KeyValue { - return K8SReplicaSetUIDKey.String(val) -} - -// K8SStatefulSetName returns an attribute KeyValue conforming to the -// "k8s.statefulset.name" semantic conventions. It represents the name of the -// StatefulSet. -func K8SStatefulSetName(val string) attribute.KeyValue { - return K8SStatefulSetNameKey.String(val) -} - -// K8SStatefulSetUID returns an attribute KeyValue conforming to the -// "k8s.statefulset.uid" semantic conventions. It represents the UID of the -// StatefulSet. -func K8SStatefulSetUID(val string) attribute.KeyValue { - return K8SStatefulSetUIDKey.String(val) -} - -// K8SVolumeName returns an attribute KeyValue conforming to the -// "k8s.volume.name" semantic conventions. It represents the name of the K8s -// volume. -func K8SVolumeName(val string) attribute.KeyValue { - return K8SVolumeNameKey.String(val) -} - -// Enum values for k8s.namespace.phase -var ( - // Active namespace phase as described by [K8s API] - // Stability: development - // - // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase - K8SNamespacePhaseActive = K8SNamespacePhaseKey.String("active") - // Terminating namespace phase as described by [K8s API] - // Stability: development - // - // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase - K8SNamespacePhaseTerminating = K8SNamespacePhaseKey.String("terminating") -) - -// Enum values for k8s.volume.type -var ( - // A [persistentVolumeClaim] volume - // Stability: development - // - // [persistentVolumeClaim]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim - K8SVolumeTypePersistentVolumeClaim = K8SVolumeTypeKey.String("persistentVolumeClaim") - // A [configMap] volume - // Stability: development - // - // [configMap]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap - K8SVolumeTypeConfigMap = K8SVolumeTypeKey.String("configMap") - // A [downwardAPI] volume - // Stability: development - // - // [downwardAPI]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi - K8SVolumeTypeDownwardAPI = K8SVolumeTypeKey.String("downwardAPI") - // An [emptyDir] volume - // Stability: development - // - // [emptyDir]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir - K8SVolumeTypeEmptyDir = K8SVolumeTypeKey.String("emptyDir") - // A [secret] volume - // Stability: development - // - // [secret]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#secret - K8SVolumeTypeSecret = K8SVolumeTypeKey.String("secret") - // A [local] volume - // Stability: development - // - // [local]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#local - K8SVolumeTypeLocal = K8SVolumeTypeKey.String("local") -) - -// Namespace: linux -const ( - // LinuxMemorySlabStateKey is the attribute Key conforming to the - // "linux.memory.slab.state" semantic conventions. It represents the Linux Slab - // memory state. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "reclaimable", "unreclaimable" - LinuxMemorySlabStateKey = attribute.Key("linux.memory.slab.state") -) - -// Enum values for linux.memory.slab.state -var ( - // reclaimable - // Stability: development - LinuxMemorySlabStateReclaimable = LinuxMemorySlabStateKey.String("reclaimable") - // unreclaimable - // Stability: development - LinuxMemorySlabStateUnreclaimable = LinuxMemorySlabStateKey.String("unreclaimable") -) - -// Namespace: log -const ( - // LogFileNameKey is the attribute Key conforming to the "log.file.name" - // semantic conventions. It represents the basename of the file. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "audit.log" - LogFileNameKey = attribute.Key("log.file.name") - - // LogFileNameResolvedKey is the attribute Key conforming to the - // "log.file.name_resolved" semantic conventions. It represents the basename of - // the file, with symlinks resolved. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "uuid.log" - LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") - - // LogFilePathKey is the attribute Key conforming to the "log.file.path" - // semantic conventions. It represents the full path to the file. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/var/log/mysql/audit.log" - LogFilePathKey = attribute.Key("log.file.path") - - // LogFilePathResolvedKey is the attribute Key conforming to the - // "log.file.path_resolved" semantic conventions. It represents the full path to - // the file, with symlinks resolved. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/var/lib/docker/uuid.log" - LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") - - // LogIostreamKey is the attribute Key conforming to the "log.iostream" semantic - // conventions. It represents the stream associated with the log. See below for - // a list of well-known values. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - LogIostreamKey = attribute.Key("log.iostream") - - // LogRecordOriginalKey is the attribute Key conforming to the - // "log.record.original" semantic conventions. It represents the complete - // original Log Record. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - - - // Something happened", "[INFO] 8/3/24 12:34:56 Something happened" - // Note: This value MAY be added when processing a Log Record which was - // originally transmitted as a string or equivalent data type AND the Body field - // of the Log Record does not contain the same value. (e.g. a syslog or a log - // record read from a file.) - LogRecordOriginalKey = attribute.Key("log.record.original") - - // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" - // semantic conventions. It represents a unique identifier for the Log Record. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "01ARZ3NDEKTSV4RRFFQ69G5FAV" - // Note: If an id is provided, other log records with the same id will be - // considered duplicates and can be removed safely. This means, that two - // distinguishable log records MUST have different values. - // The id MAY be an - // [Universally Unique Lexicographically Sortable Identifier (ULID)], but other - // identifiers (e.g. UUID) may be used as needed. - // - // [Universally Unique Lexicographically Sortable Identifier (ULID)]: https://github.com/ulid/spec - LogRecordUIDKey = attribute.Key("log.record.uid") -) - -// LogFileName returns an attribute KeyValue conforming to the "log.file.name" -// semantic conventions. It represents the basename of the file. -func LogFileName(val string) attribute.KeyValue { - return LogFileNameKey.String(val) -} - -// LogFileNameResolved returns an attribute KeyValue conforming to the -// "log.file.name_resolved" semantic conventions. It represents the basename of -// the file, with symlinks resolved. -func LogFileNameResolved(val string) attribute.KeyValue { - return LogFileNameResolvedKey.String(val) -} - -// LogFilePath returns an attribute KeyValue conforming to the "log.file.path" -// semantic conventions. It represents the full path to the file. -func LogFilePath(val string) attribute.KeyValue { - return LogFilePathKey.String(val) -} - -// LogFilePathResolved returns an attribute KeyValue conforming to the -// "log.file.path_resolved" semantic conventions. It represents the full path to -// the file, with symlinks resolved. -func LogFilePathResolved(val string) attribute.KeyValue { - return LogFilePathResolvedKey.String(val) -} - -// LogRecordOriginal returns an attribute KeyValue conforming to the -// "log.record.original" semantic conventions. It represents the complete -// original Log Record. -func LogRecordOriginal(val string) attribute.KeyValue { - return LogRecordOriginalKey.String(val) -} - -// LogRecordUID returns an attribute KeyValue conforming to the "log.record.uid" -// semantic conventions. It represents a unique identifier for the Log Record. -func LogRecordUID(val string) attribute.KeyValue { - return LogRecordUIDKey.String(val) -} - -// Enum values for log.iostream -var ( - // Logs from stdout stream - // Stability: development - LogIostreamStdout = LogIostreamKey.String("stdout") - // Events from stderr stream - // Stability: development - LogIostreamStderr = LogIostreamKey.String("stderr") -) - -// Namespace: messaging -const ( - // MessagingBatchMessageCountKey is the attribute Key conforming to the - // "messaging.batch.message_count" semantic conventions. It represents the - // number of messages sent, received, or processed in the scope of the batching - // operation. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 0, 1, 2 - // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on - // spans that operate with a single message. When a messaging client library - // supports both batch and single-message API for the same operation, - // instrumentations SHOULD use `messaging.batch.message_count` for batching APIs - // and SHOULD NOT use it for single-message APIs. - MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") - - // MessagingClientIDKey is the attribute Key conforming to the - // "messaging.client.id" semantic conventions. It represents a unique identifier - // for the client that consumes or produces a message. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "client-5", "myhost@8742@s8083jm" - MessagingClientIDKey = attribute.Key("messaging.client.id") - - // MessagingConsumerGroupNameKey is the attribute Key conforming to the - // "messaging.consumer.group.name" semantic conventions. It represents the name - // of the consumer group with which a consumer is associated. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-group", "indexer" - // Note: Semantic conventions for individual messaging systems SHOULD document - // whether `messaging.consumer.group.name` is applicable and what it means in - // the context of that system. - MessagingConsumerGroupNameKey = attribute.Key("messaging.consumer.group.name") - - // MessagingDestinationAnonymousKey is the attribute Key conforming to the - // "messaging.destination.anonymous" semantic conventions. It represents a - // boolean that is true if the message destination is anonymous (could be - // unnamed or have auto-generated name). - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") - - // MessagingDestinationNameKey is the attribute Key conforming to the - // "messaging.destination.name" semantic conventions. It represents the message - // destination name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "MyQueue", "MyTopic" - // Note: Destination name SHOULD uniquely identify a specific queue, topic or - // other entity within the broker. If - // the broker doesn't have such notion, the destination name SHOULD uniquely - // identify the broker. - MessagingDestinationNameKey = attribute.Key("messaging.destination.name") - - // MessagingDestinationPartitionIDKey is the attribute Key conforming to the - // "messaging.destination.partition.id" semantic conventions. It represents the - // identifier of the partition messages are sent to or received from, unique - // within the `messaging.destination.name`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1 - MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id") - - // MessagingDestinationSubscriptionNameKey is the attribute Key conforming to - // the "messaging.destination.subscription.name" semantic conventions. It - // represents the name of the destination subscription from which a message is - // consumed. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "subscription-a" - // Note: Semantic conventions for individual messaging systems SHOULD document - // whether `messaging.destination.subscription.name` is applicable and what it - // means in the context of that system. - MessagingDestinationSubscriptionNameKey = attribute.Key("messaging.destination.subscription.name") - - // MessagingDestinationTemplateKey is the attribute Key conforming to the - // "messaging.destination.template" semantic conventions. It represents the low - // cardinality representation of the messaging destination name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/customers/{customerId}" - // Note: Destination names could be constructed from templates. An example would - // be a destination name involving a user name or product id. Although the - // destination name in this case is of high cardinality, the underlying template - // is of low cardinality and can be effectively used for grouping and - // aggregation. - MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") - - // MessagingDestinationTemporaryKey is the attribute Key conforming to the - // "messaging.destination.temporary" semantic conventions. It represents a - // boolean that is true if the message destination is temporary and might not - // exist anymore after messages are processed. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") - - // MessagingEventhubsMessageEnqueuedTimeKey is the attribute Key conforming to - // the "messaging.eventhubs.message.enqueued_time" semantic conventions. It - // represents the UTC epoch seconds at which the message has been accepted and - // stored in the entity. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingEventhubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time") - - // MessagingGCPPubsubMessageAckDeadlineKey is the attribute Key conforming to - // the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It - // represents the ack deadline in seconds set for the modify ack deadline - // request. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingGCPPubsubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline") - - // MessagingGCPPubsubMessageAckIDKey is the attribute Key conforming to the - // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the - // ack id for a given message. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: ack_id - MessagingGCPPubsubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id") - - // MessagingGCPPubsubMessageDeliveryAttemptKey is the attribute Key conforming - // to the "messaging.gcp_pubsub.message.delivery_attempt" semantic conventions. - // It represents the delivery attempt for a given message. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingGCPPubsubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt") - - // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming to - // the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It - // represents the ordering key for a given message. If the attribute is not - // present, the message does not have an ordering key. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: ordering_key - MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key") - - // MessagingKafkaMessageKeyKey is the attribute Key conforming to the - // "messaging.kafka.message.key" semantic conventions. It represents the message - // keys in Kafka are used for grouping alike messages to ensure they're - // processed on the same partition. They differ from `messaging.message.id` in - // that they're not unique. If the key is `null`, the attribute MUST NOT be set. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: myKey - // Note: If the key type is not string, it's string representation has to be - // supplied for the attribute. If the key has no unambiguous, canonical string - // form, don't include its value. - MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") - - // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the - // "messaging.kafka.message.tombstone" semantic conventions. It represents a - // boolean that is true if the message is a tombstone. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") - - // MessagingKafkaOffsetKey is the attribute Key conforming to the - // "messaging.kafka.offset" semantic conventions. It represents the offset of a - // record in the corresponding Kafka partition. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingKafkaOffsetKey = attribute.Key("messaging.kafka.offset") - - // MessagingMessageBodySizeKey is the attribute Key conforming to the - // "messaging.message.body.size" semantic conventions. It represents the size of - // the message body in bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Note: This can refer to both the compressed or uncompressed body size. If - // both sizes are known, the uncompressed - // body size should be used. - MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size") - - // MessagingMessageConversationIDKey is the attribute Key conforming to the - // "messaging.message.conversation_id" semantic conventions. It represents the - // conversation ID identifying the conversation to which the message belongs, - // represented as a string. Sometimes called "Correlation ID". - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: MyConversationId - MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") - - // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the - // "messaging.message.envelope.size" semantic conventions. It represents the - // size of the message body and metadata in bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Note: This can refer to both the compressed or uncompressed size. If both - // sizes are known, the uncompressed - // size should be used. - MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size") - - // MessagingMessageIDKey is the attribute Key conforming to the - // "messaging.message.id" semantic conventions. It represents a value used by - // the messaging system as an identifier for the message, represented as a - // string. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 452a7c7c7c7048c2f887f61572b18fc2 - MessagingMessageIDKey = attribute.Key("messaging.message.id") - - // MessagingOperationNameKey is the attribute Key conforming to the - // "messaging.operation.name" semantic conventions. It represents the - // system-specific name of the messaging operation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "ack", "nack", "send" - MessagingOperationNameKey = attribute.Key("messaging.operation.name") - - // MessagingOperationTypeKey is the attribute Key conforming to the - // "messaging.operation.type" semantic conventions. It represents a string - // identifying the type of the messaging operation. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: If a custom value is used, it MUST be of low cardinality. - MessagingOperationTypeKey = attribute.Key("messaging.operation.type") - - // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key conforming to - // the "messaging.rabbitmq.destination.routing_key" semantic conventions. It - // represents the rabbitMQ message routing key. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: myKey - MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") - - // MessagingRabbitmqMessageDeliveryTagKey is the attribute Key conforming to the - // "messaging.rabbitmq.message.delivery_tag" semantic conventions. It represents - // the rabbitMQ message delivery tag. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingRabbitmqMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag") - - // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to the - // "messaging.rocketmq.consumption_model" semantic conventions. It represents - // the model of message consumption. This only applies to consumer spans. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") - - // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key conforming to - // the "messaging.rocketmq.message.delay_time_level" semantic conventions. It - // represents the delay time level for delay message, which determines the - // message delay time. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") - - // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key conforming - // to the "messaging.rocketmq.message.delivery_timestamp" semantic conventions. - // It represents the timestamp in milliseconds that the delay message is - // expected to be delivered to consumer. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") - - // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the - // "messaging.rocketmq.message.group" semantic conventions. It represents the it - // is essential for FIFO message. Messages that belong to the same message group - // are always processed one by one within the same consumer group. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: myMessageGroup - MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") - - // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the - // "messaging.rocketmq.message.keys" semantic conventions. It represents the - // key(s) of message, another way to mark message besides message id. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "keyA", "keyB" - MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") - - // MessagingRocketmqMessageTagKey is the attribute Key conforming to the - // "messaging.rocketmq.message.tag" semantic conventions. It represents the - // secondary classifier of message besides topic. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: tagA - MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") - - // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the - // "messaging.rocketmq.message.type" semantic conventions. It represents the - // type of message. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") - - // MessagingRocketmqNamespaceKey is the attribute Key conforming to the - // "messaging.rocketmq.namespace" semantic conventions. It represents the - // namespace of RocketMQ resources, resources in different namespaces are - // individual. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: myNamespace - MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") - - // MessagingServicebusDispositionStatusKey is the attribute Key conforming to - // the "messaging.servicebus.disposition_status" semantic conventions. It - // represents the describes the [settlement type]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [settlement type]: https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock - MessagingServicebusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status") - - // MessagingServicebusMessageDeliveryCountKey is the attribute Key conforming to - // the "messaging.servicebus.message.delivery_count" semantic conventions. It - // represents the number of deliveries that have been attempted for this - // message. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingServicebusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count") - - // MessagingServicebusMessageEnqueuedTimeKey is the attribute Key conforming to - // the "messaging.servicebus.message.enqueued_time" semantic conventions. It - // represents the UTC epoch seconds at which the message has been accepted and - // stored in the entity. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - MessagingServicebusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time") - - // MessagingSystemKey is the attribute Key conforming to the "messaging.system" - // semantic conventions. It represents the messaging system as identified by the - // client instrumentation. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: The actual messaging system may differ from the one known by the - // client. For example, when using Kafka client libraries to communicate with - // Azure Event Hubs, the `messaging.system` is set to `kafka` based on the - // instrumentation's best knowledge. - MessagingSystemKey = attribute.Key("messaging.system") -) - -// MessagingBatchMessageCount returns an attribute KeyValue conforming to the -// "messaging.batch.message_count" semantic conventions. It represents the number -// of messages sent, received, or processed in the scope of the batching -// operation. -func MessagingBatchMessageCount(val int) attribute.KeyValue { - return MessagingBatchMessageCountKey.Int(val) -} - -// MessagingClientID returns an attribute KeyValue conforming to the -// "messaging.client.id" semantic conventions. It represents a unique identifier -// for the client that consumes or produces a message. -func MessagingClientID(val string) attribute.KeyValue { - return MessagingClientIDKey.String(val) -} - -// MessagingConsumerGroupName returns an attribute KeyValue conforming to the -// "messaging.consumer.group.name" semantic conventions. It represents the name -// of the consumer group with which a consumer is associated. -func MessagingConsumerGroupName(val string) attribute.KeyValue { - return MessagingConsumerGroupNameKey.String(val) -} - -// MessagingDestinationAnonymous returns an attribute KeyValue conforming to the -// "messaging.destination.anonymous" semantic conventions. It represents a -// boolean that is true if the message destination is anonymous (could be unnamed -// or have auto-generated name). -func MessagingDestinationAnonymous(val bool) attribute.KeyValue { - return MessagingDestinationAnonymousKey.Bool(val) -} - -// MessagingDestinationName returns an attribute KeyValue conforming to the -// "messaging.destination.name" semantic conventions. It represents the message -// destination name. -func MessagingDestinationName(val string) attribute.KeyValue { - return MessagingDestinationNameKey.String(val) -} - -// MessagingDestinationPartitionID returns an attribute KeyValue conforming to -// the "messaging.destination.partition.id" semantic conventions. It represents -// the identifier of the partition messages are sent to or received from, unique -// within the `messaging.destination.name`. -func MessagingDestinationPartitionID(val string) attribute.KeyValue { - return MessagingDestinationPartitionIDKey.String(val) -} - -// MessagingDestinationSubscriptionName returns an attribute KeyValue conforming -// to the "messaging.destination.subscription.name" semantic conventions. It -// represents the name of the destination subscription from which a message is -// consumed. -func MessagingDestinationSubscriptionName(val string) attribute.KeyValue { - return MessagingDestinationSubscriptionNameKey.String(val) -} - -// MessagingDestinationTemplate returns an attribute KeyValue conforming to the -// "messaging.destination.template" semantic conventions. It represents the low -// cardinality representation of the messaging destination name. -func MessagingDestinationTemplate(val string) attribute.KeyValue { - return MessagingDestinationTemplateKey.String(val) -} - -// MessagingDestinationTemporary returns an attribute KeyValue conforming to the -// "messaging.destination.temporary" semantic conventions. It represents a -// boolean that is true if the message destination is temporary and might not -// exist anymore after messages are processed. -func MessagingDestinationTemporary(val bool) attribute.KeyValue { - return MessagingDestinationTemporaryKey.Bool(val) -} - -// MessagingEventhubsMessageEnqueuedTime returns an attribute KeyValue conforming -// to the "messaging.eventhubs.message.enqueued_time" semantic conventions. It -// represents the UTC epoch seconds at which the message has been accepted and -// stored in the entity. -func MessagingEventhubsMessageEnqueuedTime(val int) attribute.KeyValue { - return MessagingEventhubsMessageEnqueuedTimeKey.Int(val) -} - -// MessagingGCPPubsubMessageAckDeadline returns an attribute KeyValue conforming -// to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It -// represents the ack deadline in seconds set for the modify ack deadline -// request. -func MessagingGCPPubsubMessageAckDeadline(val int) attribute.KeyValue { - return MessagingGCPPubsubMessageAckDeadlineKey.Int(val) -} - -// MessagingGCPPubsubMessageAckID returns an attribute KeyValue conforming to the -// "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the -// ack id for a given message. -func MessagingGCPPubsubMessageAckID(val string) attribute.KeyValue { - return MessagingGCPPubsubMessageAckIDKey.String(val) -} - -// MessagingGCPPubsubMessageDeliveryAttempt returns an attribute KeyValue -// conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic -// conventions. It represents the delivery attempt for a given message. -func MessagingGCPPubsubMessageDeliveryAttempt(val int) attribute.KeyValue { - return MessagingGCPPubsubMessageDeliveryAttemptKey.Int(val) -} - -// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue conforming -// to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It -// represents the ordering key for a given message. If the attribute is not -// present, the message does not have an ordering key. -func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue { - return MessagingGCPPubsubMessageOrderingKeyKey.String(val) -} - -// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the -// "messaging.kafka.message.key" semantic conventions. It represents the message -// keys in Kafka are used for grouping alike messages to ensure they're processed -// on the same partition. They differ from `messaging.message.id` in that they're -// not unique. If the key is `null`, the attribute MUST NOT be set. -func MessagingKafkaMessageKey(val string) attribute.KeyValue { - return MessagingKafkaMessageKeyKey.String(val) -} - -// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming to the -// "messaging.kafka.message.tombstone" semantic conventions. It represents a -// boolean that is true if the message is a tombstone. -func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { - return MessagingKafkaMessageTombstoneKey.Bool(val) -} - -// MessagingKafkaOffset returns an attribute KeyValue conforming to the -// "messaging.kafka.offset" semantic conventions. It represents the offset of a -// record in the corresponding Kafka partition. -func MessagingKafkaOffset(val int) attribute.KeyValue { - return MessagingKafkaOffsetKey.Int(val) -} - -// MessagingMessageBodySize returns an attribute KeyValue conforming to the -// "messaging.message.body.size" semantic conventions. It represents the size of -// the message body in bytes. -func MessagingMessageBodySize(val int) attribute.KeyValue { - return MessagingMessageBodySizeKey.Int(val) -} - -// MessagingMessageConversationID returns an attribute KeyValue conforming to the -// "messaging.message.conversation_id" semantic conventions. It represents the -// conversation ID identifying the conversation to which the message belongs, -// represented as a string. Sometimes called "Correlation ID". -func MessagingMessageConversationID(val string) attribute.KeyValue { - return MessagingMessageConversationIDKey.String(val) -} - -// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to the -// "messaging.message.envelope.size" semantic conventions. It represents the size -// of the message body and metadata in bytes. -func MessagingMessageEnvelopeSize(val int) attribute.KeyValue { - return MessagingMessageEnvelopeSizeKey.Int(val) -} - -// MessagingMessageID returns an attribute KeyValue conforming to the -// "messaging.message.id" semantic conventions. It represents a value used by the -// messaging system as an identifier for the message, represented as a string. -func MessagingMessageID(val string) attribute.KeyValue { - return MessagingMessageIDKey.String(val) -} - -// MessagingOperationName returns an attribute KeyValue conforming to the -// "messaging.operation.name" semantic conventions. It represents the -// system-specific name of the messaging operation. -func MessagingOperationName(val string) attribute.KeyValue { - return MessagingOperationNameKey.String(val) -} - -// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue -// conforming to the "messaging.rabbitmq.destination.routing_key" semantic -// conventions. It represents the rabbitMQ message routing key. -func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { - return MessagingRabbitmqDestinationRoutingKeyKey.String(val) -} - -// MessagingRabbitmqMessageDeliveryTag returns an attribute KeyValue conforming -// to the "messaging.rabbitmq.message.delivery_tag" semantic conventions. It -// represents the rabbitMQ message delivery tag. -func MessagingRabbitmqMessageDeliveryTag(val int) attribute.KeyValue { - return MessagingRabbitmqMessageDeliveryTagKey.Int(val) -} - -// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue -// conforming to the "messaging.rocketmq.message.delay_time_level" semantic -// conventions. It represents the delay time level for delay message, which -// determines the message delay time. -func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { - return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) -} - -// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue -// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic -// conventions. It represents the timestamp in milliseconds that the delay -// message is expected to be delivered to consumer. -func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { - return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) -} - -// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to the -// "messaging.rocketmq.message.group" semantic conventions. It represents the it -// is essential for FIFO message. Messages that belong to the same message group -// are always processed one by one within the same consumer group. -func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { - return MessagingRocketmqMessageGroupKey.String(val) -} - -// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to the -// "messaging.rocketmq.message.keys" semantic conventions. It represents the -// key(s) of message, another way to mark message besides message id. -func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { - return MessagingRocketmqMessageKeysKey.StringSlice(val) -} - -// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to the -// "messaging.rocketmq.message.tag" semantic conventions. It represents the -// secondary classifier of message besides topic. -func MessagingRocketmqMessageTag(val string) attribute.KeyValue { - return MessagingRocketmqMessageTagKey.String(val) -} - -// MessagingRocketmqNamespace returns an attribute KeyValue conforming to the -// "messaging.rocketmq.namespace" semantic conventions. It represents the -// namespace of RocketMQ resources, resources in different namespaces are -// individual. -func MessagingRocketmqNamespace(val string) attribute.KeyValue { - return MessagingRocketmqNamespaceKey.String(val) -} - -// MessagingServicebusMessageDeliveryCount returns an attribute KeyValue -// conforming to the "messaging.servicebus.message.delivery_count" semantic -// conventions. It represents the number of deliveries that have been attempted -// for this message. -func MessagingServicebusMessageDeliveryCount(val int) attribute.KeyValue { - return MessagingServicebusMessageDeliveryCountKey.Int(val) -} - -// MessagingServicebusMessageEnqueuedTime returns an attribute KeyValue -// conforming to the "messaging.servicebus.message.enqueued_time" semantic -// conventions. It represents the UTC epoch seconds at which the message has been -// accepted and stored in the entity. -func MessagingServicebusMessageEnqueuedTime(val int) attribute.KeyValue { - return MessagingServicebusMessageEnqueuedTimeKey.Int(val) -} - -// Enum values for messaging.operation.type -var ( - // A message is created. "Create" spans always refer to a single message and are - // used to provide a unique creation context for messages in batch sending - // scenarios. - // - // Stability: development - MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create") - // One or more messages are provided for sending to an intermediary. If a single - // message is sent, the context of the "Send" span can be used as the creation - // context and no "Create" span needs to be created. - // - // Stability: development - MessagingOperationTypeSend = MessagingOperationTypeKey.String("send") - // One or more messages are requested by a consumer. This operation refers to - // pull-based scenarios, where consumers explicitly call methods of messaging - // SDKs to receive messages. - // - // Stability: development - MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive") - // One or more messages are processed by a consumer. - // - // Stability: development - MessagingOperationTypeProcess = MessagingOperationTypeKey.String("process") - // One or more messages are settled. - // - // Stability: development - MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle") - // Deprecated: Replaced by `process`. - MessagingOperationTypeDeliver = MessagingOperationTypeKey.String("deliver") - // Deprecated: Replaced by `send`. - MessagingOperationTypePublish = MessagingOperationTypeKey.String("publish") -) - -// Enum values for messaging.rocketmq.consumption_model -var ( - // Clustering consumption model - // Stability: development - MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") - // Broadcasting consumption model - // Stability: development - MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") -) - -// Enum values for messaging.rocketmq.message.type -var ( - // Normal message - // Stability: development - MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") - // FIFO message - // Stability: development - MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") - // Delay message - // Stability: development - MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") - // Transaction message - // Stability: development - MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") -) - -// Enum values for messaging.servicebus.disposition_status -var ( - // Message is completed - // Stability: development - MessagingServicebusDispositionStatusComplete = MessagingServicebusDispositionStatusKey.String("complete") - // Message is abandoned - // Stability: development - MessagingServicebusDispositionStatusAbandon = MessagingServicebusDispositionStatusKey.String("abandon") - // Message is sent to dead letter queue - // Stability: development - MessagingServicebusDispositionStatusDeadLetter = MessagingServicebusDispositionStatusKey.String("dead_letter") - // Message is deferred - // Stability: development - MessagingServicebusDispositionStatusDefer = MessagingServicebusDispositionStatusKey.String("defer") -) - -// Enum values for messaging.system -var ( - // Apache ActiveMQ - // Stability: development - MessagingSystemActivemq = MessagingSystemKey.String("activemq") - // Amazon Simple Queue Service (SQS) - // Stability: development - MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs") - // Azure Event Grid - // Stability: development - MessagingSystemEventgrid = MessagingSystemKey.String("eventgrid") - // Azure Event Hubs - // Stability: development - MessagingSystemEventhubs = MessagingSystemKey.String("eventhubs") - // Azure Service Bus - // Stability: development - MessagingSystemServicebus = MessagingSystemKey.String("servicebus") - // Google Cloud Pub/Sub - // Stability: development - MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub") - // Java Message Service - // Stability: development - MessagingSystemJms = MessagingSystemKey.String("jms") - // Apache Kafka - // Stability: development - MessagingSystemKafka = MessagingSystemKey.String("kafka") - // RabbitMQ - // Stability: development - MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq") - // Apache RocketMQ - // Stability: development - MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq") - // Apache Pulsar - // Stability: development - MessagingSystemPulsar = MessagingSystemKey.String("pulsar") -) - -// Namespace: network -const ( - // NetworkCarrierIccKey is the attribute Key conforming to the - // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 - // alpha-2 2-character country code associated with the mobile carrier network. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: DE - NetworkCarrierIccKey = attribute.Key("network.carrier.icc") - - // NetworkCarrierMccKey is the attribute Key conforming to the - // "network.carrier.mcc" semantic conventions. It represents the mobile carrier - // country code. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 310 - NetworkCarrierMccKey = attribute.Key("network.carrier.mcc") - - // NetworkCarrierMncKey is the attribute Key conforming to the - // "network.carrier.mnc" semantic conventions. It represents the mobile carrier - // network code. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 001 - NetworkCarrierMncKey = attribute.Key("network.carrier.mnc") - - // NetworkCarrierNameKey is the attribute Key conforming to the - // "network.carrier.name" semantic conventions. It represents the name of the - // mobile carrier. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: sprint - NetworkCarrierNameKey = attribute.Key("network.carrier.name") - - // NetworkConnectionStateKey is the attribute Key conforming to the - // "network.connection.state" semantic conventions. It represents the state of - // network connection. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "close_wait" - // Note: Connection states are defined as part of the [rfc9293] - // - // [rfc9293]: https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2 - NetworkConnectionStateKey = attribute.Key("network.connection.state") - - // NetworkConnectionSubtypeKey is the attribute Key conforming to the - // "network.connection.subtype" semantic conventions. It represents the this - // describes more details regarding the connection.type. It may be the type of - // cell technology connection, but it could be used for describing details about - // a wifi connection. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: LTE - NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") - - // NetworkConnectionTypeKey is the attribute Key conforming to the - // "network.connection.type" semantic conventions. It represents the internet - // connection type. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: wifi - NetworkConnectionTypeKey = attribute.Key("network.connection.type") - - // NetworkInterfaceNameKey is the attribute Key conforming to the - // "network.interface.name" semantic conventions. It represents the network - // interface name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "lo", "eth0" - NetworkInterfaceNameKey = attribute.Key("network.interface.name") - - // NetworkIoDirectionKey is the attribute Key conforming to the - // "network.io.direction" semantic conventions. It represents the network IO - // operation direction. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "transmit" - NetworkIoDirectionKey = attribute.Key("network.io.direction") - - // NetworkLocalAddressKey is the attribute Key conforming to the - // "network.local.address" semantic conventions. It represents the local address - // of the network connection - IP address or Unix domain socket name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "10.1.2.80", "/tmp/my.sock" - NetworkLocalAddressKey = attribute.Key("network.local.address") - - // NetworkLocalPortKey is the attribute Key conforming to the - // "network.local.port" semantic conventions. It represents the local port - // number of the network connection. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: 65123 - NetworkLocalPortKey = attribute.Key("network.local.port") - - // NetworkPeerAddressKey is the attribute Key conforming to the - // "network.peer.address" semantic conventions. It represents the peer address - // of the network connection - IP address or Unix domain socket name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "10.1.2.80", "/tmp/my.sock" - NetworkPeerAddressKey = attribute.Key("network.peer.address") - - // NetworkPeerPortKey is the attribute Key conforming to the "network.peer.port" - // semantic conventions. It represents the peer port number of the network - // connection. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: 65123 - NetworkPeerPortKey = attribute.Key("network.peer.port") - - // NetworkProtocolNameKey is the attribute Key conforming to the - // "network.protocol.name" semantic conventions. It represents the - // [OSI application layer] or non-OSI equivalent. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "amqp", "http", "mqtt" - // Note: The value SHOULD be normalized to lowercase. - // - // [OSI application layer]: https://wikipedia.org/wiki/Application_layer - NetworkProtocolNameKey = attribute.Key("network.protocol.name") - - // NetworkProtocolVersionKey is the attribute Key conforming to the - // "network.protocol.version" semantic conventions. It represents the actual - // version of the protocol used for network communication. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "1.1", "2" - // Note: If protocol version is subject to negotiation (for example using [ALPN] - // ), this attribute SHOULD be set to the negotiated version. If the actual - // protocol version is not known, this attribute SHOULD NOT be set. - // - // [ALPN]: https://www.rfc-editor.org/rfc/rfc7301.html - NetworkProtocolVersionKey = attribute.Key("network.protocol.version") - - // NetworkTransportKey is the attribute Key conforming to the - // "network.transport" semantic conventions. It represents the - // [OSI transport layer] or [inter-process communication method]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "tcp", "udp" - // Note: The value SHOULD be normalized to lowercase. - // - // Consider always setting the transport when setting a port number, since - // a port number is ambiguous without knowing the transport. For example - // different processes could be listening on TCP port 12345 and UDP port 12345. - // - // [OSI transport layer]: https://wikipedia.org/wiki/Transport_layer - // [inter-process communication method]: https://wikipedia.org/wiki/Inter-process_communication - NetworkTransportKey = attribute.Key("network.transport") - - // NetworkTypeKey is the attribute Key conforming to the "network.type" semantic - // conventions. It represents the [OSI network layer] or non-OSI equivalent. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "ipv4", "ipv6" - // Note: The value SHOULD be normalized to lowercase. - // - // [OSI network layer]: https://wikipedia.org/wiki/Network_layer - NetworkTypeKey = attribute.Key("network.type") -) - -// NetworkCarrierIcc returns an attribute KeyValue conforming to the -// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 -// alpha-2 2-character country code associated with the mobile carrier network. -func NetworkCarrierIcc(val string) attribute.KeyValue { - return NetworkCarrierIccKey.String(val) -} - -// NetworkCarrierMcc returns an attribute KeyValue conforming to the -// "network.carrier.mcc" semantic conventions. It represents the mobile carrier -// country code. -func NetworkCarrierMcc(val string) attribute.KeyValue { - return NetworkCarrierMccKey.String(val) -} - -// NetworkCarrierMnc returns an attribute KeyValue conforming to the -// "network.carrier.mnc" semantic conventions. It represents the mobile carrier -// network code. -func NetworkCarrierMnc(val string) attribute.KeyValue { - return NetworkCarrierMncKey.String(val) -} - -// NetworkCarrierName returns an attribute KeyValue conforming to the -// "network.carrier.name" semantic conventions. It represents the name of the -// mobile carrier. -func NetworkCarrierName(val string) attribute.KeyValue { - return NetworkCarrierNameKey.String(val) -} - -// NetworkInterfaceName returns an attribute KeyValue conforming to the -// "network.interface.name" semantic conventions. It represents the network -// interface name. -func NetworkInterfaceName(val string) attribute.KeyValue { - return NetworkInterfaceNameKey.String(val) -} - -// NetworkLocalAddress returns an attribute KeyValue conforming to the -// "network.local.address" semantic conventions. It represents the local address -// of the network connection - IP address or Unix domain socket name. -func NetworkLocalAddress(val string) attribute.KeyValue { - return NetworkLocalAddressKey.String(val) -} - -// NetworkLocalPort returns an attribute KeyValue conforming to the -// "network.local.port" semantic conventions. It represents the local port number -// of the network connection. -func NetworkLocalPort(val int) attribute.KeyValue { - return NetworkLocalPortKey.Int(val) -} - -// NetworkPeerAddress returns an attribute KeyValue conforming to the -// "network.peer.address" semantic conventions. It represents the peer address of -// the network connection - IP address or Unix domain socket name. -func NetworkPeerAddress(val string) attribute.KeyValue { - return NetworkPeerAddressKey.String(val) -} - -// NetworkPeerPort returns an attribute KeyValue conforming to the -// "network.peer.port" semantic conventions. It represents the peer port number -// of the network connection. -func NetworkPeerPort(val int) attribute.KeyValue { - return NetworkPeerPortKey.Int(val) -} - -// NetworkProtocolName returns an attribute KeyValue conforming to the -// "network.protocol.name" semantic conventions. It represents the -// [OSI application layer] or non-OSI equivalent. -// -// [OSI application layer]: https://wikipedia.org/wiki/Application_layer -func NetworkProtocolName(val string) attribute.KeyValue { - return NetworkProtocolNameKey.String(val) -} - -// NetworkProtocolVersion returns an attribute KeyValue conforming to the -// "network.protocol.version" semantic conventions. It represents the actual -// version of the protocol used for network communication. -func NetworkProtocolVersion(val string) attribute.KeyValue { - return NetworkProtocolVersionKey.String(val) -} - -// Enum values for network.connection.state -var ( - // closed - // Stability: development - NetworkConnectionStateClosed = NetworkConnectionStateKey.String("closed") - // close_wait - // Stability: development - NetworkConnectionStateCloseWait = NetworkConnectionStateKey.String("close_wait") - // closing - // Stability: development - NetworkConnectionStateClosing = NetworkConnectionStateKey.String("closing") - // established - // Stability: development - NetworkConnectionStateEstablished = NetworkConnectionStateKey.String("established") - // fin_wait_1 - // Stability: development - NetworkConnectionStateFinWait1 = NetworkConnectionStateKey.String("fin_wait_1") - // fin_wait_2 - // Stability: development - NetworkConnectionStateFinWait2 = NetworkConnectionStateKey.String("fin_wait_2") - // last_ack - // Stability: development - NetworkConnectionStateLastAck = NetworkConnectionStateKey.String("last_ack") - // listen - // Stability: development - NetworkConnectionStateListen = NetworkConnectionStateKey.String("listen") - // syn_received - // Stability: development - NetworkConnectionStateSynReceived = NetworkConnectionStateKey.String("syn_received") - // syn_sent - // Stability: development - NetworkConnectionStateSynSent = NetworkConnectionStateKey.String("syn_sent") - // time_wait - // Stability: development - NetworkConnectionStateTimeWait = NetworkConnectionStateKey.String("time_wait") -) - -// Enum values for network.connection.subtype -var ( - // GPRS - // Stability: development - NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") - // EDGE - // Stability: development - NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") - // UMTS - // Stability: development - NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") - // CDMA - // Stability: development - NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") - // EVDO Rel. 0 - // Stability: development - NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") - // EVDO Rev. A - // Stability: development - NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") - // CDMA2000 1XRTT - // Stability: development - NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") - // HSDPA - // Stability: development - NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") - // HSUPA - // Stability: development - NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") - // HSPA - // Stability: development - NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") - // IDEN - // Stability: development - NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") - // EVDO Rev. B - // Stability: development - NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") - // LTE - // Stability: development - NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") - // EHRPD - // Stability: development - NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") - // HSPAP - // Stability: development - NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") - // GSM - // Stability: development - NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") - // TD-SCDMA - // Stability: development - NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") - // IWLAN - // Stability: development - NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") - // 5G NR (New Radio) - // Stability: development - NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") - // 5G NRNSA (New Radio Non-Standalone) - // Stability: development - NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") - // LTE CA - // Stability: development - NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") -) - -// Enum values for network.connection.type -var ( - // wifi - // Stability: development - NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") - // wired - // Stability: development - NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") - // cell - // Stability: development - NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") - // unavailable - // Stability: development - NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") - // unknown - // Stability: development - NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") -) - -// Enum values for network.io.direction -var ( - // transmit - // Stability: development - NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit") - // receive - // Stability: development - NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive") -) - -// Enum values for network.transport -var ( - // TCP - // Stability: stable - NetworkTransportTCP = NetworkTransportKey.String("tcp") - // UDP - // Stability: stable - NetworkTransportUDP = NetworkTransportKey.String("udp") - // Named or anonymous pipe. - // Stability: stable - NetworkTransportPipe = NetworkTransportKey.String("pipe") - // Unix domain socket - // Stability: stable - NetworkTransportUnix = NetworkTransportKey.String("unix") - // QUIC - // Stability: development - NetworkTransportQUIC = NetworkTransportKey.String("quic") -) - -// Enum values for network.type -var ( - // IPv4 - // Stability: stable - NetworkTypeIpv4 = NetworkTypeKey.String("ipv4") - // IPv6 - // Stability: stable - NetworkTypeIpv6 = NetworkTypeKey.String("ipv6") -) - -// Namespace: oci -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: Recommended - // Stability: Development - // - // Examples: - // "sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4" - // Note: Follows [OCI Image Manifest Specification], and specifically the - // [Digest property]. - // An example can be found in [Example Image Manifest]. - // - // [OCI Image Manifest Specification]: https://github.com/opencontainers/image-spec/blob/main/manifest.md - // [Digest property]: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests - // [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) -} - -// Namespace: opentracing -const ( - // OpentracingRefTypeKey is the attribute Key conforming to the - // "opentracing.ref_type" semantic conventions. It represents the parent-child - // Reference type. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: The causal relationship between a child Span and a parent Span. - OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") -) - -// Enum values for opentracing.ref_type -var ( - // The parent Span depends on the child Span in some capacity - // Stability: development - OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") - // The parent Span doesn't depend in any way on the result of the child Span - // Stability: development - OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") -) - -// Namespace: os -const ( - // OSBuildIDKey is the attribute Key conforming to the "os.build_id" semantic - // conventions. It represents the unique identifier for a particular build or - // compilation of the operating system. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "TQ3C.230805.001.B2", "20E247", "22621" - OSBuildIDKey = attribute.Key("os.build_id") - - // OSDescriptionKey is the attribute Key conforming to the "os.description" - // semantic conventions. It represents the human readable (not intended to be - // parsed) OS version information, like e.g. reported by `ver` or - // `lsb_release -a` commands. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Microsoft Windows [Version 10.0.18363.778]", "Ubuntu 18.04.1 LTS" - OSDescriptionKey = attribute.Key("os.description") - - // OSNameKey is the attribute Key conforming to the "os.name" semantic - // conventions. It represents the human readable operating system name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "iOS", "Android", "Ubuntu" - OSNameKey = attribute.Key("os.name") - - // OSTypeKey is the attribute Key conforming to the "os.type" semantic - // conventions. It represents the operating system type. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - OSTypeKey = attribute.Key("os.type") - - // OSVersionKey is the attribute Key conforming to the "os.version" semantic - // conventions. It represents the version string of the operating system as - // defined in [Version Attributes]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "14.2.1", "18.04.1" - // - // [Version Attributes]: /docs/resource/README.md#version-attributes - OSVersionKey = attribute.Key("os.version") -) - -// OSBuildID returns an attribute KeyValue conforming to the "os.build_id" -// semantic conventions. It represents the unique identifier for a particular -// build or compilation of the operating system. -func OSBuildID(val string) attribute.KeyValue { - return OSBuildIDKey.String(val) -} - -// OSDescription returns an attribute KeyValue conforming to the "os.description" -// semantic conventions. It represents the human readable (not intended to be -// parsed) OS version information, like e.g. reported by `ver` or -// `lsb_release -a` commands. -func OSDescription(val string) attribute.KeyValue { - return OSDescriptionKey.String(val) -} - -// OSName returns an attribute KeyValue conforming to the "os.name" semantic -// conventions. It represents the human readable operating system name. -func OSName(val string) attribute.KeyValue { - return OSNameKey.String(val) -} - -// OSVersion returns an attribute KeyValue conforming to the "os.version" -// semantic conventions. It represents the version string of the operating system -// as defined in [Version Attributes]. -// -// [Version Attributes]: /docs/resource/README.md#version-attributes -func OSVersion(val string) attribute.KeyValue { - return OSVersionKey.String(val) -} - -// Enum values for os.type -var ( - // Microsoft Windows - // Stability: development - OSTypeWindows = OSTypeKey.String("windows") - // Linux - // Stability: development - OSTypeLinux = OSTypeKey.String("linux") - // Apple Darwin - // Stability: development - OSTypeDarwin = OSTypeKey.String("darwin") - // FreeBSD - // Stability: development - OSTypeFreeBSD = OSTypeKey.String("freebsd") - // NetBSD - // Stability: development - OSTypeNetBSD = OSTypeKey.String("netbsd") - // OpenBSD - // Stability: development - OSTypeOpenBSD = OSTypeKey.String("openbsd") - // DragonFly BSD - // Stability: development - OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") - // HP-UX (Hewlett Packard Unix) - // Stability: development - OSTypeHPUX = OSTypeKey.String("hpux") - // AIX (Advanced Interactive eXecutive) - // Stability: development - OSTypeAIX = OSTypeKey.String("aix") - // SunOS, Oracle Solaris - // Stability: development - OSTypeSolaris = OSTypeKey.String("solaris") - // IBM z/OS - // Stability: development - OSTypeZOS = OSTypeKey.String("z_os") -) - -// Namespace: otel -const ( - // OTelScopeNameKey is the attribute Key conforming to the "otel.scope.name" - // semantic conventions. It represents the name of the instrumentation scope - ( - // `InstrumentationScope.Name` in OTLP). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "io.opentelemetry.contrib.mongodb" - OTelScopeNameKey = attribute.Key("otel.scope.name") - - // OTelScopeVersionKey is the attribute Key conforming to the - // "otel.scope.version" semantic conventions. It represents the version of the - // instrumentation scope - (`InstrumentationScope.Version` in OTLP). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "1.0.0" - OTelScopeVersionKey = attribute.Key("otel.scope.version") - - // OTelStatusCodeKey is the attribute Key conforming to the "otel.status_code" - // semantic conventions. It represents the name of the code, either "OK" or - // "ERROR". MUST NOT be set if the status code is UNSET. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: - OTelStatusCodeKey = attribute.Key("otel.status_code") - - // OTelStatusDescriptionKey is the attribute Key conforming to the - // "otel.status_description" semantic conventions. It represents the description - // of the Status if it has a value, otherwise not set. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "resource not found" - OTelStatusDescriptionKey = attribute.Key("otel.status_description") -) - -// OTelScopeName returns an attribute KeyValue conforming to the -// "otel.scope.name" semantic conventions. It represents the name of the -// instrumentation scope - (`InstrumentationScope.Name` in OTLP). -func OTelScopeName(val string) attribute.KeyValue { - return OTelScopeNameKey.String(val) -} - -// OTelScopeVersion returns an attribute KeyValue conforming to the -// "otel.scope.version" semantic conventions. It represents the version of the -// instrumentation scope - (`InstrumentationScope.Version` in OTLP). -func OTelScopeVersion(val string) attribute.KeyValue { - return OTelScopeVersionKey.String(val) -} - -// OTelStatusDescription returns an attribute KeyValue conforming to the -// "otel.status_description" semantic conventions. It represents the description -// of the Status if it has a value, otherwise not set. -func OTelStatusDescription(val string) attribute.KeyValue { - return OTelStatusDescriptionKey.String(val) -} - -// Enum values for otel.status_code -var ( - // The operation has been validated by an Application developer or Operator to - // have completed successfully. - // Stability: stable - OTelStatusCodeOk = OTelStatusCodeKey.String("OK") - // The operation contains an error. - // Stability: stable - OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") -) - -// Namespace: peer -const ( - // PeerServiceKey is the attribute Key conforming to the "peer.service" semantic - // conventions. It represents the [`service.name`] of the remote service. SHOULD - // be equal to the actual `service.name` resource attribute of the remote - // service if any. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: AuthTokenCache - // - // [`service.name`]: /docs/resource/README.md#service - PeerServiceKey = attribute.Key("peer.service") -) - -// PeerService returns an attribute KeyValue conforming to the "peer.service" -// semantic conventions. It represents the [`service.name`] of the remote -// service. SHOULD be equal to the actual `service.name` resource attribute of -// the remote service if any. -// -// [`service.name`]: /docs/resource/README.md#service -func PeerService(val string) attribute.KeyValue { - return PeerServiceKey.String(val) -} - -// Namespace: process -const ( - // ProcessArgsCountKey is the attribute Key conforming to the - // "process.args_count" semantic conventions. It represents the length of the - // process.command_args array. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 4 - // Note: This field can be useful for querying or performing bucket analysis on - // how many arguments were provided to start a process. More arguments may be an - // indication of suspicious activity. - ProcessArgsCountKey = attribute.Key("process.args_count") - - // ProcessCommandKey is the attribute Key conforming to the "process.command" - // semantic conventions. It represents the command used to launch the process - // (i.e. the command name). On Linux based systems, can be set to the zeroth - // string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter - // extracted from `GetCommandLineW`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "cmd/otelcol" - ProcessCommandKey = attribute.Key("process.command") - - // ProcessCommandArgsKey is the attribute Key conforming to the - // "process.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) as received by - // the process. On Linux-based systems (and some other Unixoid systems - // supporting procfs), can be set according to the list of null-delimited - // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this - // would be the full argv vector passed to `main`. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "cmd/otecol", "--config=config.yaml" - ProcessCommandArgsKey = attribute.Key("process.command_args") - - // ProcessCommandLineKey is the attribute Key conforming to the - // "process.command_line" semantic conventions. It represents the full command - // used to launch the process as a single string representing the full command. - // On Windows, can be set to the result of `GetCommandLineW`. Do not set this if - // you have to assemble it just for monitoring; use `process.command_args` - // instead. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "C:\cmd\otecol --config="my directory\config.yaml"" - ProcessCommandLineKey = attribute.Key("process.command_line") - - // ProcessContextSwitchTypeKey is the attribute Key conforming to the - // "process.context_switch_type" semantic conventions. It represents the - // specifies whether the context switches for this data point were voluntary or - // involuntary. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type") - - // ProcessCreationTimeKey is the attribute Key conforming to the - // "process.creation.time" semantic conventions. It represents the date and time - // the process was created, in ISO 8601 format. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2023-11-21T09:25:34.853Z" - ProcessCreationTimeKey = attribute.Key("process.creation.time") - - // ProcessExecutableBuildIDGnuKey is the attribute Key conforming to the - // "process.executable.build_id.gnu" semantic conventions. It represents the GNU - // build ID as found in the `.note.gnu.build-id` ELF section (hex string). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "c89b11207f6479603b0d49bf291c092c2b719293" - ProcessExecutableBuildIDGnuKey = attribute.Key("process.executable.build_id.gnu") - - // ProcessExecutableBuildIDGoKey is the attribute Key conforming to the - // "process.executable.build_id.go" semantic conventions. It represents the Go - // build ID as retrieved by `go tool buildid `. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "foh3mEXu7BLZjsN9pOwG/kATcXlYVCDEFouRMQed_/WwRFB1hPo9LBkekthSPG/x8hMC8emW2cCjXD0_1aY" - ProcessExecutableBuildIDGoKey = attribute.Key("process.executable.build_id.go") - - // ProcessExecutableBuildIDHtlhashKey is the attribute Key conforming to the - // "process.executable.build_id.htlhash" semantic conventions. It represents the - // profiling specific build ID for executables. See the OTel specification for - // Profiles for more information. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "600DCAFE4A110000F2BF38C493F5FB92" - ProcessExecutableBuildIDHtlhashKey = attribute.Key("process.executable.build_id.htlhash") - - // ProcessExecutableNameKey is the attribute Key conforming to the - // "process.executable.name" semantic conventions. It represents the name of the - // process executable. On Linux based systems, can be set to the `Name` in - // `proc/[pid]/status`. On Windows, can be set to the base name of - // `GetProcessImageFileNameW`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "otelcol" - ProcessExecutableNameKey = attribute.Key("process.executable.name") - - // ProcessExecutablePathKey is the attribute Key conforming to the - // "process.executable.path" semantic conventions. It represents the full path - // to the process executable. On Linux based systems, can be set to the target - // of `proc/[pid]/exe`. On Windows, can be set to the result of - // `GetProcessImageFileNameW`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/usr/bin/cmd/otelcol" - ProcessExecutablePathKey = attribute.Key("process.executable.path") - - // ProcessExitCodeKey is the attribute Key conforming to the "process.exit.code" - // semantic conventions. It represents the exit code of the process. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 127 - ProcessExitCodeKey = attribute.Key("process.exit.code") - - // ProcessExitTimeKey is the attribute Key conforming to the "process.exit.time" - // semantic conventions. It represents the date and time the process exited, in - // ISO 8601 format. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2023-11-21T09:26:12.315Z" - ProcessExitTimeKey = attribute.Key("process.exit.time") - - // ProcessGroupLeaderPIDKey is the attribute Key conforming to the - // "process.group_leader.pid" semantic conventions. It represents the PID of the - // process's group leader. This is also the process group ID (PGID) of the - // process. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 23 - ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid") - - // ProcessInteractiveKey is the attribute Key conforming to the - // "process.interactive" semantic conventions. It represents the whether the - // process is connected to an interactive shell. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - ProcessInteractiveKey = attribute.Key("process.interactive") - - // ProcessLinuxCgroupKey is the attribute Key conforming to the - // "process.linux.cgroup" semantic conventions. It represents the control group - // associated with the process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1:name=systemd:/user.slice/user-1000.slice/session-3.scope", - // "0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope" - // Note: Control groups (cgroups) are a kernel feature used to organize and - // manage process resources. This attribute provides the path(s) to the - // cgroup(s) associated with the process, which should match the contents of the - // [/proc/[PID]/cgroup] file. - // - // [/proc/[PID]/cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html - ProcessLinuxCgroupKey = attribute.Key("process.linux.cgroup") - - // ProcessOwnerKey is the attribute Key conforming to the "process.owner" - // semantic conventions. It represents the username of the user that owns the - // process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "root" - ProcessOwnerKey = attribute.Key("process.owner") - - // ProcessPagingFaultTypeKey is the attribute Key conforming to the - // "process.paging.fault_type" semantic conventions. It represents the type of - // page fault for this data point. Type `major` is for major/hard page faults, - // and `minor` is for minor/soft page faults. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type") - - // ProcessParentPIDKey is the attribute Key conforming to the - // "process.parent_pid" semantic conventions. It represents the parent Process - // identifier (PPID). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 111 - ProcessParentPIDKey = attribute.Key("process.parent_pid") - - // ProcessPIDKey is the attribute Key conforming to the "process.pid" semantic - // conventions. It represents the process identifier (PID). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1234 - ProcessPIDKey = attribute.Key("process.pid") - - // ProcessRealUserIDKey is the attribute Key conforming to the - // "process.real_user.id" semantic conventions. It represents the real user ID - // (RUID) of the process. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1000 - ProcessRealUserIDKey = attribute.Key("process.real_user.id") - - // ProcessRealUserNameKey is the attribute Key conforming to the - // "process.real_user.name" semantic conventions. It represents the username of - // the real user of the process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "operator" - ProcessRealUserNameKey = attribute.Key("process.real_user.name") - - // ProcessRuntimeDescriptionKey is the attribute Key conforming to the - // "process.runtime.description" semantic conventions. It represents an - // additional description about the runtime of the process, for example a - // specific vendor customization of the runtime environment. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 - ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") - - // ProcessRuntimeNameKey is the attribute Key conforming to the - // "process.runtime.name" semantic conventions. It represents the name of the - // runtime of this process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "OpenJDK Runtime Environment" - ProcessRuntimeNameKey = attribute.Key("process.runtime.name") - - // ProcessRuntimeVersionKey is the attribute Key conforming to the - // "process.runtime.version" semantic conventions. It represents the version of - // the runtime of this process, as returned by the runtime without modification. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 14.0.2 - ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") - - // ProcessSavedUserIDKey is the attribute Key conforming to the - // "process.saved_user.id" semantic conventions. It represents the saved user ID - // (SUID) of the process. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1002 - ProcessSavedUserIDKey = attribute.Key("process.saved_user.id") - - // ProcessSavedUserNameKey is the attribute Key conforming to the - // "process.saved_user.name" semantic conventions. It represents the username of - // the saved user. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "operator" - ProcessSavedUserNameKey = attribute.Key("process.saved_user.name") - - // ProcessSessionLeaderPIDKey is the attribute Key conforming to the - // "process.session_leader.pid" semantic conventions. It represents the PID of - // the process's session leader. This is also the session ID (SID) of the - // process. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 14 - ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid") - - // ProcessTitleKey is the attribute Key conforming to the "process.title" - // semantic conventions. It represents the process title (proctitle). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "cat /etc/hostname", "xfce4-session", "bash" - // Note: In many Unix-like systems, process title (proctitle), is the string - // that represents the name or command line of a running process, displayed by - // system monitoring tools like ps, top, and htop. - ProcessTitleKey = attribute.Key("process.title") - - // ProcessUserIDKey is the attribute Key conforming to the "process.user.id" - // semantic conventions. It represents the effective user ID (EUID) of the - // process. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1001 - ProcessUserIDKey = attribute.Key("process.user.id") - - // ProcessUserNameKey is the attribute Key conforming to the "process.user.name" - // semantic conventions. It represents the username of the effective user of the - // process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "root" - ProcessUserNameKey = attribute.Key("process.user.name") - - // ProcessVpidKey is the attribute Key conforming to the "process.vpid" semantic - // conventions. It represents the virtual process identifier. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 12 - // Note: The process ID within a PID namespace. This is not necessarily unique - // across all processes on the host but it is unique within the process - // namespace that the process exists within. - ProcessVpidKey = attribute.Key("process.vpid") - - // ProcessWorkingDirectoryKey is the attribute Key conforming to the - // "process.working_directory" semantic conventions. It represents the working - // directory of the process. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/root" - ProcessWorkingDirectoryKey = attribute.Key("process.working_directory") -) - -// ProcessArgsCount returns an attribute KeyValue conforming to the -// "process.args_count" semantic conventions. It represents the length of the -// process.command_args array. -func ProcessArgsCount(val int) attribute.KeyValue { - return ProcessArgsCountKey.Int(val) -} - -// ProcessCommand returns an attribute KeyValue conforming to the -// "process.command" semantic conventions. It represents the command used to -// launch the process (i.e. the command name). On Linux based systems, can be set -// to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the -// first parameter extracted from `GetCommandLineW`. -func ProcessCommand(val string) attribute.KeyValue { - return ProcessCommandKey.String(val) -} - -// ProcessCommandArgs returns an attribute KeyValue conforming to the -// "process.command_args" semantic conventions. It represents the all the command -// arguments (including the command/executable itself) as received by the -// process. On Linux-based systems (and some other Unixoid systems supporting -// procfs), can be set according to the list of null-delimited strings extracted -// from `proc/[pid]/cmdline`. For libc-based executables, this would be the full -// argv vector passed to `main`. -func ProcessCommandArgs(val ...string) attribute.KeyValue { - return ProcessCommandArgsKey.StringSlice(val) -} - -// ProcessCommandLine returns an attribute KeyValue conforming to the -// "process.command_line" semantic conventions. It represents the full command -// used to launch the process as a single string representing the full command. -// On Windows, can be set to the result of `GetCommandLineW`. Do not set this if -// you have to assemble it just for monitoring; use `process.command_args` -// instead. -func ProcessCommandLine(val string) attribute.KeyValue { - return ProcessCommandLineKey.String(val) -} - -// ProcessCreationTime returns an attribute KeyValue conforming to the -// "process.creation.time" semantic conventions. It represents the date and time -// the process was created, in ISO 8601 format. -func ProcessCreationTime(val string) attribute.KeyValue { - return ProcessCreationTimeKey.String(val) -} - -// ProcessExecutableBuildIDGnu returns an attribute KeyValue conforming to the -// "process.executable.build_id.gnu" semantic conventions. It represents the GNU -// build ID as found in the `.note.gnu.build-id` ELF section (hex string). -func ProcessExecutableBuildIDGnu(val string) attribute.KeyValue { - return ProcessExecutableBuildIDGnuKey.String(val) -} - -// ProcessExecutableBuildIDGo returns an attribute KeyValue conforming to the -// "process.executable.build_id.go" semantic conventions. It represents the Go -// build ID as retrieved by `go tool buildid `. -func ProcessExecutableBuildIDGo(val string) attribute.KeyValue { - return ProcessExecutableBuildIDGoKey.String(val) -} - -// ProcessExecutableBuildIDHtlhash returns an attribute KeyValue conforming to -// the "process.executable.build_id.htlhash" semantic conventions. It represents -// the profiling specific build ID for executables. See the OTel specification -// for Profiles for more information. -func ProcessExecutableBuildIDHtlhash(val string) attribute.KeyValue { - return ProcessExecutableBuildIDHtlhashKey.String(val) -} - -// ProcessExecutableName returns an attribute KeyValue conforming to the -// "process.executable.name" semantic conventions. It represents the name of the -// process executable. On Linux based systems, can be set to the `Name` in -// `proc/[pid]/status`. On Windows, can be set to the base name of -// `GetProcessImageFileNameW`. -func ProcessExecutableName(val string) attribute.KeyValue { - return ProcessExecutableNameKey.String(val) -} - -// ProcessExecutablePath returns an attribute KeyValue conforming to the -// "process.executable.path" semantic conventions. It represents the full path to -// the process executable. On Linux based systems, can be set to the target of -// `proc/[pid]/exe`. On Windows, can be set to the result of -// `GetProcessImageFileNameW`. -func ProcessExecutablePath(val string) attribute.KeyValue { - return ProcessExecutablePathKey.String(val) -} - -// ProcessExitCode returns an attribute KeyValue conforming to the -// "process.exit.code" semantic conventions. It represents the exit code of the -// process. -func ProcessExitCode(val int) attribute.KeyValue { - return ProcessExitCodeKey.Int(val) -} - -// ProcessExitTime returns an attribute KeyValue conforming to the -// "process.exit.time" semantic conventions. It represents the date and time the -// process exited, in ISO 8601 format. -func ProcessExitTime(val string) attribute.KeyValue { - return ProcessExitTimeKey.String(val) -} - -// ProcessGroupLeaderPID returns an attribute KeyValue conforming to the -// "process.group_leader.pid" semantic conventions. It represents the PID of the -// process's group leader. This is also the process group ID (PGID) of the -// process. -func ProcessGroupLeaderPID(val int) attribute.KeyValue { - return ProcessGroupLeaderPIDKey.Int(val) -} - -// ProcessInteractive returns an attribute KeyValue conforming to the -// "process.interactive" semantic conventions. It represents the whether the -// process is connected to an interactive shell. -func ProcessInteractive(val bool) attribute.KeyValue { - return ProcessInteractiveKey.Bool(val) -} - -// ProcessLinuxCgroup returns an attribute KeyValue conforming to the -// "process.linux.cgroup" semantic conventions. It represents the control group -// associated with the process. -func ProcessLinuxCgroup(val string) attribute.KeyValue { - return ProcessLinuxCgroupKey.String(val) -} - -// ProcessOwner returns an attribute KeyValue conforming to the "process.owner" -// semantic conventions. It represents the username of the user that owns the -// process. -func ProcessOwner(val string) attribute.KeyValue { - return ProcessOwnerKey.String(val) -} - -// ProcessParentPID returns an attribute KeyValue conforming to the -// "process.parent_pid" semantic conventions. It represents the parent Process -// identifier (PPID). -func ProcessParentPID(val int) attribute.KeyValue { - return ProcessParentPIDKey.Int(val) -} - -// ProcessPID returns an attribute KeyValue conforming to the "process.pid" -// semantic conventions. It represents the process identifier (PID). -func ProcessPID(val int) attribute.KeyValue { - return ProcessPIDKey.Int(val) -} - -// ProcessRealUserID returns an attribute KeyValue conforming to the -// "process.real_user.id" semantic conventions. It represents the real user ID -// (RUID) of the process. -func ProcessRealUserID(val int) attribute.KeyValue { - return ProcessRealUserIDKey.Int(val) -} - -// ProcessRealUserName returns an attribute KeyValue conforming to the -// "process.real_user.name" semantic conventions. It represents the username of -// the real user of the process. -func ProcessRealUserName(val string) attribute.KeyValue { - return ProcessRealUserNameKey.String(val) -} - -// ProcessRuntimeDescription returns an attribute KeyValue conforming to the -// "process.runtime.description" semantic conventions. It represents an -// additional description about the runtime of the process, for example a -// specific vendor customization of the runtime environment. -func ProcessRuntimeDescription(val string) attribute.KeyValue { - return ProcessRuntimeDescriptionKey.String(val) -} - -// ProcessRuntimeName returns an attribute KeyValue conforming to the -// "process.runtime.name" semantic conventions. It represents the name of the -// runtime of this process. -func ProcessRuntimeName(val string) attribute.KeyValue { - return ProcessRuntimeNameKey.String(val) -} - -// ProcessRuntimeVersion returns an attribute KeyValue conforming to the -// "process.runtime.version" semantic conventions. It represents the version of -// the runtime of this process, as returned by the runtime without modification. -func ProcessRuntimeVersion(val string) attribute.KeyValue { - return ProcessRuntimeVersionKey.String(val) -} - -// ProcessSavedUserID returns an attribute KeyValue conforming to the -// "process.saved_user.id" semantic conventions. It represents the saved user ID -// (SUID) of the process. -func ProcessSavedUserID(val int) attribute.KeyValue { - return ProcessSavedUserIDKey.Int(val) -} - -// ProcessSavedUserName returns an attribute KeyValue conforming to the -// "process.saved_user.name" semantic conventions. It represents the username of -// the saved user. -func ProcessSavedUserName(val string) attribute.KeyValue { - return ProcessSavedUserNameKey.String(val) -} - -// ProcessSessionLeaderPID returns an attribute KeyValue conforming to the -// "process.session_leader.pid" semantic conventions. It represents the PID of -// the process's session leader. This is also the session ID (SID) of the -// process. -func ProcessSessionLeaderPID(val int) attribute.KeyValue { - return ProcessSessionLeaderPIDKey.Int(val) -} - -// ProcessTitle returns an attribute KeyValue conforming to the "process.title" -// semantic conventions. It represents the process title (proctitle). -func ProcessTitle(val string) attribute.KeyValue { - return ProcessTitleKey.String(val) -} - -// ProcessUserID returns an attribute KeyValue conforming to the -// "process.user.id" semantic conventions. It represents the effective user ID -// (EUID) of the process. -func ProcessUserID(val int) attribute.KeyValue { - return ProcessUserIDKey.Int(val) -} - -// ProcessUserName returns an attribute KeyValue conforming to the -// "process.user.name" semantic conventions. It represents the username of the -// effective user of the process. -func ProcessUserName(val string) attribute.KeyValue { - return ProcessUserNameKey.String(val) -} - -// ProcessVpid returns an attribute KeyValue conforming to the "process.vpid" -// semantic conventions. It represents the virtual process identifier. -func ProcessVpid(val int) attribute.KeyValue { - return ProcessVpidKey.Int(val) -} - -// ProcessWorkingDirectory returns an attribute KeyValue conforming to the -// "process.working_directory" semantic conventions. It represents the working -// directory of the process. -func ProcessWorkingDirectory(val string) attribute.KeyValue { - return ProcessWorkingDirectoryKey.String(val) -} - -// Enum values for process.context_switch_type -var ( - // voluntary - // Stability: development - ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary") - // involuntary - // Stability: development - ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary") -) - -// Enum values for process.paging.fault_type -var ( - // major - // Stability: development - ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major") - // minor - // Stability: development - ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor") -) - -// Namespace: profile -const ( - // ProfileFrameTypeKey is the attribute Key conforming to the - // "profile.frame.type" semantic conventions. It represents the describes the - // interpreter or compiler of a single frame. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "cpython" - ProfileFrameTypeKey = attribute.Key("profile.frame.type") -) - -// Enum values for profile.frame.type -var ( - // [.NET] - // - // Stability: development - // - // [.NET]: https://wikipedia.org/wiki/.NET - ProfileFrameTypeDotnet = ProfileFrameTypeKey.String("dotnet") - // [JVM] - // - // Stability: development - // - // [JVM]: https://wikipedia.org/wiki/Java_virtual_machine - ProfileFrameTypeJVM = ProfileFrameTypeKey.String("jvm") - // [Kernel] - // - // Stability: development - // - // [Kernel]: https://wikipedia.org/wiki/Kernel_(operating_system) - ProfileFrameTypeKernel = ProfileFrameTypeKey.String("kernel") - // [C], [C++], [Go], [Rust] - // - // Stability: development - // - // [C]: https://wikipedia.org/wiki/C_(programming_language) - // [C++]: https://wikipedia.org/wiki/C%2B%2B - // [Go]: https://wikipedia.org/wiki/Go_(programming_language) - // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language) - ProfileFrameTypeNative = ProfileFrameTypeKey.String("native") - // [Perl] - // - // Stability: development - // - // [Perl]: https://wikipedia.org/wiki/Perl - ProfileFrameTypePerl = ProfileFrameTypeKey.String("perl") - // [PHP] - // - // Stability: development - // - // [PHP]: https://wikipedia.org/wiki/PHP - ProfileFrameTypePHP = ProfileFrameTypeKey.String("php") - // [Python] - // - // Stability: development - // - // [Python]: https://wikipedia.org/wiki/Python_(programming_language) - ProfileFrameTypeCpython = ProfileFrameTypeKey.String("cpython") - // [Ruby] - // - // Stability: development - // - // [Ruby]: https://wikipedia.org/wiki/Ruby_(programming_language) - ProfileFrameTypeRuby = ProfileFrameTypeKey.String("ruby") - // [V8JS] - // - // Stability: development - // - // [V8JS]: https://wikipedia.org/wiki/V8_(JavaScript_engine) - ProfileFrameTypeV8JS = ProfileFrameTypeKey.String("v8js") - // [Erlang] - // - // Stability: development - // - // [Erlang]: https://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine) - ProfileFrameTypeBeam = ProfileFrameTypeKey.String("beam") -) - -// Namespace: rpc -const ( - // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the - // "rpc.connect_rpc.error_code" semantic conventions. It represents the - // [error codes] of the Connect request. Error codes are always string values. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [error codes]: https://connect.build/docs/protocol/#error-codes - RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") - - // RPCGRPCStatusCodeKey is the attribute Key conforming to the - // "rpc.grpc.status_code" semantic conventions. It represents the - // [numeric status code] of the gRPC request. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [numeric status code]: https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md - RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") - - // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code` - // property of response if it is an error response. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: -32700, 100 - RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") - - // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_message" semantic conventions. It represents the - // `error.message` property of response if it is an error response. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Parse error", "User already exists" - RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") - - // RPCJsonrpcRequestIDKey is the attribute Key conforming to the - // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` - // property of request or response. Since protocol allows id to be int, string, - // `null` or missing (for notifications), value is expected to be cast to string - // for simplicity. Use empty string in case of `null` value. Omit entirely if - // this is a notification. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "10", "request-7", "" - RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") - - // RPCJsonrpcVersionKey is the attribute Key conforming to the - // "rpc.jsonrpc.version" semantic conventions. It represents the protocol - // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 - // doesn't specify this, the value can be omitted. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2.0", "1.0" - RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") - - // RPCMessageCompressedSizeKey is the attribute Key conforming to the - // "rpc.message.compressed_size" semantic conventions. It represents the - // compressed size of the message in bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size") - - // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id" - // semantic conventions. It represents the mUST be calculated as two different - // counters starting from `1` one for sent messages and one for received - // message. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: This way we guarantee that the values will be consistent between - // different implementations. - RPCMessageIDKey = attribute.Key("rpc.message.id") - - // RPCMessageTypeKey is the attribute Key conforming to the "rpc.message.type" - // semantic conventions. It represents the whether this is a received or sent - // message. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - RPCMessageTypeKey = attribute.Key("rpc.message.type") - - // RPCMessageUncompressedSizeKey is the attribute Key conforming to the - // "rpc.message.uncompressed_size" semantic conventions. It represents the - // uncompressed size of the message in bytes. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size") - - // RPCMethodKey is the attribute Key conforming to the "rpc.method" semantic - // conventions. It represents the name of the (logical) method being called, - // must be equal to the $method part in the span name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: exampleMethod - // Note: This is the logical name of the method from the RPC interface - // perspective, which can be different from the name of any implementing - // method/function. The `code.function.name` attribute may be used to store the - // latter (e.g., method actually executing the call on the server side, RPC - // client stub method on the client side). - RPCMethodKey = attribute.Key("rpc.method") - - // RPCServiceKey is the attribute Key conforming to the "rpc.service" semantic - // conventions. It represents the full (logical) name of the service being - // called, including its package name, if applicable. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: myservice.EchoService - // Note: This is the logical name of the service from the RPC interface - // perspective, which can be different from the name of any implementing class. - // The `code.namespace` attribute may be used to store the latter (despite the - // attribute name, it may include a class name; e.g., class with method actually - // executing the call on the server side, RPC client stub class on the client - // side). - RPCServiceKey = attribute.Key("rpc.service") - - // RPCSystemKey is the attribute Key conforming to the "rpc.system" semantic - // conventions. It represents a string identifying the remoting system. See - // below for a list of well-known identifiers. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - RPCSystemKey = attribute.Key("rpc.system") -) - -// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code` -// property of response if it is an error response. -func RPCJsonrpcErrorCode(val int) attribute.KeyValue { - return RPCJsonrpcErrorCodeKey.Int(val) -} - -// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_message" semantic conventions. It represents the -// `error.message` property of response if it is an error response. -func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { - return RPCJsonrpcErrorMessageKey.String(val) -} - -// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` property -// of request or response. Since protocol allows id to be int, string, `null` or -// missing (for notifications), value is expected to be cast to string for -// simplicity. Use empty string in case of `null` value. Omit entirely if this is -// a notification. -func RPCJsonrpcRequestID(val string) attribute.KeyValue { - return RPCJsonrpcRequestIDKey.String(val) -} - -// RPCJsonrpcVersion returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.version" semantic conventions. It represents the protocol version -// as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't -// specify this, the value can be omitted. -func RPCJsonrpcVersion(val string) attribute.KeyValue { - return RPCJsonrpcVersionKey.String(val) -} - -// RPCMessageCompressedSize returns an attribute KeyValue conforming to the -// "rpc.message.compressed_size" semantic conventions. It represents the -// compressed size of the message in bytes. -func RPCMessageCompressedSize(val int) attribute.KeyValue { - return RPCMessageCompressedSizeKey.Int(val) -} - -// RPCMessageID returns an attribute KeyValue conforming to the "rpc.message.id" -// semantic conventions. It represents the mUST be calculated as two different -// counters starting from `1` one for sent messages and one for received message. -func RPCMessageID(val int) attribute.KeyValue { - return RPCMessageIDKey.Int(val) -} - -// RPCMessageUncompressedSize returns an attribute KeyValue conforming to the -// "rpc.message.uncompressed_size" semantic conventions. It represents the -// uncompressed size of the message in bytes. -func RPCMessageUncompressedSize(val int) attribute.KeyValue { - return RPCMessageUncompressedSizeKey.Int(val) -} - -// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" -// semantic conventions. It represents the name of the (logical) method being -// called, must be equal to the $method part in the span name. -func RPCMethod(val string) attribute.KeyValue { - return RPCMethodKey.String(val) -} - -// RPCService returns an attribute KeyValue conforming to the "rpc.service" -// semantic conventions. It represents the full (logical) name of the service -// being called, including its package name, if applicable. -func RPCService(val string) attribute.KeyValue { - return RPCServiceKey.String(val) -} - -// Enum values for rpc.connect_rpc.error_code -var ( - // cancelled - // Stability: development - RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") - // unknown - // Stability: development - RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") - // invalid_argument - // Stability: development - RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") - // deadline_exceeded - // Stability: development - RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") - // not_found - // Stability: development - RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") - // already_exists - // Stability: development - RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") - // permission_denied - // Stability: development - RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") - // resource_exhausted - // Stability: development - RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") - // failed_precondition - // Stability: development - RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") - // aborted - // Stability: development - RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") - // out_of_range - // Stability: development - RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") - // unimplemented - // Stability: development - RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") - // internal - // Stability: development - RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") - // unavailable - // Stability: development - RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") - // data_loss - // Stability: development - RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") - // unauthenticated - // Stability: development - RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") -) - -// Enum values for rpc.grpc.status_code -var ( - // OK - // Stability: development - RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) - // CANCELLED - // Stability: development - RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) - // UNKNOWN - // Stability: development - RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) - // INVALID_ARGUMENT - // Stability: development - RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) - // DEADLINE_EXCEEDED - // Stability: development - RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) - // NOT_FOUND - // Stability: development - RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) - // ALREADY_EXISTS - // Stability: development - RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) - // PERMISSION_DENIED - // Stability: development - RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) - // RESOURCE_EXHAUSTED - // Stability: development - RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) - // FAILED_PRECONDITION - // Stability: development - RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) - // ABORTED - // Stability: development - RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) - // OUT_OF_RANGE - // Stability: development - RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) - // UNIMPLEMENTED - // Stability: development - RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) - // INTERNAL - // Stability: development - RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) - // UNAVAILABLE - // Stability: development - RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) - // DATA_LOSS - // Stability: development - RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) - // UNAUTHENTICATED - // Stability: development - RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) -) - -// Enum values for rpc.message.type -var ( - // sent - // Stability: development - RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") - // received - // Stability: development - RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") -) - -// Enum values for rpc.system -var ( - // gRPC - // Stability: development - RPCSystemGRPC = RPCSystemKey.String("grpc") - // Java RMI - // Stability: development - RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") - // .NET WCF - // Stability: development - RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") - // Apache Dubbo - // Stability: development - RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") - // Connect RPC - // Stability: development - RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") -) - -// Namespace: security_rule -const ( - // SecurityRuleCategoryKey is the attribute Key conforming to the - // "security_rule.category" semantic conventions. It represents a categorization - // value keyword used by the entity using the rule for detection of this event. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Attempted Information Leak" - SecurityRuleCategoryKey = attribute.Key("security_rule.category") - - // SecurityRuleDescriptionKey is the attribute Key conforming to the - // "security_rule.description" semantic conventions. It represents the - // description of the rule generating the event. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Block requests to public DNS over HTTPS / TLS protocols" - SecurityRuleDescriptionKey = attribute.Key("security_rule.description") - - // SecurityRuleLicenseKey is the attribute Key conforming to the - // "security_rule.license" semantic conventions. It represents the name of the - // license under which the rule used to generate this event is made available. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Apache 2.0" - SecurityRuleLicenseKey = attribute.Key("security_rule.license") - - // SecurityRuleNameKey is the attribute Key conforming to the - // "security_rule.name" semantic conventions. It represents the name of the rule - // or signature generating the event. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "BLOCK_DNS_over_TLS" - SecurityRuleNameKey = attribute.Key("security_rule.name") - - // SecurityRuleReferenceKey is the attribute Key conforming to the - // "security_rule.reference" semantic conventions. It represents the reference - // URL to additional information about the rule used to generate this event. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "https://en.wikipedia.org/wiki/DNS_over_TLS" - // Note: The URL can point to the vendor’s documentation about the rule. If - // that’s not available, it can also be a link to a more general page - // describing this type of alert. - SecurityRuleReferenceKey = attribute.Key("security_rule.reference") - - // SecurityRuleRulesetNameKey is the attribute Key conforming to the - // "security_rule.ruleset.name" semantic conventions. It represents the name of - // the ruleset, policy, group, or parent category in which the rule used to - // generate this event is a member. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Standard_Protocol_Filters" - SecurityRuleRulesetNameKey = attribute.Key("security_rule.ruleset.name") - - // SecurityRuleUUIDKey is the attribute Key conforming to the - // "security_rule.uuid" semantic conventions. It represents a rule ID that is - // unique within the scope of a set or group of agents, observers, or other - // entities using the rule for detection of this event. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "550e8400-e29b-41d4-a716-446655440000", "1100110011" - SecurityRuleUUIDKey = attribute.Key("security_rule.uuid") - - // SecurityRuleVersionKey is the attribute Key conforming to the - // "security_rule.version" semantic conventions. It represents the version / - // revision of the rule being used for analysis. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1.0.0" - SecurityRuleVersionKey = attribute.Key("security_rule.version") -) - -// SecurityRuleCategory returns an attribute KeyValue conforming to the -// "security_rule.category" semantic conventions. It represents a categorization -// value keyword used by the entity using the rule for detection of this event. -func SecurityRuleCategory(val string) attribute.KeyValue { - return SecurityRuleCategoryKey.String(val) -} - -// SecurityRuleDescription returns an attribute KeyValue conforming to the -// "security_rule.description" semantic conventions. It represents the -// description of the rule generating the event. -func SecurityRuleDescription(val string) attribute.KeyValue { - return SecurityRuleDescriptionKey.String(val) -} - -// SecurityRuleLicense returns an attribute KeyValue conforming to the -// "security_rule.license" semantic conventions. It represents the name of the -// license under which the rule used to generate this event is made available. -func SecurityRuleLicense(val string) attribute.KeyValue { - return SecurityRuleLicenseKey.String(val) -} - -// SecurityRuleName returns an attribute KeyValue conforming to the -// "security_rule.name" semantic conventions. It represents the name of the rule -// or signature generating the event. -func SecurityRuleName(val string) attribute.KeyValue { - return SecurityRuleNameKey.String(val) -} - -// SecurityRuleReference returns an attribute KeyValue conforming to the -// "security_rule.reference" semantic conventions. It represents the reference -// URL to additional information about the rule used to generate this event. -func SecurityRuleReference(val string) attribute.KeyValue { - return SecurityRuleReferenceKey.String(val) -} - -// SecurityRuleRulesetName returns an attribute KeyValue conforming to the -// "security_rule.ruleset.name" semantic conventions. It represents the name of -// the ruleset, policy, group, or parent category in which the rule used to -// generate this event is a member. -func SecurityRuleRulesetName(val string) attribute.KeyValue { - return SecurityRuleRulesetNameKey.String(val) -} - -// SecurityRuleUUID returns an attribute KeyValue conforming to the -// "security_rule.uuid" semantic conventions. It represents a rule ID that is -// unique within the scope of a set or group of agents, observers, or other -// entities using the rule for detection of this event. -func SecurityRuleUUID(val string) attribute.KeyValue { - return SecurityRuleUUIDKey.String(val) -} - -// SecurityRuleVersion returns an attribute KeyValue conforming to the -// "security_rule.version" semantic conventions. It represents the version / -// revision of the rule being used for analysis. -func SecurityRuleVersion(val string) attribute.KeyValue { - return SecurityRuleVersionKey.String(val) -} - -// Namespace: server -const ( - // ServerAddressKey is the attribute Key conforming to the "server.address" - // semantic conventions. It represents the server domain name if available - // without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "example.com", "10.1.2.80", "/tmp/my.sock" - // Note: When observed from the client side, and when communicating through an - // intermediary, `server.address` SHOULD represent the server address behind any - // intermediaries, for example proxies, if it's available. - ServerAddressKey = attribute.Key("server.address") - - // ServerPortKey is the attribute Key conforming to the "server.port" semantic - // conventions. It represents the server port number. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: 80, 8080, 443 - // Note: When observed from the client side, and when communicating through an - // intermediary, `server.port` SHOULD represent the server port behind any - // intermediaries, for example proxies, if it's available. - ServerPortKey = attribute.Key("server.port") -) - -// ServerAddress returns an attribute KeyValue conforming to the "server.address" -// semantic conventions. It represents the server domain name if available -// without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func ServerAddress(val string) attribute.KeyValue { - return ServerAddressKey.String(val) -} - -// ServerPort returns an attribute KeyValue conforming to the "server.port" -// semantic conventions. It represents the server port number. -func ServerPort(val int) attribute.KeyValue { - return ServerPortKey.Int(val) -} - -// Namespace: service -const ( - // ServiceInstanceIDKey is the attribute Key conforming to the - // "service.instance.id" semantic conventions. It represents the string ID of - // the service instance. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "627cc493-f310-47de-96bd-71410b7dec09" - // Note: MUST be unique for each instance of the same - // `service.namespace,service.name` pair (in other words - // `service.namespace,service.name,service.instance.id` triplet MUST be globally - // unique). The ID helps to - // distinguish instances of the same service that exist at the same time (e.g. - // instances of a horizontally scaled - // service). - // - // Implementations, such as SDKs, are recommended to generate a random Version 1 - // or Version 4 [RFC - // 4122] UUID, but are free to use an inherent unique ID as - // the source of - // this value if stability is desirable. In that case, the ID SHOULD be used as - // source of a UUID Version 5 and - // SHOULD use the following UUID as the namespace: - // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. - // - // UUIDs are typically recommended, as only an opaque value for the purposes of - // identifying a service instance is - // needed. Similar to what can be seen in the man page for the - // [`/etc/machine-id`] file, the underlying - // data, such as pod name and namespace should be treated as confidential, being - // the user's choice to expose it - // or not via another resource attribute. - // - // For applications running behind an application server (like unicorn), we do - // not recommend using one identifier - // for all processes participating in the application. Instead, it's recommended - // each division (e.g. a worker - // thread in unicorn) to have its own instance.id. - // - // It's not recommended for a Collector to set `service.instance.id` if it can't - // unambiguously determine the - // service instance that is generating that telemetry. For instance, creating an - // UUID based on `pod.name` will - // likely be wrong, as the Collector might not know from which container within - // that pod the telemetry originated. - // However, Collectors can set the `service.instance.id` if they can - // unambiguously determine the service instance - // for that telemetry. This is typically the case for scraping receivers, as - // they know the target address and - // port. - // - // [RFC - // 4122]: https://www.ietf.org/rfc/rfc4122.txt - // [`/etc/machine-id`]: https://www.freedesktop.org/software/systemd/man/latest/machine-id.html - ServiceInstanceIDKey = attribute.Key("service.instance.id") - - // ServiceNameKey is the attribute Key conforming to the "service.name" semantic - // conventions. It represents the logical name of the service. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "shoppingcart" - // Note: MUST be the same for all instances of horizontally scaled services. If - // the value was not specified, SDKs MUST fallback to `unknown_service:` - // concatenated with [`process.executable.name`], e.g. `unknown_service:bash`. - // If `process.executable.name` is not available, the value MUST be set to - // `unknown_service`. - // - // [`process.executable.name`]: process.md - ServiceNameKey = attribute.Key("service.name") - - // ServiceNamespaceKey is the attribute Key conforming to the - // "service.namespace" semantic conventions. It represents a namespace for - // `service.name`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Shop" - // Note: A string value having a meaning that helps to distinguish a group of - // services, for example the team name that owns a group of services. - // `service.name` is expected to be unique within the same namespace. If - // `service.namespace` is not specified in the Resource then `service.name` is - // expected to be unique for all services that have no explicit namespace - // defined (so the empty/unspecified namespace is simply one more valid - // namespace). Zero-length namespace string is assumed equal to unspecified - // namespace. - ServiceNamespaceKey = attribute.Key("service.namespace") - - // ServiceVersionKey is the attribute Key conforming to the "service.version" - // semantic conventions. It represents the version string of the service API or - // implementation. The format is not defined by these conventions. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "2.0.0", "a01dbef8a" - ServiceVersionKey = attribute.Key("service.version") -) - -// ServiceInstanceID returns an attribute KeyValue conforming to the -// "service.instance.id" semantic conventions. It represents the string ID of the -// service instance. -func ServiceInstanceID(val string) attribute.KeyValue { - return ServiceInstanceIDKey.String(val) -} - -// ServiceName returns an attribute KeyValue conforming to the "service.name" -// semantic conventions. It represents the logical name of the service. -func ServiceName(val string) attribute.KeyValue { - return ServiceNameKey.String(val) -} - -// ServiceNamespace returns an attribute KeyValue conforming to the -// "service.namespace" semantic conventions. It represents a namespace for -// `service.name`. -func ServiceNamespace(val string) attribute.KeyValue { - return ServiceNamespaceKey.String(val) -} - -// ServiceVersion returns an attribute KeyValue conforming to the -// "service.version" semantic conventions. It represents the version string of -// the service API or implementation. The format is not defined by these -// conventions. -func ServiceVersion(val string) attribute.KeyValue { - return ServiceVersionKey.String(val) -} - -// Namespace: session -const ( - // SessionIDKey is the attribute Key conforming to the "session.id" semantic - // conventions. It represents a unique id to identify a session. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 00112233-4455-6677-8899-aabbccddeeff - SessionIDKey = attribute.Key("session.id") - - // SessionPreviousIDKey is the attribute Key conforming to the - // "session.previous_id" semantic conventions. It represents the previous - // `session.id` for this user, when known. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 00112233-4455-6677-8899-aabbccddeeff - SessionPreviousIDKey = attribute.Key("session.previous_id") -) - -// SessionID returns an attribute KeyValue conforming to the "session.id" -// semantic conventions. It represents a unique id to identify a session. -func SessionID(val string) attribute.KeyValue { - return SessionIDKey.String(val) -} - -// SessionPreviousID returns an attribute KeyValue conforming to the -// "session.previous_id" semantic conventions. It represents the previous -// `session.id` for this user, when known. -func SessionPreviousID(val string) attribute.KeyValue { - return SessionPreviousIDKey.String(val) -} - -// Namespace: signalr -const ( - // SignalrConnectionStatusKey is the attribute Key conforming to the - // "signalr.connection.status" semantic conventions. It represents the signalR - // HTTP connection closure status. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "app_shutdown", "timeout" - SignalrConnectionStatusKey = attribute.Key("signalr.connection.status") - - // SignalrTransportKey is the attribute Key conforming to the - // "signalr.transport" semantic conventions. It represents the - // [SignalR transport type]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "web_sockets", "long_polling" - // - // [SignalR transport type]: https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md - SignalrTransportKey = attribute.Key("signalr.transport") -) - -// Enum values for signalr.connection.status -var ( - // The connection was closed normally. - // Stability: stable - SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure") - // The connection was closed due to a timeout. - // Stability: stable - SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout") - // The connection was closed because the app is shutting down. - // Stability: stable - SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown") -) - -// Enum values for signalr.transport -var ( - // ServerSentEvents protocol - // Stability: stable - SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events") - // LongPolling protocol - // Stability: stable - SignalrTransportLongPolling = SignalrTransportKey.String("long_polling") - // WebSockets protocol - // Stability: stable - SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets") -) - -// Namespace: source -const ( - // SourceAddressKey is the attribute Key conforming to the "source.address" - // semantic conventions. It represents the source address - domain name if - // available without reverse DNS lookup; otherwise, IP address or Unix domain - // socket name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "source.example.com", "10.1.2.80", "/tmp/my.sock" - // Note: When observed from the destination side, and when communicating through - // an intermediary, `source.address` SHOULD represent the source address behind - // any intermediaries, for example proxies, if it's available. - SourceAddressKey = attribute.Key("source.address") - - // SourcePortKey is the attribute Key conforming to the "source.port" semantic - // conventions. It represents the source port number. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 3389, 2888 - SourcePortKey = attribute.Key("source.port") -) - -// SourceAddress returns an attribute KeyValue conforming to the "source.address" -// semantic conventions. It represents the source address - domain name if -// available without reverse DNS lookup; otherwise, IP address or Unix domain -// socket name. -func SourceAddress(val string) attribute.KeyValue { - return SourceAddressKey.String(val) -} - -// SourcePort returns an attribute KeyValue conforming to the "source.port" -// semantic conventions. It represents the source port number. -func SourcePort(val int) attribute.KeyValue { - return SourcePortKey.Int(val) -} - -// Namespace: system -const ( - // SystemCPULogicalNumberKey is the attribute Key conforming to the - // "system.cpu.logical_number" semantic conventions. It represents the logical - // CPU number [0..n-1]. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1 - SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number") - - // SystemDeviceKey is the attribute Key conforming to the "system.device" - // semantic conventions. It represents the device identifier. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "(identifier)" - SystemDeviceKey = attribute.Key("system.device") - - // SystemFilesystemModeKey is the attribute Key conforming to the - // "system.filesystem.mode" semantic conventions. It represents the filesystem - // mode. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "rw, ro" - SystemFilesystemModeKey = attribute.Key("system.filesystem.mode") - - // SystemFilesystemMountpointKey is the attribute Key conforming to the - // "system.filesystem.mountpoint" semantic conventions. It represents the - // filesystem mount path. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/mnt/data" - SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint") - - // SystemFilesystemStateKey is the attribute Key conforming to the - // "system.filesystem.state" semantic conventions. It represents the filesystem - // state. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "used" - SystemFilesystemStateKey = attribute.Key("system.filesystem.state") - - // SystemFilesystemTypeKey is the attribute Key conforming to the - // "system.filesystem.type" semantic conventions. It represents the filesystem - // type. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "ext4" - SystemFilesystemTypeKey = attribute.Key("system.filesystem.type") - - // SystemMemoryStateKey is the attribute Key conforming to the - // "system.memory.state" semantic conventions. It represents the memory state. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "free", "cached" - SystemMemoryStateKey = attribute.Key("system.memory.state") - - // SystemPagingDirectionKey is the attribute Key conforming to the - // "system.paging.direction" semantic conventions. It represents the paging - // access direction. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "in" - SystemPagingDirectionKey = attribute.Key("system.paging.direction") - - // SystemPagingStateKey is the attribute Key conforming to the - // "system.paging.state" semantic conventions. It represents the memory paging - // state. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "free" - SystemPagingStateKey = attribute.Key("system.paging.state") - - // SystemPagingTypeKey is the attribute Key conforming to the - // "system.paging.type" semantic conventions. It represents the memory paging - // type. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "minor" - SystemPagingTypeKey = attribute.Key("system.paging.type") - - // SystemProcessStatusKey is the attribute Key conforming to the - // "system.process.status" semantic conventions. It represents the process - // state, e.g., [Linux Process State Codes]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "running" - // - // [Linux Process State Codes]: https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES - SystemProcessStatusKey = attribute.Key("system.process.status") -) - -// SystemCPULogicalNumber returns an attribute KeyValue conforming to the -// "system.cpu.logical_number" semantic conventions. It represents the logical -// CPU number [0..n-1]. -func SystemCPULogicalNumber(val int) attribute.KeyValue { - return SystemCPULogicalNumberKey.Int(val) -} - -// SystemDevice returns an attribute KeyValue conforming to the "system.device" -// semantic conventions. It represents the device identifier. -func SystemDevice(val string) attribute.KeyValue { - return SystemDeviceKey.String(val) -} - -// SystemFilesystemMode returns an attribute KeyValue conforming to the -// "system.filesystem.mode" semantic conventions. It represents the filesystem -// mode. -func SystemFilesystemMode(val string) attribute.KeyValue { - return SystemFilesystemModeKey.String(val) -} - -// SystemFilesystemMountpoint returns an attribute KeyValue conforming to the -// "system.filesystem.mountpoint" semantic conventions. It represents the -// filesystem mount path. -func SystemFilesystemMountpoint(val string) attribute.KeyValue { - return SystemFilesystemMountpointKey.String(val) -} - -// Enum values for system.filesystem.state -var ( - // used - // Stability: development - SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used") - // free - // Stability: development - SystemFilesystemStateFree = SystemFilesystemStateKey.String("free") - // reserved - // Stability: development - SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved") -) - -// Enum values for system.filesystem.type -var ( - // fat32 - // Stability: development - SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32") - // exfat - // Stability: development - SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat") - // ntfs - // Stability: development - SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs") - // refs - // Stability: development - SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs") - // hfsplus - // Stability: development - SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus") - // ext4 - // Stability: development - SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4") -) - -// Enum values for system.memory.state -var ( - // used - // Stability: development - SystemMemoryStateUsed = SystemMemoryStateKey.String("used") - // free - // Stability: development - SystemMemoryStateFree = SystemMemoryStateKey.String("free") - // Deprecated: Removed, report shared memory usage with - // `metric.system.memory.shared` metric. - SystemMemoryStateShared = SystemMemoryStateKey.String("shared") - // buffers - // Stability: development - SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers") - // cached - // Stability: development - SystemMemoryStateCached = SystemMemoryStateKey.String("cached") -) - -// Enum values for system.paging.direction -var ( - // in - // Stability: development - SystemPagingDirectionIn = SystemPagingDirectionKey.String("in") - // out - // Stability: development - SystemPagingDirectionOut = SystemPagingDirectionKey.String("out") -) - -// Enum values for system.paging.state -var ( - // used - // Stability: development - SystemPagingStateUsed = SystemPagingStateKey.String("used") - // free - // Stability: development - SystemPagingStateFree = SystemPagingStateKey.String("free") -) - -// Enum values for system.paging.type -var ( - // major - // Stability: development - SystemPagingTypeMajor = SystemPagingTypeKey.String("major") - // minor - // Stability: development - SystemPagingTypeMinor = SystemPagingTypeKey.String("minor") -) - -// Enum values for system.process.status -var ( - // running - // Stability: development - SystemProcessStatusRunning = SystemProcessStatusKey.String("running") - // sleeping - // Stability: development - SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping") - // stopped - // Stability: development - SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped") - // defunct - // Stability: development - SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct") -) - -// Namespace: telemetry -const ( - // TelemetryDistroNameKey is the attribute Key conforming to the - // "telemetry.distro.name" semantic conventions. It represents the name of the - // auto instrumentation agent or distribution, if used. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "parts-unlimited-java" - // Note: Official auto instrumentation agents and distributions SHOULD set the - // `telemetry.distro.name` attribute to - // a string starting with `opentelemetry-`, e.g. - // `opentelemetry-java-instrumentation`. - TelemetryDistroNameKey = attribute.Key("telemetry.distro.name") - - // TelemetryDistroVersionKey is the attribute Key conforming to the - // "telemetry.distro.version" semantic conventions. It represents the version - // string of the auto instrumentation agent or distribution, if used. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1.2.3" - TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version") - - // TelemetrySDKLanguageKey is the attribute Key conforming to the - // "telemetry.sdk.language" semantic conventions. It represents the language of - // the telemetry SDK. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: - TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") - - // TelemetrySDKNameKey is the attribute Key conforming to the - // "telemetry.sdk.name" semantic conventions. It represents the name of the - // telemetry SDK as defined above. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "opentelemetry" - // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to - // `opentelemetry`. - // If another SDK, like a fork or a vendor-provided implementation, is used, - // this SDK MUST set the - // `telemetry.sdk.name` attribute to the fully-qualified class or module name of - // this SDK's main entry point - // or another suitable identifier depending on the language. - // The identifier `opentelemetry` is reserved and MUST NOT be used in this case. - // All custom identifiers SHOULD be stable across different versions of an - // implementation. - TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") - - // TelemetrySDKVersionKey is the attribute Key conforming to the - // "telemetry.sdk.version" semantic conventions. It represents the version - // string of the telemetry SDK. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "1.2.3" - TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") -) - -// TelemetryDistroName returns an attribute KeyValue conforming to the -// "telemetry.distro.name" semantic conventions. It represents the name of the -// auto instrumentation agent or distribution, if used. -func TelemetryDistroName(val string) attribute.KeyValue { - return TelemetryDistroNameKey.String(val) -} - -// TelemetryDistroVersion returns an attribute KeyValue conforming to the -// "telemetry.distro.version" semantic conventions. It represents the version -// string of the auto instrumentation agent or distribution, if used. -func TelemetryDistroVersion(val string) attribute.KeyValue { - return TelemetryDistroVersionKey.String(val) -} - -// TelemetrySDKName returns an attribute KeyValue conforming to the -// "telemetry.sdk.name" semantic conventions. It represents the name of the -// telemetry SDK as defined above. -func TelemetrySDKName(val string) attribute.KeyValue { - return TelemetrySDKNameKey.String(val) -} - -// TelemetrySDKVersion returns an attribute KeyValue conforming to the -// "telemetry.sdk.version" semantic conventions. It represents the version string -// of the telemetry SDK. -func TelemetrySDKVersion(val string) attribute.KeyValue { - return TelemetrySDKVersionKey.String(val) -} - -// Enum values for telemetry.sdk.language -var ( - // cpp - // Stability: stable - TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") - // dotnet - // Stability: stable - TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") - // erlang - // Stability: stable - TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") - // go - // Stability: stable - TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") - // java - // Stability: stable - TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") - // nodejs - // Stability: stable - TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") - // php - // Stability: stable - TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") - // python - // Stability: stable - TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") - // ruby - // Stability: stable - TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") - // rust - // Stability: stable - TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust") - // swift - // Stability: stable - TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") - // webjs - // Stability: stable - TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs") -) - -// Namespace: test -const ( - // TestCaseNameKey is the attribute Key conforming to the "test.case.name" - // semantic conventions. It represents the fully qualified human readable name - // of the [test case]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "org.example.TestCase1.test1", "example/tests/TestCase1.test1", - // "ExampleTestCase1_test1" - // - // [test case]: https://wikipedia.org/wiki/Test_case - TestCaseNameKey = attribute.Key("test.case.name") - - // TestCaseResultStatusKey is the attribute Key conforming to the - // "test.case.result.status" semantic conventions. It represents the status of - // the actual test case result from test execution. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "pass", "fail" - TestCaseResultStatusKey = attribute.Key("test.case.result.status") - - // TestSuiteNameKey is the attribute Key conforming to the "test.suite.name" - // semantic conventions. It represents the human readable name of a [test suite] - // . - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "TestSuite1" - // - // [test suite]: https://wikipedia.org/wiki/Test_suite - TestSuiteNameKey = attribute.Key("test.suite.name") - - // TestSuiteRunStatusKey is the attribute Key conforming to the - // "test.suite.run.status" semantic conventions. It represents the status of the - // test suite run. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "success", "failure", "skipped", "aborted", "timed_out", - // "in_progress" - TestSuiteRunStatusKey = attribute.Key("test.suite.run.status") -) - -// TestCaseName returns an attribute KeyValue conforming to the "test.case.name" -// semantic conventions. It represents the fully qualified human readable name of -// the [test case]. -// -// [test case]: https://wikipedia.org/wiki/Test_case -func TestCaseName(val string) attribute.KeyValue { - return TestCaseNameKey.String(val) -} - -// TestSuiteName returns an attribute KeyValue conforming to the -// "test.suite.name" semantic conventions. It represents the human readable name -// of a [test suite]. -// -// [test suite]: https://wikipedia.org/wiki/Test_suite -func TestSuiteName(val string) attribute.KeyValue { - return TestSuiteNameKey.String(val) -} - -// Enum values for test.case.result.status -var ( - // pass - // Stability: development - TestCaseResultStatusPass = TestCaseResultStatusKey.String("pass") - // fail - // Stability: development - TestCaseResultStatusFail = TestCaseResultStatusKey.String("fail") -) - -// Enum values for test.suite.run.status -var ( - // success - // Stability: development - TestSuiteRunStatusSuccess = TestSuiteRunStatusKey.String("success") - // failure - // Stability: development - TestSuiteRunStatusFailure = TestSuiteRunStatusKey.String("failure") - // skipped - // Stability: development - TestSuiteRunStatusSkipped = TestSuiteRunStatusKey.String("skipped") - // aborted - // Stability: development - TestSuiteRunStatusAborted = TestSuiteRunStatusKey.String("aborted") - // timed_out - // Stability: development - TestSuiteRunStatusTimedOut = TestSuiteRunStatusKey.String("timed_out") - // in_progress - // Stability: development - TestSuiteRunStatusInProgress = TestSuiteRunStatusKey.String("in_progress") -) - -// Namespace: thread -const ( - // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic - // conventions. It represents the current "managed" thread ID (as opposed to OS - // thread ID). - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - ThreadIDKey = attribute.Key("thread.id") - - // ThreadNameKey is the attribute Key conforming to the "thread.name" semantic - // conventions. It represents the current thread name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: main - ThreadNameKey = attribute.Key("thread.name") -) - -// ThreadID returns an attribute KeyValue conforming to the "thread.id" semantic -// conventions. It represents the current "managed" thread ID (as opposed to OS -// thread ID). -func ThreadID(val int) attribute.KeyValue { - return ThreadIDKey.Int(val) -} - -// ThreadName returns an attribute KeyValue conforming to the "thread.name" -// semantic conventions. It represents the current thread name. -func ThreadName(val string) attribute.KeyValue { - return ThreadNameKey.String(val) -} - -// Namespace: tls -const ( - // TLSCipherKey is the attribute Key conforming to the "tls.cipher" semantic - // conventions. It represents the string indicating the [cipher] used during the - // current connection. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - // "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` - // of the [registered TLS Cipher Suits]. - // - // [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5 - // [registered TLS Cipher Suits]: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4 - TLSCipherKey = attribute.Key("tls.cipher") - - // TLSClientCertificateKey is the attribute Key conforming to the - // "tls.client.certificate" semantic conventions. It represents the pEM-encoded - // stand-alone certificate offered by the client. This is usually - // mutually-exclusive of `client.certificate_chain` since this value also exists - // in that list. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "MII..." - TLSClientCertificateKey = attribute.Key("tls.client.certificate") - - // TLSClientCertificateChainKey is the attribute Key conforming to the - // "tls.client.certificate_chain" semantic conventions. It represents the array - // of PEM-encoded certificates that make up the certificate chain offered by the - // client. This is usually mutually-exclusive of `client.certificate` since that - // value should be the first certificate in the chain. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "MII...", "MI..." - TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain") - - // TLSClientHashMd5Key is the attribute Key conforming to the - // "tls.client.hash.md5" semantic conventions. It represents the certificate - // fingerprint using the MD5 digest of DER-encoded version of certificate - // offered by the client. For consistency with other hash values, this value - // should be formatted as an uppercase hash. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC" - TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5") - - // TLSClientHashSha1Key is the attribute Key conforming to the - // "tls.client.hash.sha1" semantic conventions. It represents the certificate - // fingerprint using the SHA1 digest of DER-encoded version of certificate - // offered by the client. For consistency with other hash values, this value - // should be formatted as an uppercase hash. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A" - TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1") - - // TLSClientHashSha256Key is the attribute Key conforming to the - // "tls.client.hash.sha256" semantic conventions. It represents the certificate - // fingerprint using the SHA256 digest of DER-encoded version of certificate - // offered by the client. For consistency with other hash values, this value - // should be formatted as an uppercase hash. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0" - TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256") - - // TLSClientIssuerKey is the attribute Key conforming to the "tls.client.issuer" - // semantic conventions. It represents the distinguished name of [subject] of - // the issuer of the x.509 certificate presented by the client. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com" - // - // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 - TLSClientIssuerKey = attribute.Key("tls.client.issuer") - - // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3" - // semantic conventions. It represents a hash that identifies clients based on - // how they perform an SSL/TLS handshake. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "d4e5b18d6b55c71272893221c96ba240" - TLSClientJa3Key = attribute.Key("tls.client.ja3") - - // TLSClientNotAfterKey is the attribute Key conforming to the - // "tls.client.not_after" semantic conventions. It represents the date/Time - // indicating when client certificate is no longer considered valid. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021-01-01T00:00:00.000Z" - TLSClientNotAfterKey = attribute.Key("tls.client.not_after") - - // TLSClientNotBeforeKey is the attribute Key conforming to the - // "tls.client.not_before" semantic conventions. It represents the date/Time - // indicating when client certificate is first considered valid. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1970-01-01T00:00:00.000Z" - TLSClientNotBeforeKey = attribute.Key("tls.client.not_before") - - // TLSClientSubjectKey is the attribute Key conforming to the - // "tls.client.subject" semantic conventions. It represents the distinguished - // name of subject of the x.509 certificate presented by the client. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "CN=myclient, OU=Documentation Team, DC=example, DC=com" - TLSClientSubjectKey = attribute.Key("tls.client.subject") - - // TLSClientSupportedCiphersKey is the attribute Key conforming to the - // "tls.client.supported_ciphers" semantic conventions. It represents the array - // of ciphers offered by the client during the client hello. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers") - - // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic - // conventions. It represents the string indicating the curve used for the given - // cipher, when applicable. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "secp256r1" - TLSCurveKey = attribute.Key("tls.curve") - - // TLSEstablishedKey is the attribute Key conforming to the "tls.established" - // semantic conventions. It represents the boolean flag indicating if the TLS - // negotiation was successful and transitioned to an encrypted tunnel. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: true - TLSEstablishedKey = attribute.Key("tls.established") - - // TLSNextProtocolKey is the attribute Key conforming to the "tls.next_protocol" - // semantic conventions. It represents the string indicating the protocol being - // tunneled. Per the values in the [IANA registry], this string should be lower - // case. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "http/1.1" - // - // [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids - TLSNextProtocolKey = attribute.Key("tls.next_protocol") - - // TLSProtocolNameKey is the attribute Key conforming to the "tls.protocol.name" - // semantic conventions. It represents the normalized lowercase protocol name - // parsed from original string of the negotiated [SSL/TLS protocol version]. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [SSL/TLS protocol version]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES - TLSProtocolNameKey = attribute.Key("tls.protocol.name") - - // TLSProtocolVersionKey is the attribute Key conforming to the - // "tls.protocol.version" semantic conventions. It represents the numeric part - // of the version parsed from the original string of the negotiated - // [SSL/TLS protocol version]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1.2", "3" - // - // [SSL/TLS protocol version]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES - TLSProtocolVersionKey = attribute.Key("tls.protocol.version") - - // TLSResumedKey is the attribute Key conforming to the "tls.resumed" semantic - // conventions. It represents the boolean flag indicating if this TLS connection - // was resumed from an existing TLS negotiation. - // - // Type: boolean - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: true - TLSResumedKey = attribute.Key("tls.resumed") - - // TLSServerCertificateKey is the attribute Key conforming to the - // "tls.server.certificate" semantic conventions. It represents the pEM-encoded - // stand-alone certificate offered by the server. This is usually - // mutually-exclusive of `server.certificate_chain` since this value also exists - // in that list. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "MII..." - TLSServerCertificateKey = attribute.Key("tls.server.certificate") - - // TLSServerCertificateChainKey is the attribute Key conforming to the - // "tls.server.certificate_chain" semantic conventions. It represents the array - // of PEM-encoded certificates that make up the certificate chain offered by the - // server. This is usually mutually-exclusive of `server.certificate` since that - // value should be the first certificate in the chain. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "MII...", "MI..." - TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain") - - // TLSServerHashMd5Key is the attribute Key conforming to the - // "tls.server.hash.md5" semantic conventions. It represents the certificate - // fingerprint using the MD5 digest of DER-encoded version of certificate - // offered by the server. For consistency with other hash values, this value - // should be formatted as an uppercase hash. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC" - TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5") - - // TLSServerHashSha1Key is the attribute Key conforming to the - // "tls.server.hash.sha1" semantic conventions. It represents the certificate - // fingerprint using the SHA1 digest of DER-encoded version of certificate - // offered by the server. For consistency with other hash values, this value - // should be formatted as an uppercase hash. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A" - TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1") - - // TLSServerHashSha256Key is the attribute Key conforming to the - // "tls.server.hash.sha256" semantic conventions. It represents the certificate - // fingerprint using the SHA256 digest of DER-encoded version of certificate - // offered by the server. For consistency with other hash values, this value - // should be formatted as an uppercase hash. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0" - TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256") - - // TLSServerIssuerKey is the attribute Key conforming to the "tls.server.issuer" - // semantic conventions. It represents the distinguished name of [subject] of - // the issuer of the x.509 certificate presented by the client. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com" - // - // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 - TLSServerIssuerKey = attribute.Key("tls.server.issuer") - - // TLSServerJa3sKey is the attribute Key conforming to the "tls.server.ja3s" - // semantic conventions. It represents a hash that identifies servers based on - // how they perform an SSL/TLS handshake. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "d4e5b18d6b55c71272893221c96ba240" - TLSServerJa3sKey = attribute.Key("tls.server.ja3s") - - // TLSServerNotAfterKey is the attribute Key conforming to the - // "tls.server.not_after" semantic conventions. It represents the date/Time - // indicating when server certificate is no longer considered valid. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2021-01-01T00:00:00.000Z" - TLSServerNotAfterKey = attribute.Key("tls.server.not_after") - - // TLSServerNotBeforeKey is the attribute Key conforming to the - // "tls.server.not_before" semantic conventions. It represents the date/Time - // indicating when server certificate is first considered valid. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "1970-01-01T00:00:00.000Z" - TLSServerNotBeforeKey = attribute.Key("tls.server.not_before") - - // TLSServerSubjectKey is the attribute Key conforming to the - // "tls.server.subject" semantic conventions. It represents the distinguished - // name of subject of the x.509 certificate presented by the server. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "CN=myserver, OU=Documentation Team, DC=example, DC=com" - TLSServerSubjectKey = attribute.Key("tls.server.subject") -) - -// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher" -// semantic conventions. It represents the string indicating the [cipher] used -// during the current connection. -// -// [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5 -func TLSCipher(val string) attribute.KeyValue { - return TLSCipherKey.String(val) -} - -// TLSClientCertificate returns an attribute KeyValue conforming to the -// "tls.client.certificate" semantic conventions. It represents the pEM-encoded -// stand-alone certificate offered by the client. This is usually -// mutually-exclusive of `client.certificate_chain` since this value also exists -// in that list. -func TLSClientCertificate(val string) attribute.KeyValue { - return TLSClientCertificateKey.String(val) -} - -// TLSClientCertificateChain returns an attribute KeyValue conforming to the -// "tls.client.certificate_chain" semantic conventions. It represents the array -// of PEM-encoded certificates that make up the certificate chain offered by the -// client. This is usually mutually-exclusive of `client.certificate` since that -// value should be the first certificate in the chain. -func TLSClientCertificateChain(val ...string) attribute.KeyValue { - return TLSClientCertificateChainKey.StringSlice(val) -} - -// TLSClientHashMd5 returns an attribute KeyValue conforming to the -// "tls.client.hash.md5" semantic conventions. It represents the certificate -// fingerprint using the MD5 digest of DER-encoded version of certificate offered -// by the client. For consistency with other hash values, this value should be -// formatted as an uppercase hash. -func TLSClientHashMd5(val string) attribute.KeyValue { - return TLSClientHashMd5Key.String(val) -} - -// TLSClientHashSha1 returns an attribute KeyValue conforming to the -// "tls.client.hash.sha1" semantic conventions. It represents the certificate -// fingerprint using the SHA1 digest of DER-encoded version of certificate -// offered by the client. For consistency with other hash values, this value -// should be formatted as an uppercase hash. -func TLSClientHashSha1(val string) attribute.KeyValue { - return TLSClientHashSha1Key.String(val) -} - -// TLSClientHashSha256 returns an attribute KeyValue conforming to the -// "tls.client.hash.sha256" semantic conventions. It represents the certificate -// fingerprint using the SHA256 digest of DER-encoded version of certificate -// offered by the client. For consistency with other hash values, this value -// should be formatted as an uppercase hash. -func TLSClientHashSha256(val string) attribute.KeyValue { - return TLSClientHashSha256Key.String(val) -} - -// TLSClientIssuer returns an attribute KeyValue conforming to the -// "tls.client.issuer" semantic conventions. It represents the distinguished name -// of [subject] of the issuer of the x.509 certificate presented by the client. -// -// [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 -func TLSClientIssuer(val string) attribute.KeyValue { - return TLSClientIssuerKey.String(val) -} - -// TLSClientJa3 returns an attribute KeyValue conforming to the "tls.client.ja3" -// semantic conventions. It represents a hash that identifies clients based on -// how they perform an SSL/TLS handshake. -func TLSClientJa3(val string) attribute.KeyValue { - return TLSClientJa3Key.String(val) -} - -// TLSClientNotAfter returns an attribute KeyValue conforming to the -// "tls.client.not_after" semantic conventions. It represents the date/Time -// indicating when client certificate is no longer considered valid. -func TLSClientNotAfter(val string) attribute.KeyValue { - return TLSClientNotAfterKey.String(val) -} - -// TLSClientNotBefore returns an attribute KeyValue conforming to the -// "tls.client.not_before" semantic conventions. It represents the date/Time -// indicating when client certificate is first considered valid. -func TLSClientNotBefore(val string) attribute.KeyValue { - return TLSClientNotBeforeKey.String(val) -} - -// TLSClientSubject returns an attribute KeyValue conforming to the -// "tls.client.subject" semantic conventions. It represents the distinguished -// name of subject of the x.509 certificate presented by the client. -func TLSClientSubject(val string) attribute.KeyValue { - return TLSClientSubjectKey.String(val) -} - -// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the -// "tls.client.supported_ciphers" semantic conventions. It represents the array -// of ciphers offered by the client during the client hello. -func TLSClientSupportedCiphers(val ...string) attribute.KeyValue { - return TLSClientSupportedCiphersKey.StringSlice(val) -} - -// TLSCurve returns an attribute KeyValue conforming to the "tls.curve" semantic -// conventions. It represents the string indicating the curve used for the given -// cipher, when applicable. -func TLSCurve(val string) attribute.KeyValue { - return TLSCurveKey.String(val) -} - -// TLSEstablished returns an attribute KeyValue conforming to the -// "tls.established" semantic conventions. It represents the boolean flag -// indicating if the TLS negotiation was successful and transitioned to an -// encrypted tunnel. -func TLSEstablished(val bool) attribute.KeyValue { - return TLSEstablishedKey.Bool(val) -} - -// TLSNextProtocol returns an attribute KeyValue conforming to the -// "tls.next_protocol" semantic conventions. It represents the string indicating -// the protocol being tunneled. Per the values in the [IANA registry], this -// string should be lower case. -// -// [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids -func TLSNextProtocol(val string) attribute.KeyValue { - return TLSNextProtocolKey.String(val) -} - -// TLSProtocolVersion returns an attribute KeyValue conforming to the -// "tls.protocol.version" semantic conventions. It represents the numeric part of -// the version parsed from the original string of the negotiated -// [SSL/TLS protocol version]. -// -// [SSL/TLS protocol version]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES -func TLSProtocolVersion(val string) attribute.KeyValue { - return TLSProtocolVersionKey.String(val) -} - -// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed" -// semantic conventions. It represents the boolean flag indicating if this TLS -// connection was resumed from an existing TLS negotiation. -func TLSResumed(val bool) attribute.KeyValue { - return TLSResumedKey.Bool(val) -} - -// TLSServerCertificate returns an attribute KeyValue conforming to the -// "tls.server.certificate" semantic conventions. It represents the pEM-encoded -// stand-alone certificate offered by the server. This is usually -// mutually-exclusive of `server.certificate_chain` since this value also exists -// in that list. -func TLSServerCertificate(val string) attribute.KeyValue { - return TLSServerCertificateKey.String(val) -} - -// TLSServerCertificateChain returns an attribute KeyValue conforming to the -// "tls.server.certificate_chain" semantic conventions. It represents the array -// of PEM-encoded certificates that make up the certificate chain offered by the -// server. This is usually mutually-exclusive of `server.certificate` since that -// value should be the first certificate in the chain. -func TLSServerCertificateChain(val ...string) attribute.KeyValue { - return TLSServerCertificateChainKey.StringSlice(val) -} - -// TLSServerHashMd5 returns an attribute KeyValue conforming to the -// "tls.server.hash.md5" semantic conventions. It represents the certificate -// fingerprint using the MD5 digest of DER-encoded version of certificate offered -// by the server. For consistency with other hash values, this value should be -// formatted as an uppercase hash. -func TLSServerHashMd5(val string) attribute.KeyValue { - return TLSServerHashMd5Key.String(val) -} - -// TLSServerHashSha1 returns an attribute KeyValue conforming to the -// "tls.server.hash.sha1" semantic conventions. It represents the certificate -// fingerprint using the SHA1 digest of DER-encoded version of certificate -// offered by the server. For consistency with other hash values, this value -// should be formatted as an uppercase hash. -func TLSServerHashSha1(val string) attribute.KeyValue { - return TLSServerHashSha1Key.String(val) -} - -// TLSServerHashSha256 returns an attribute KeyValue conforming to the -// "tls.server.hash.sha256" semantic conventions. It represents the certificate -// fingerprint using the SHA256 digest of DER-encoded version of certificate -// offered by the server. For consistency with other hash values, this value -// should be formatted as an uppercase hash. -func TLSServerHashSha256(val string) attribute.KeyValue { - return TLSServerHashSha256Key.String(val) -} - -// TLSServerIssuer returns an attribute KeyValue conforming to the -// "tls.server.issuer" semantic conventions. It represents the distinguished name -// of [subject] of the issuer of the x.509 certificate presented by the client. -// -// [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 -func TLSServerIssuer(val string) attribute.KeyValue { - return TLSServerIssuerKey.String(val) -} - -// TLSServerJa3s returns an attribute KeyValue conforming to the -// "tls.server.ja3s" semantic conventions. It represents a hash that identifies -// servers based on how they perform an SSL/TLS handshake. -func TLSServerJa3s(val string) attribute.KeyValue { - return TLSServerJa3sKey.String(val) -} - -// TLSServerNotAfter returns an attribute KeyValue conforming to the -// "tls.server.not_after" semantic conventions. It represents the date/Time -// indicating when server certificate is no longer considered valid. -func TLSServerNotAfter(val string) attribute.KeyValue { - return TLSServerNotAfterKey.String(val) -} - -// TLSServerNotBefore returns an attribute KeyValue conforming to the -// "tls.server.not_before" semantic conventions. It represents the date/Time -// indicating when server certificate is first considered valid. -func TLSServerNotBefore(val string) attribute.KeyValue { - return TLSServerNotBeforeKey.String(val) -} - -// TLSServerSubject returns an attribute KeyValue conforming to the -// "tls.server.subject" semantic conventions. It represents the distinguished -// name of subject of the x.509 certificate presented by the server. -func TLSServerSubject(val string) attribute.KeyValue { - return TLSServerSubjectKey.String(val) -} - -// Enum values for tls.protocol.name -var ( - // ssl - // Stability: development - TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl") - // tls - // Stability: development - TLSProtocolNameTLS = TLSProtocolNameKey.String("tls") -) - -// Namespace: url -const ( - // URLDomainKey is the attribute Key conforming to the "url.domain" semantic - // conventions. It represents the domain extracted from the `url.full`, such as - // "opentelemetry.io". - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "www.foo.bar", "opentelemetry.io", "3.12.167.2", - // "[1080:0:0:0:8:800:200C:417A]" - // Note: In some cases a URL may refer to an IP and/or port directly, without a - // domain name. In this case, the IP address would go to the domain field. If - // the URL contains a [literal IPv6 address] enclosed by `[` and `]`, the `[` - // and `]` characters should also be captured in the domain field. - // - // [literal IPv6 address]: https://www.rfc-editor.org/rfc/rfc2732#section-2 - URLDomainKey = attribute.Key("url.domain") - - // URLExtensionKey is the attribute Key conforming to the "url.extension" - // semantic conventions. It represents the file extension extracted from the - // `url.full`, excluding the leading dot. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "png", "gz" - // Note: The file extension is only set if it exists, as not every url has a - // file extension. When the file name has multiple extensions `example.tar.gz`, - // only the last one should be captured `gz`, not `tar.gz`. - URLExtensionKey = attribute.Key("url.extension") - - // URLFragmentKey is the attribute Key conforming to the "url.fragment" semantic - // conventions. It represents the [URI fragment] component. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "SemConv" - // - // [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5 - URLFragmentKey = attribute.Key("url.fragment") - - // URLFullKey is the attribute Key conforming to the "url.full" semantic - // conventions. It represents the absolute URL describing a network resource - // according to [RFC3986]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", "//localhost" - // Note: For network calls, URL usually has - // `scheme://host[:port][path][?query][#fragment]` format, where the fragment - // is not transmitted over HTTP, but if it is known, it SHOULD be included - // nevertheless. - // - // `url.full` MUST NOT contain credentials passed via URL in form of - // `https://username:password@www.example.com/`. - // In such case username and password SHOULD be redacted and attribute's value - // SHOULD be `https://REDACTED:REDACTED@www.example.com/`. - // - // `url.full` SHOULD capture the absolute URL when it is available (or can be - // reconstructed). - // - // Sensitive content provided in `url.full` SHOULD be scrubbed when - // instrumentations can identify it. - // - // - // Query string values for the following keys SHOULD be redacted by default and - // replaced by the - // value `REDACTED`: - // - // - [`AWSAccessKeyId`] - // - [`Signature`] - // - [`sig`] - // - [`X-Goog-Signature`] - // - // This list is subject to change over time. - // - // When a query string value is redacted, the query string key SHOULD still be - // preserved, e.g. - // `https://www.example.com/path?color=blue&sig=REDACTED`. - // - // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986 - // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth - // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth - // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token - // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls - URLFullKey = attribute.Key("url.full") - - // URLOriginalKey is the attribute Key conforming to the "url.original" semantic - // conventions. It represents the unmodified original URL as seen in the event - // source. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", - // "search?q=OpenTelemetry" - // Note: In network monitoring, the observed URL may be a full URL, whereas in - // access logs, the URL is often just represented as a path. This field is meant - // to represent the URL as it was observed, complete or not. - // `url.original` might contain credentials passed via URL in form of - // `https://username:password@www.example.com/`. In such case password and - // username SHOULD NOT be redacted and attribute's value SHOULD remain the same. - URLOriginalKey = attribute.Key("url.original") - - // URLPathKey is the attribute Key conforming to the "url.path" semantic - // conventions. It represents the [URI path] component. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "/search" - // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when - // instrumentations can identify it. - // - // [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3 - URLPathKey = attribute.Key("url.path") - - // URLPortKey is the attribute Key conforming to the "url.port" semantic - // conventions. It represents the port extracted from the `url.full`. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 443 - URLPortKey = attribute.Key("url.port") - - // URLQueryKey is the attribute Key conforming to the "url.query" semantic - // conventions. It represents the [URI query] component. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "q=OpenTelemetry" - // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when - // instrumentations can identify it. - // - // - // Query string values for the following keys SHOULD be redacted by default and - // replaced by the value `REDACTED`: - // - // - [`AWSAccessKeyId`] - // - [`Signature`] - // - [`sig`] - // - [`X-Goog-Signature`] - // - // This list is subject to change over time. - // - // When a query string value is redacted, the query string key SHOULD still be - // preserved, e.g. - // `q=OpenTelemetry&sig=REDACTED`. - // - // [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4 - // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth - // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth - // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token - // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls - URLQueryKey = attribute.Key("url.query") - - // URLRegisteredDomainKey is the attribute Key conforming to the - // "url.registered_domain" semantic conventions. It represents the highest - // registered url domain, stripped of the subdomain. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "example.com", "foo.co.uk" - // Note: This value can be determined precisely with the [public suffix list]. - // For example, the registered domain for `foo.example.com` is `example.com`. - // Trying to approximate this by simply taking the last two labels will not work - // well for TLDs such as `co.uk`. - // - // [public suffix list]: http://publicsuffix.org - URLRegisteredDomainKey = attribute.Key("url.registered_domain") - - // URLSchemeKey is the attribute Key conforming to the "url.scheme" semantic - // conventions. It represents the [URI scheme] component identifying the used - // protocol. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "https", "ftp", "telnet" - // - // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 - URLSchemeKey = attribute.Key("url.scheme") - - // URLSubdomainKey is the attribute Key conforming to the "url.subdomain" - // semantic conventions. It represents the subdomain portion of a fully - // qualified domain name includes all of the names except the host name under - // the registered_domain. In a partially qualified domain, or if the - // qualification level of the full name cannot be determined, subdomain contains - // all of the names below the registered domain. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "east", "sub2.sub1" - // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the - // domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the - // subdomain field should contain `sub2.sub1`, with no trailing period. - URLSubdomainKey = attribute.Key("url.subdomain") - - // URLTemplateKey is the attribute Key conforming to the "url.template" semantic - // conventions. It represents the low-cardinality template of an - // [absolute path reference]. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "/users/{id}", "/users/:id", "/users?id={id}" - // - // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 - URLTemplateKey = attribute.Key("url.template") - - // URLTopLevelDomainKey is the attribute Key conforming to the - // "url.top_level_domain" semantic conventions. It represents the effective top - // level domain (eTLD), also known as the domain suffix, is the last part of the - // domain name. For example, the top level domain for example.com is `com`. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "com", "co.uk" - // Note: This value can be determined precisely with the [public suffix list]. - // - // [public suffix list]: http://publicsuffix.org - URLTopLevelDomainKey = attribute.Key("url.top_level_domain") -) - -// URLDomain returns an attribute KeyValue conforming to the "url.domain" -// semantic conventions. It represents the domain extracted from the `url.full`, -// such as "opentelemetry.io". -func URLDomain(val string) attribute.KeyValue { - return URLDomainKey.String(val) -} - -// URLExtension returns an attribute KeyValue conforming to the "url.extension" -// semantic conventions. It represents the file extension extracted from the -// `url.full`, excluding the leading dot. -func URLExtension(val string) attribute.KeyValue { - return URLExtensionKey.String(val) -} - -// URLFragment returns an attribute KeyValue conforming to the "url.fragment" -// semantic conventions. It represents the [URI fragment] component. -// -// [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5 -func URLFragment(val string) attribute.KeyValue { - return URLFragmentKey.String(val) -} - -// URLFull returns an attribute KeyValue conforming to the "url.full" semantic -// conventions. It represents the absolute URL describing a network resource -// according to [RFC3986]. -// -// [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986 -func URLFull(val string) attribute.KeyValue { - return URLFullKey.String(val) -} - -// URLOriginal returns an attribute KeyValue conforming to the "url.original" -// semantic conventions. It represents the unmodified original URL as seen in the -// event source. -func URLOriginal(val string) attribute.KeyValue { - return URLOriginalKey.String(val) -} - -// URLPath returns an attribute KeyValue conforming to the "url.path" semantic -// conventions. It represents the [URI path] component. -// -// [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3 -func URLPath(val string) attribute.KeyValue { - return URLPathKey.String(val) -} - -// URLPort returns an attribute KeyValue conforming to the "url.port" semantic -// conventions. It represents the port extracted from the `url.full`. -func URLPort(val int) attribute.KeyValue { - return URLPortKey.Int(val) -} - -// URLQuery returns an attribute KeyValue conforming to the "url.query" semantic -// conventions. It represents the [URI query] component. -// -// [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4 -func URLQuery(val string) attribute.KeyValue { - return URLQueryKey.String(val) -} - -// URLRegisteredDomain returns an attribute KeyValue conforming to the -// "url.registered_domain" semantic conventions. It represents the highest -// registered url domain, stripped of the subdomain. -func URLRegisteredDomain(val string) attribute.KeyValue { - return URLRegisteredDomainKey.String(val) -} - -// URLScheme returns an attribute KeyValue conforming to the "url.scheme" -// semantic conventions. It represents the [URI scheme] component identifying the -// used protocol. -// -// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 -func URLScheme(val string) attribute.KeyValue { - return URLSchemeKey.String(val) -} - -// URLSubdomain returns an attribute KeyValue conforming to the "url.subdomain" -// semantic conventions. It represents the subdomain portion of a fully qualified -// domain name includes all of the names except the host name under the -// registered_domain. In a partially qualified domain, or if the qualification -// level of the full name cannot be determined, subdomain contains all of the -// names below the registered domain. -func URLSubdomain(val string) attribute.KeyValue { - return URLSubdomainKey.String(val) -} - -// URLTemplate returns an attribute KeyValue conforming to the "url.template" -// semantic conventions. It represents the low-cardinality template of an -// [absolute path reference]. -// -// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 -func URLTemplate(val string) attribute.KeyValue { - return URLTemplateKey.String(val) -} - -// URLTopLevelDomain returns an attribute KeyValue conforming to the -// "url.top_level_domain" semantic conventions. It represents the effective top -// level domain (eTLD), also known as the domain suffix, is the last part of the -// domain name. For example, the top level domain for example.com is `com`. -func URLTopLevelDomain(val string) attribute.KeyValue { - return URLTopLevelDomainKey.String(val) -} - -// Namespace: user -const ( - // UserEmailKey is the attribute Key conforming to the "user.email" semantic - // conventions. It represents the user email address. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "a.einstein@example.com" - UserEmailKey = attribute.Key("user.email") - - // UserFullNameKey is the attribute Key conforming to the "user.full_name" - // semantic conventions. It represents the user's full name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Albert Einstein" - UserFullNameKey = attribute.Key("user.full_name") - - // UserHashKey is the attribute Key conforming to the "user.hash" semantic - // conventions. It represents the unique user hash to correlate information for - // a user in anonymized form. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "364fc68eaf4c8acec74a4e52d7d1feaa" - // Note: Useful if `user.id` or `user.name` contain confidential information and - // cannot be used. - UserHashKey = attribute.Key("user.hash") - - // UserIDKey is the attribute Key conforming to the "user.id" semantic - // conventions. It represents the unique identifier of the user. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "S-1-5-21-202424912787-2692429404-2351956786-1000" - UserIDKey = attribute.Key("user.id") - - // UserNameKey is the attribute Key conforming to the "user.name" semantic - // conventions. It represents the short name or login/username of the user. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "a.einstein" - UserNameKey = attribute.Key("user.name") - - // UserRolesKey is the attribute Key conforming to the "user.roles" semantic - // conventions. It represents the array of user roles at the time of the event. - // - // Type: string[] - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "admin", "reporting_user" - UserRolesKey = attribute.Key("user.roles") -) - -// UserEmail returns an attribute KeyValue conforming to the "user.email" -// semantic conventions. It represents the user email address. -func UserEmail(val string) attribute.KeyValue { - return UserEmailKey.String(val) -} - -// UserFullName returns an attribute KeyValue conforming to the "user.full_name" -// semantic conventions. It represents the user's full name. -func UserFullName(val string) attribute.KeyValue { - return UserFullNameKey.String(val) -} - -// UserHash returns an attribute KeyValue conforming to the "user.hash" semantic -// conventions. It represents the unique user hash to correlate information for a -// user in anonymized form. -func UserHash(val string) attribute.KeyValue { - return UserHashKey.String(val) -} - -// UserID returns an attribute KeyValue conforming to the "user.id" semantic -// conventions. It represents the unique identifier of the user. -func UserID(val string) attribute.KeyValue { - return UserIDKey.String(val) -} - -// UserName returns an attribute KeyValue conforming to the "user.name" semantic -// conventions. It represents the short name or login/username of the user. -func UserName(val string) attribute.KeyValue { - return UserNameKey.String(val) -} - -// UserRoles returns an attribute KeyValue conforming to the "user.roles" -// semantic conventions. It represents the array of user roles at the time of the -// event. -func UserRoles(val ...string) attribute.KeyValue { - return UserRolesKey.StringSlice(val) -} - -// Namespace: user_agent -const ( - // UserAgentNameKey is the attribute Key conforming to the "user_agent.name" - // semantic conventions. It represents the name of the user-agent extracted from - // original. Usually refers to the browser's name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Safari", "YourApp" - // Note: [Example] of extracting browser's name from original string. In the - // case of using a user-agent for non-browser products, such as microservices - // with multiple names/versions inside the `user_agent.original`, the most - // significant name SHOULD be selected. In such a scenario it should align with - // `user_agent.version` - // - // [Example]: https://www.whatsmyua.info - UserAgentNameKey = attribute.Key("user_agent.name") - - // UserAgentOriginalKey is the attribute Key conforming to the - // "user_agent.original" semantic conventions. It represents the value of the - // [HTTP User-Agent] header sent by the client. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Stable - // - // Examples: "CERN-LineMode/2.15 libwww/2.17b3", "Mozilla/5.0 (iPhone; CPU - // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) - // Version/14.1.2 Mobile/15E148 Safari/604.1", "YourApp/1.0.0 - // grpc-java-okhttp/1.27.2" - // - // [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent - UserAgentOriginalKey = attribute.Key("user_agent.original") - - // UserAgentSyntheticTypeKey is the attribute Key conforming to the - // "user_agent.synthetic.type" semantic conventions. It represents the specifies - // the category of synthetic traffic, such as tests or bots. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // Note: This attribute MAY be derived from the contents of the - // `user_agent.original` attribute. Components that populate the attribute are - // responsible for determining what they consider to be synthetic bot or test - // traffic. This attribute can either be set for self-identification purposes, - // or on telemetry detected to be generated as a result of a synthetic request. - // This attribute is useful for distinguishing between genuine client traffic - // and synthetic traffic generated by bots or tests. - UserAgentSyntheticTypeKey = attribute.Key("user_agent.synthetic.type") - - // UserAgentVersionKey is the attribute Key conforming to the - // "user_agent.version" semantic conventions. It represents the version of the - // user-agent extracted from original. Usually refers to the browser's version. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "14.1.2", "1.0.0" - // Note: [Example] of extracting browser's version from original string. In the - // case of using a user-agent for non-browser products, such as microservices - // with multiple names/versions inside the `user_agent.original`, the most - // significant version SHOULD be selected. In such a scenario it should align - // with `user_agent.name` - // - // [Example]: https://www.whatsmyua.info - UserAgentVersionKey = attribute.Key("user_agent.version") -) - -// UserAgentName returns an attribute KeyValue conforming to the -// "user_agent.name" semantic conventions. It represents the name of the -// user-agent extracted from original. Usually refers to the browser's name. -func UserAgentName(val string) attribute.KeyValue { - return UserAgentNameKey.String(val) -} - -// UserAgentOriginal returns an attribute KeyValue conforming to the -// "user_agent.original" semantic conventions. It represents the value of the -// [HTTP User-Agent] header sent by the client. -// -// [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent -func UserAgentOriginal(val string) attribute.KeyValue { - return UserAgentOriginalKey.String(val) -} - -// UserAgentVersion returns an attribute KeyValue conforming to the -// "user_agent.version" semantic conventions. It represents the version of the -// user-agent extracted from original. Usually refers to the browser's version. -func UserAgentVersion(val string) attribute.KeyValue { - return UserAgentVersionKey.String(val) -} - -// Enum values for user_agent.synthetic.type -var ( - // Bot source. - // Stability: development - UserAgentSyntheticTypeBot = UserAgentSyntheticTypeKey.String("bot") - // Synthetic test source. - // Stability: development - UserAgentSyntheticTypeTest = UserAgentSyntheticTypeKey.String("test") -) - -// Namespace: vcs -const ( - // VCSChangeIDKey is the attribute Key conforming to the "vcs.change.id" - // semantic conventions. It represents the ID of the change (pull request/merge - // request/changelist) if applicable. This is usually a unique (within - // repository) identifier generated by the VCS system. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "123" - VCSChangeIDKey = attribute.Key("vcs.change.id") - - // VCSChangeStateKey is the attribute Key conforming to the "vcs.change.state" - // semantic conventions. It represents the state of the change (pull - // request/merge request/changelist). - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "open", "closed", "merged" - VCSChangeStateKey = attribute.Key("vcs.change.state") - - // VCSChangeTitleKey is the attribute Key conforming to the "vcs.change.title" - // semantic conventions. It represents the human readable title of the change - // (pull request/merge request/changelist). This title is often a brief summary - // of the change and may get merged in to a ref as the commit summary. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Fixes broken thing", "feat: add my new feature", "[chore] update - // dependency" - VCSChangeTitleKey = attribute.Key("vcs.change.title") - - // VCSLineChangeTypeKey is the attribute Key conforming to the - // "vcs.line_change.type" semantic conventions. It represents the type of line - // change being measured on a branch or change. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "added", "removed" - VCSLineChangeTypeKey = attribute.Key("vcs.line_change.type") - - // VCSRefBaseNameKey is the attribute Key conforming to the "vcs.ref.base.name" - // semantic conventions. It represents the name of the [reference] such as - // **branch** or **tag** in the repository. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-feature-branch", "tag-1-test" - // Note: `base` refers to the starting point of a change. For example, `main` - // would be the base reference of type branch if you've created a new - // reference of type branch from it and created new commits. - // - // [reference]: https://git-scm.com/docs/gitglossary#def_ref - VCSRefBaseNameKey = attribute.Key("vcs.ref.base.name") - - // VCSRefBaseRevisionKey is the attribute Key conforming to the - // "vcs.ref.base.revision" semantic conventions. It represents the revision, - // literally [revised version], The revision most often refers to a commit - // object in Git, or a revision number in SVN. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc", - // "main", "123", "HEAD" - // Note: `base` refers to the starting point of a change. For example, `main` - // would be the base reference of type branch if you've created a new - // reference of type branch from it and created new commits. The - // revision can be a full [hash value (see - // glossary)], - // of the recorded change to a ref within a repository pointing to a - // commit [commit] object. It does - // not necessarily have to be a hash; it can simply define a [revision - // number] - // which is an integer that is monotonically increasing. In cases where - // it is identical to the `ref.base.name`, it SHOULD still be included. - // It is up to the implementer to decide which value to set as the - // revision based on the VCS system and situational context. - // - // [revised version]: https://www.merriam-webster.com/dictionary/revision - // [hash value (see - // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf - // [commit]: https://git-scm.com/docs/git-commit - // [revision - // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html - VCSRefBaseRevisionKey = attribute.Key("vcs.ref.base.revision") - - // VCSRefBaseTypeKey is the attribute Key conforming to the "vcs.ref.base.type" - // semantic conventions. It represents the type of the [reference] in the - // repository. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "branch", "tag" - // Note: `base` refers to the starting point of a change. For example, `main` - // would be the base reference of type branch if you've created a new - // reference of type branch from it and created new commits. - // - // [reference]: https://git-scm.com/docs/gitglossary#def_ref - VCSRefBaseTypeKey = attribute.Key("vcs.ref.base.type") - - // VCSRefHeadNameKey is the attribute Key conforming to the "vcs.ref.head.name" - // semantic conventions. It represents the name of the [reference] such as - // **branch** or **tag** in the repository. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "my-feature-branch", "tag-1-test" - // Note: `head` refers to where you are right now; the current reference at a - // given time. - // - // [reference]: https://git-scm.com/docs/gitglossary#def_ref - VCSRefHeadNameKey = attribute.Key("vcs.ref.head.name") - - // VCSRefHeadRevisionKey is the attribute Key conforming to the - // "vcs.ref.head.revision" semantic conventions. It represents the revision, - // literally [revised version], The revision most often refers to a commit - // object in Git, or a revision number in SVN. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc", - // "main", "123", "HEAD" - // Note: `head` refers to where you are right now; the current reference at a - // given time.The revision can be a full [hash value (see - // glossary)], - // of the recorded change to a ref within a repository pointing to a - // commit [commit] object. It does - // not necessarily have to be a hash; it can simply define a [revision - // number] - // which is an integer that is monotonically increasing. In cases where - // it is identical to the `ref.head.name`, it SHOULD still be included. - // It is up to the implementer to decide which value to set as the - // revision based on the VCS system and situational context. - // - // [revised version]: https://www.merriam-webster.com/dictionary/revision - // [hash value (see - // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf - // [commit]: https://git-scm.com/docs/git-commit - // [revision - // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html - VCSRefHeadRevisionKey = attribute.Key("vcs.ref.head.revision") - - // VCSRefHeadTypeKey is the attribute Key conforming to the "vcs.ref.head.type" - // semantic conventions. It represents the type of the [reference] in the - // repository. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "branch", "tag" - // Note: `head` refers to where you are right now; the current reference at a - // given time. - // - // [reference]: https://git-scm.com/docs/gitglossary#def_ref - VCSRefHeadTypeKey = attribute.Key("vcs.ref.head.type") - - // VCSRefTypeKey is the attribute Key conforming to the "vcs.ref.type" semantic - // conventions. It represents the type of the [reference] in the repository. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "branch", "tag" - // - // [reference]: https://git-scm.com/docs/gitglossary#def_ref - VCSRefTypeKey = attribute.Key("vcs.ref.type") - - // VCSRepositoryNameKey is the attribute Key conforming to the - // "vcs.repository.name" semantic conventions. It represents the human readable - // name of the repository. It SHOULD NOT include any additional identifier like - // Group/SubGroup in GitLab or organization in GitHub. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "semantic-conventions", "my-cool-repo" - // Note: Due to it only being the name, it can clash with forks of the same - // repository if collecting telemetry across multiple orgs or groups in - // the same backends. - VCSRepositoryNameKey = attribute.Key("vcs.repository.name") - - // VCSRepositoryURLFullKey is the attribute Key conforming to the - // "vcs.repository.url.full" semantic conventions. It represents the - // [canonical URL] of the repository providing the complete HTTP(S) address in - // order to locate and identify the repository through a browser. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // "https://github.com/opentelemetry/open-telemetry-collector-contrib", - // "https://gitlab.com/my-org/my-project/my-projects-project/repo" - // Note: In Git Version Control Systems, the canonical URL SHOULD NOT include - // the `.git` extension. - // - // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. - VCSRepositoryURLFullKey = attribute.Key("vcs.repository.url.full") - - // VCSRevisionDeltaDirectionKey is the attribute Key conforming to the - // "vcs.revision_delta.direction" semantic conventions. It represents the type - // of revision comparison. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "ahead", "behind" - VCSRevisionDeltaDirectionKey = attribute.Key("vcs.revision_delta.direction") -) - -// VCSChangeID returns an attribute KeyValue conforming to the "vcs.change.id" -// semantic conventions. It represents the ID of the change (pull request/merge -// request/changelist) if applicable. This is usually a unique (within -// repository) identifier generated by the VCS system. -func VCSChangeID(val string) attribute.KeyValue { - return VCSChangeIDKey.String(val) -} - -// VCSChangeTitle returns an attribute KeyValue conforming to the -// "vcs.change.title" semantic conventions. It represents the human readable -// title of the change (pull request/merge request/changelist). This title is -// often a brief summary of the change and may get merged in to a ref as the -// commit summary. -func VCSChangeTitle(val string) attribute.KeyValue { - return VCSChangeTitleKey.String(val) -} - -// VCSRefBaseName returns an attribute KeyValue conforming to the -// "vcs.ref.base.name" semantic conventions. It represents the name of the -// [reference] such as **branch** or **tag** in the repository. -// -// [reference]: https://git-scm.com/docs/gitglossary#def_ref -func VCSRefBaseName(val string) attribute.KeyValue { - return VCSRefBaseNameKey.String(val) -} - -// VCSRefBaseRevision returns an attribute KeyValue conforming to the -// "vcs.ref.base.revision" semantic conventions. It represents the revision, -// literally [revised version], The revision most often refers to a commit object -// in Git, or a revision number in SVN. -// -// [revised version]: https://www.merriam-webster.com/dictionary/revision -func VCSRefBaseRevision(val string) attribute.KeyValue { - return VCSRefBaseRevisionKey.String(val) -} - -// VCSRefHeadName returns an attribute KeyValue conforming to the -// "vcs.ref.head.name" semantic conventions. It represents the name of the -// [reference] such as **branch** or **tag** in the repository. -// -// [reference]: https://git-scm.com/docs/gitglossary#def_ref -func VCSRefHeadName(val string) attribute.KeyValue { - return VCSRefHeadNameKey.String(val) -} - -// VCSRefHeadRevision returns an attribute KeyValue conforming to the -// "vcs.ref.head.revision" semantic conventions. It represents the revision, -// literally [revised version], The revision most often refers to a commit object -// in Git, or a revision number in SVN. -// -// [revised version]: https://www.merriam-webster.com/dictionary/revision -func VCSRefHeadRevision(val string) attribute.KeyValue { - return VCSRefHeadRevisionKey.String(val) -} - -// VCSRepositoryName returns an attribute KeyValue conforming to the -// "vcs.repository.name" semantic conventions. It represents the human readable -// name of the repository. It SHOULD NOT include any additional identifier like -// Group/SubGroup in GitLab or organization in GitHub. -func VCSRepositoryName(val string) attribute.KeyValue { - return VCSRepositoryNameKey.String(val) -} - -// VCSRepositoryURLFull returns an attribute KeyValue conforming to the -// "vcs.repository.url.full" semantic conventions. It represents the -// [canonical URL] of the repository providing the complete HTTP(S) address in -// order to locate and identify the repository through a browser. -// -// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. -func VCSRepositoryURLFull(val string) attribute.KeyValue { - return VCSRepositoryURLFullKey.String(val) -} - -// Enum values for vcs.change.state -var ( - // Open means the change is currently active and under review. It hasn't been - // merged into the target branch yet, and it's still possible to make changes or - // add comments. - // Stability: development - VCSChangeStateOpen = VCSChangeStateKey.String("open") - // WIP (work-in-progress, draft) means the change is still in progress and not - // yet ready for a full review. It might still undergo significant changes. - // Stability: development - VCSChangeStateWip = VCSChangeStateKey.String("wip") - // Closed means the merge request has been closed without merging. This can - // happen for various reasons, such as the changes being deemed unnecessary, the - // issue being resolved in another way, or the author deciding to withdraw the - // request. - // Stability: development - VCSChangeStateClosed = VCSChangeStateKey.String("closed") - // Merged indicates that the change has been successfully integrated into the - // target codebase. - // Stability: development - VCSChangeStateMerged = VCSChangeStateKey.String("merged") -) - -// Enum values for vcs.line_change.type -var ( - // How many lines were added. - // Stability: development - VCSLineChangeTypeAdded = VCSLineChangeTypeKey.String("added") - // How many lines were removed. - // Stability: development - VCSLineChangeTypeRemoved = VCSLineChangeTypeKey.String("removed") -) - -// Enum values for vcs.ref.base.type -var ( - // [branch] - // Stability: development - // - // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch - VCSRefBaseTypeBranch = VCSRefBaseTypeKey.String("branch") - // [tag] - // Stability: development - // - // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag - VCSRefBaseTypeTag = VCSRefBaseTypeKey.String("tag") -) - -// Enum values for vcs.ref.head.type -var ( - // [branch] - // Stability: development - // - // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch - VCSRefHeadTypeBranch = VCSRefHeadTypeKey.String("branch") - // [tag] - // Stability: development - // - // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag - VCSRefHeadTypeTag = VCSRefHeadTypeKey.String("tag") -) - -// Enum values for vcs.ref.type -var ( - // [branch] - // Stability: development - // - // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch - VCSRefTypeBranch = VCSRefTypeKey.String("branch") - // [tag] - // Stability: development - // - // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag - VCSRefTypeTag = VCSRefTypeKey.String("tag") -) - -// Enum values for vcs.revision_delta.direction -var ( - // How many revisions the change is behind the target ref. - // Stability: development - VCSRevisionDeltaDirectionBehind = VCSRevisionDeltaDirectionKey.String("behind") - // How many revisions the change is ahead of the target ref. - // Stability: development - VCSRevisionDeltaDirectionAhead = VCSRevisionDeltaDirectionKey.String("ahead") -) - -// Namespace: webengine -const ( - // WebEngineDescriptionKey is the attribute Key conforming to the - // "webengine.description" semantic conventions. It represents the additional - // description of the web engine (e.g. detailed version and edition - // information). - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - - // 2.2.2.Final" - WebEngineDescriptionKey = attribute.Key("webengine.description") - - // WebEngineNameKey is the attribute Key conforming to the "webengine.name" - // semantic conventions. It represents the name of the web engine. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "WildFly" - WebEngineNameKey = attribute.Key("webengine.name") - - // WebEngineVersionKey is the attribute Key conforming to the - // "webengine.version" semantic conventions. It represents the version of the - // web engine. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "21.0.0" - WebEngineVersionKey = attribute.Key("webengine.version") -) - -// WebEngineDescription returns an attribute KeyValue conforming to the -// "webengine.description" semantic conventions. It represents the additional -// description of the web engine (e.g. detailed version and edition information). -func WebEngineDescription(val string) attribute.KeyValue { - return WebEngineDescriptionKey.String(val) -} - -// WebEngineName returns an attribute KeyValue conforming to the "webengine.name" -// semantic conventions. It represents the name of the web engine. -func WebEngineName(val string) attribute.KeyValue { - return WebEngineNameKey.String(val) -} - -// WebEngineVersion returns an attribute KeyValue conforming to the -// "webengine.version" semantic conventions. It represents the version of the web -// engine. -func WebEngineVersion(val string) attribute.KeyValue { - return WebEngineVersionKey.String(val) -} \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/doc.go deleted file mode 100644 index 787f5b0f4..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package semconv implements OpenTelemetry semantic conventions. -// -// OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the v1.30.0 -// version of the OpenTelemetry semantic conventions. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.30.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/exception.go deleted file mode 100644 index 4332a795f..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/exception.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.30.0" - -const ( - // ExceptionEventName is the name of the Span event representing an exception. - ExceptionEventName = "exception" -) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/metric.go deleted file mode 100644 index fe6beb91d..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/metric.go +++ /dev/null @@ -1,1750 +0,0 @@ -// 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.30.0" - -const ( - // AzureCosmosDBClientActiveInstanceCount is the metric conforming to the - // "azure.cosmosdb.client.active_instance.count" semantic conventions. It - // represents the number of active client instances. - // Instrument: updowncounter - // Unit: {instance} - // Stability: development - AzureCosmosDBClientActiveInstanceCountName = "azure.cosmosdb.client.active_instance.count" - AzureCosmosDBClientActiveInstanceCountUnit = "{instance}" - AzureCosmosDBClientActiveInstanceCountDescription = "Number of active client instances" - // AzureCosmosDBClientOperationRequestCharge is the metric conforming to the - // "azure.cosmosdb.client.operation.request_charge" semantic conventions. It - // represents the [Request units] consumed by the operation. - // - // [Request units]: https://learn.microsoft.com/azure/cosmos-db/request-units - // Instrument: histogram - // Unit: {request_unit} - // Stability: development - AzureCosmosDBClientOperationRequestChargeName = "azure.cosmosdb.client.operation.request_charge" - AzureCosmosDBClientOperationRequestChargeUnit = "{request_unit}" - AzureCosmosDBClientOperationRequestChargeDescription = "[Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the operation" - // CICDPipelineRunActive is the metric conforming to the - // "cicd.pipeline.run.active" semantic conventions. It represents the number of - // pipeline runs currently active in the system by state. - // Instrument: updowncounter - // Unit: {run} - // Stability: development - CICDPipelineRunActiveName = "cicd.pipeline.run.active" - CICDPipelineRunActiveUnit = "{run}" - CICDPipelineRunActiveDescription = "The number of pipeline runs currently active in the system by state." - // CICDPipelineRunDuration is the metric conforming to the - // "cicd.pipeline.run.duration" semantic conventions. It represents the - // duration of a pipeline run grouped by pipeline, state and result. - // Instrument: histogram - // Unit: s - // Stability: development - CICDPipelineRunDurationName = "cicd.pipeline.run.duration" - CICDPipelineRunDurationUnit = "s" - CICDPipelineRunDurationDescription = "Duration of a pipeline run grouped by pipeline, state and result." - // CICDPipelineRunErrors is the metric conforming to the - // "cicd.pipeline.run.errors" semantic conventions. It represents the number of - // errors encountered in pipeline runs (eg. compile, test failures). - // Instrument: counter - // Unit: {error} - // Stability: development - CICDPipelineRunErrorsName = "cicd.pipeline.run.errors" - CICDPipelineRunErrorsUnit = "{error}" - CICDPipelineRunErrorsDescription = "The number of errors encountered in pipeline runs (eg. compile, test failures)." - // CICDSystemErrors is the metric conforming to the "cicd.system.errors" - // semantic conventions. It represents the number of errors in a component of - // the CICD system (eg. controller, scheduler, agent). - // Instrument: counter - // Unit: {error} - // Stability: development - CICDSystemErrorsName = "cicd.system.errors" - CICDSystemErrorsUnit = "{error}" - CICDSystemErrorsDescription = "The number of errors in a component of the CICD system (eg. controller, scheduler, agent)." - // CICDWorkerCount is the metric conforming to the "cicd.worker.count" semantic - // conventions. It represents the number of workers on the CICD system by - // state. - // Instrument: updowncounter - // Unit: {count} - // Stability: development - CICDWorkerCountName = "cicd.worker.count" - CICDWorkerCountUnit = "{count}" - CICDWorkerCountDescription = "The number of workers on the CICD system by state." - // ContainerCPUTime is the metric conforming to the "container.cpu.time" - // semantic conventions. It represents the total CPU time consumed. - // Instrument: counter - // Unit: s - // Stability: development - ContainerCPUTimeName = "container.cpu.time" - ContainerCPUTimeUnit = "s" - ContainerCPUTimeDescription = "Total CPU time consumed" - // ContainerCPUUsage is the metric conforming to the "container.cpu.usage" - // semantic conventions. It represents the container's CPU usage, measured in - // cpus. Range from 0 to the number of allocatable CPUs. - // Instrument: gauge - // Unit: {cpu} - // Stability: development - ContainerCPUUsageName = "container.cpu.usage" - ContainerCPUUsageUnit = "{cpu}" - ContainerCPUUsageDescription = "Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" - // ContainerDiskIo is the metric conforming to the "container.disk.io" semantic - // conventions. It represents the disk bytes for the container. - // Instrument: counter - // Unit: By - // Stability: development - ContainerDiskIoName = "container.disk.io" - ContainerDiskIoUnit = "By" - ContainerDiskIoDescription = "Disk bytes for the container." - // ContainerMemoryUsage is the metric conforming to the - // "container.memory.usage" semantic conventions. It represents the memory - // usage of the container. - // Instrument: counter - // Unit: By - // Stability: development - ContainerMemoryUsageName = "container.memory.usage" - ContainerMemoryUsageUnit = "By" - ContainerMemoryUsageDescription = "Memory usage of the container." - // ContainerNetworkIo is the metric conforming to the "container.network.io" - // semantic conventions. It represents the network bytes for the container. - // Instrument: counter - // Unit: By - // Stability: development - ContainerNetworkIoName = "container.network.io" - ContainerNetworkIoUnit = "By" - ContainerNetworkIoDescription = "Network bytes for the container." - // ContainerUptime is the metric conforming to the "container.uptime" semantic - // conventions. It represents the time the container has been running. - // Instrument: gauge - // Unit: s - // Stability: development - ContainerUptimeName = "container.uptime" - ContainerUptimeUnit = "s" - ContainerUptimeDescription = "The time the container has been running" - // DBClientConnectionCount is the metric conforming to the - // "db.client.connection.count" semantic conventions. It represents the number - // of connections that are currently in state described by the `state` - // attribute. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - DBClientConnectionCountName = "db.client.connection.count" - DBClientConnectionCountUnit = "{connection}" - DBClientConnectionCountDescription = "The number of connections that are currently in state described by the `state` attribute" - // DBClientConnectionCreateTime is the metric conforming to the - // "db.client.connection.create_time" semantic conventions. It represents the - // time it took to create a new connection. - // Instrument: histogram - // Unit: s - // Stability: development - DBClientConnectionCreateTimeName = "db.client.connection.create_time" - DBClientConnectionCreateTimeUnit = "s" - DBClientConnectionCreateTimeDescription = "The time it took to create a new connection" - // DBClientConnectionIdleMax is the metric conforming to the - // "db.client.connection.idle.max" semantic conventions. It represents the - // maximum number of idle open connections allowed. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - DBClientConnectionIdleMaxName = "db.client.connection.idle.max" - DBClientConnectionIdleMaxUnit = "{connection}" - DBClientConnectionIdleMaxDescription = "The maximum number of idle open connections allowed" - // DBClientConnectionIdleMin is the metric conforming to the - // "db.client.connection.idle.min" semantic conventions. It represents the - // minimum number of idle open connections allowed. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - DBClientConnectionIdleMinName = "db.client.connection.idle.min" - DBClientConnectionIdleMinUnit = "{connection}" - DBClientConnectionIdleMinDescription = "The minimum number of idle open connections allowed" - // DBClientConnectionMax is the metric conforming to the - // "db.client.connection.max" semantic conventions. It represents the maximum - // number of open connections allowed. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - DBClientConnectionMaxName = "db.client.connection.max" - DBClientConnectionMaxUnit = "{connection}" - DBClientConnectionMaxDescription = "The maximum number of open connections allowed" - // DBClientConnectionPendingRequests is the metric conforming to the - // "db.client.connection.pending_requests" semantic conventions. It represents - // the number of current pending requests for an open connection. - // Instrument: updowncounter - // Unit: {request} - // Stability: development - DBClientConnectionPendingRequestsName = "db.client.connection.pending_requests" - DBClientConnectionPendingRequestsUnit = "{request}" - DBClientConnectionPendingRequestsDescription = "The number of current pending requests for an open connection" - // DBClientConnectionTimeouts is the metric conforming to the - // "db.client.connection.timeouts" semantic conventions. It represents the - // number of connection timeouts that have occurred trying to obtain a - // connection from the pool. - // Instrument: counter - // Unit: {timeout} - // Stability: development - DBClientConnectionTimeoutsName = "db.client.connection.timeouts" - DBClientConnectionTimeoutsUnit = "{timeout}" - DBClientConnectionTimeoutsDescription = "The number of connection timeouts that have occurred trying to obtain a connection from the pool" - // DBClientConnectionUseTime is the metric conforming to the - // "db.client.connection.use_time" semantic conventions. It represents the time - // between borrowing a connection and returning it to the pool. - // Instrument: histogram - // Unit: s - // Stability: development - DBClientConnectionUseTimeName = "db.client.connection.use_time" - DBClientConnectionUseTimeUnit = "s" - DBClientConnectionUseTimeDescription = "The time between borrowing a connection and returning it to the pool" - // DBClientConnectionWaitTime is the metric conforming to the - // "db.client.connection.wait_time" semantic conventions. It represents the - // time it took to obtain an open connection from the pool. - // Instrument: histogram - // Unit: s - // Stability: development - DBClientConnectionWaitTimeName = "db.client.connection.wait_time" - DBClientConnectionWaitTimeUnit = "s" - DBClientConnectionWaitTimeDescription = "The time it took to obtain an open connection from the pool" - // DBClientConnectionsCreateTime is the metric conforming to the - // "db.client.connections.create_time" semantic conventions. It represents the - // deprecated, use `db.client.connection.create_time` instead. Note: the unit - // also changed from `ms` to `s`. - // Instrument: histogram - // Unit: ms - // Stability: development - // Deprecated: Replaced by `db.client.connection.create_time`. Note: the unit also changed from `ms` to `s`. - DBClientConnectionsCreateTimeName = "db.client.connections.create_time" - DBClientConnectionsCreateTimeUnit = "ms" - DBClientConnectionsCreateTimeDescription = "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`." - // DBClientConnectionsIdleMax is the metric conforming to the - // "db.client.connections.idle.max" semantic conventions. It represents the - // deprecated, use `db.client.connection.idle.max` instead. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - // Deprecated: Replaced by `db.client.connection.idle.max`. - DBClientConnectionsIdleMaxName = "db.client.connections.idle.max" - DBClientConnectionsIdleMaxUnit = "{connection}" - DBClientConnectionsIdleMaxDescription = "Deprecated, use `db.client.connection.idle.max` instead." - // DBClientConnectionsIdleMin is the metric conforming to the - // "db.client.connections.idle.min" semantic conventions. It represents the - // deprecated, use `db.client.connection.idle.min` instead. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - // Deprecated: Replaced by `db.client.connection.idle.min`. - DBClientConnectionsIdleMinName = "db.client.connections.idle.min" - DBClientConnectionsIdleMinUnit = "{connection}" - DBClientConnectionsIdleMinDescription = "Deprecated, use `db.client.connection.idle.min` instead." - // DBClientConnectionsMax is the metric conforming to the - // "db.client.connections.max" semantic conventions. It represents the - // deprecated, use `db.client.connection.max` instead. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - // Deprecated: Replaced by `db.client.connection.max`. - DBClientConnectionsMaxName = "db.client.connections.max" - DBClientConnectionsMaxUnit = "{connection}" - DBClientConnectionsMaxDescription = "Deprecated, use `db.client.connection.max` instead." - // DBClientConnectionsPendingRequests is the metric conforming to the - // "db.client.connections.pending_requests" semantic conventions. It represents - // the deprecated, use `db.client.connection.pending_requests` instead. - // Instrument: updowncounter - // Unit: {request} - // Stability: development - // Deprecated: Replaced by `db.client.connection.pending_requests`. - DBClientConnectionsPendingRequestsName = "db.client.connections.pending_requests" - DBClientConnectionsPendingRequestsUnit = "{request}" - DBClientConnectionsPendingRequestsDescription = "Deprecated, use `db.client.connection.pending_requests` instead." - // DBClientConnectionsTimeouts is the metric conforming to the - // "db.client.connections.timeouts" semantic conventions. It represents the - // deprecated, use `db.client.connection.timeouts` instead. - // Instrument: counter - // Unit: {timeout} - // Stability: development - // Deprecated: Replaced by `db.client.connection.timeouts`. - DBClientConnectionsTimeoutsName = "db.client.connections.timeouts" - DBClientConnectionsTimeoutsUnit = "{timeout}" - DBClientConnectionsTimeoutsDescription = "Deprecated, use `db.client.connection.timeouts` instead." - // DBClientConnectionsUsage is the metric conforming to the - // "db.client.connections.usage" semantic conventions. It represents the - // deprecated, use `db.client.connection.count` instead. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - // Deprecated: Replaced by `db.client.connection.count`. - DBClientConnectionsUsageName = "db.client.connections.usage" - DBClientConnectionsUsageUnit = "{connection}" - DBClientConnectionsUsageDescription = "Deprecated, use `db.client.connection.count` instead." - // DBClientConnectionsUseTime is the metric conforming to the - // "db.client.connections.use_time" semantic conventions. It represents the - // deprecated, use `db.client.connection.use_time` instead. Note: the unit also - // changed from `ms` to `s`. - // Instrument: histogram - // Unit: ms - // Stability: development - // Deprecated: Replaced by `db.client.connection.use_time`. Note: the unit also changed from `ms` to `s`. - DBClientConnectionsUseTimeName = "db.client.connections.use_time" - DBClientConnectionsUseTimeUnit = "ms" - DBClientConnectionsUseTimeDescription = "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`." - // DBClientConnectionsWaitTime is the metric conforming to the - // "db.client.connections.wait_time" semantic conventions. It represents the - // deprecated, use `db.client.connection.wait_time` instead. Note: the unit - // also changed from `ms` to `s`. - // Instrument: histogram - // Unit: ms - // Stability: development - // Deprecated: Replaced by `db.client.connection.wait_time`. Note: the unit also changed from `ms` to `s`. - DBClientConnectionsWaitTimeName = "db.client.connections.wait_time" - DBClientConnectionsWaitTimeUnit = "ms" - DBClientConnectionsWaitTimeDescription = "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`." - // DBClientCosmosDBActiveInstanceCount is the metric conforming to the - // "db.client.cosmosdb.active_instance.count" semantic conventions. It - // represents the deprecated, use `azure.cosmosdb.client.active_instance.count` - // instead. - // Instrument: updowncounter - // Unit: {instance} - // Stability: development - // Deprecated: Replaced by `azure.cosmosdb.client.active_instance.count`. - DBClientCosmosDBActiveInstanceCountName = "db.client.cosmosdb.active_instance.count" - DBClientCosmosDBActiveInstanceCountUnit = "{instance}" - DBClientCosmosDBActiveInstanceCountDescription = "Deprecated, use `azure.cosmosdb.client.active_instance.count` instead." - // DBClientCosmosDBOperationRequestCharge is the metric conforming to the - // "db.client.cosmosdb.operation.request_charge" semantic conventions. It - // represents the deprecated, use - // `azure.cosmosdb.client.operation.request_charge` instead. - // Instrument: histogram - // Unit: {request_unit} - // Stability: development - // Deprecated: Replaced by `azure.cosmosdb.client.operation.request_charge`. - DBClientCosmosDBOperationRequestChargeName = "db.client.cosmosdb.operation.request_charge" - DBClientCosmosDBOperationRequestChargeUnit = "{request_unit}" - DBClientCosmosDBOperationRequestChargeDescription = "Deprecated, use `azure.cosmosdb.client.operation.request_charge` instead." - // DBClientOperationDuration is the metric conforming to the - // "db.client.operation.duration" semantic conventions. It represents the - // duration of database client operations. - // Instrument: histogram - // Unit: s - // Stability: release_candidate - DBClientOperationDurationName = "db.client.operation.duration" - DBClientOperationDurationUnit = "s" - DBClientOperationDurationDescription = "Duration of database client operations." - // DBClientResponseReturnedRows is the metric conforming to the - // "db.client.response.returned_rows" semantic conventions. It represents the - // actual number of records returned by the database operation. - // Instrument: histogram - // Unit: {row} - // Stability: development - DBClientResponseReturnedRowsName = "db.client.response.returned_rows" - DBClientResponseReturnedRowsUnit = "{row}" - DBClientResponseReturnedRowsDescription = "The actual number of records returned by the database operation." - // DNSLookupDuration is the metric conforming to the "dns.lookup.duration" - // semantic conventions. It represents the measures the time taken to perform a - // DNS lookup. - // Instrument: histogram - // Unit: s - // Stability: development - DNSLookupDurationName = "dns.lookup.duration" - DNSLookupDurationUnit = "s" - DNSLookupDurationDescription = "Measures the time taken to perform a DNS lookup." - // FaaSColdstarts is the metric conforming to the "faas.coldstarts" semantic - // conventions. It represents the number of invocation cold starts. - // Instrument: counter - // Unit: {coldstart} - // Stability: development - FaaSColdstartsName = "faas.coldstarts" - FaaSColdstartsUnit = "{coldstart}" - FaaSColdstartsDescription = "Number of invocation cold starts" - // FaaSCPUUsage is the metric conforming to the "faas.cpu_usage" semantic - // conventions. It represents the distribution of CPU usage per invocation. - // Instrument: histogram - // Unit: s - // Stability: development - FaaSCPUUsageName = "faas.cpu_usage" - FaaSCPUUsageUnit = "s" - FaaSCPUUsageDescription = "Distribution of CPU usage per invocation" - // FaaSErrors is the metric conforming to the "faas.errors" semantic - // conventions. It represents the number of invocation errors. - // Instrument: counter - // Unit: {error} - // Stability: development - FaaSErrorsName = "faas.errors" - FaaSErrorsUnit = "{error}" - FaaSErrorsDescription = "Number of invocation errors" - // FaaSInitDuration is the metric conforming to the "faas.init_duration" - // semantic conventions. It represents the measures the duration of the - // function's initialization, such as a cold start. - // Instrument: histogram - // Unit: s - // Stability: development - FaaSInitDurationName = "faas.init_duration" - FaaSInitDurationUnit = "s" - FaaSInitDurationDescription = "Measures the duration of the function's initialization, such as a cold start" - // FaaSInvocations is the metric conforming to the "faas.invocations" semantic - // conventions. It represents the number of successful invocations. - // Instrument: counter - // Unit: {invocation} - // Stability: development - FaaSInvocationsName = "faas.invocations" - FaaSInvocationsUnit = "{invocation}" - FaaSInvocationsDescription = "Number of successful invocations" - // FaaSInvokeDuration is the metric conforming to the "faas.invoke_duration" - // semantic conventions. It represents the measures the duration of the - // function's logic execution. - // Instrument: histogram - // Unit: s - // Stability: development - FaaSInvokeDurationName = "faas.invoke_duration" - FaaSInvokeDurationUnit = "s" - FaaSInvokeDurationDescription = "Measures the duration of the function's logic execution" - // FaaSMemUsage is the metric conforming to the "faas.mem_usage" semantic - // conventions. It represents the distribution of max memory usage per - // invocation. - // Instrument: histogram - // Unit: By - // Stability: development - FaaSMemUsageName = "faas.mem_usage" - FaaSMemUsageUnit = "By" - FaaSMemUsageDescription = "Distribution of max memory usage per invocation" - // FaaSNetIo is the metric conforming to the "faas.net_io" semantic - // conventions. It represents the distribution of net I/O usage per invocation. - // Instrument: histogram - // Unit: By - // Stability: development - FaaSNetIoName = "faas.net_io" - FaaSNetIoUnit = "By" - FaaSNetIoDescription = "Distribution of net I/O usage per invocation" - // FaaSTimeouts is the metric conforming to the "faas.timeouts" semantic - // conventions. It represents the number of invocation timeouts. - // Instrument: counter - // Unit: {timeout} - // Stability: development - FaaSTimeoutsName = "faas.timeouts" - FaaSTimeoutsUnit = "{timeout}" - FaaSTimeoutsDescription = "Number of invocation timeouts" - // GenAIClientOperationDuration is the metric conforming to the - // "gen_ai.client.operation.duration" semantic conventions. It represents the - // genAI operation duration. - // Instrument: histogram - // Unit: s - // Stability: development - GenAIClientOperationDurationName = "gen_ai.client.operation.duration" - GenAIClientOperationDurationUnit = "s" - GenAIClientOperationDurationDescription = "GenAI operation duration" - // GenAIClientTokenUsage is the metric conforming to the - // "gen_ai.client.token.usage" semantic conventions. It represents the measures - // number of input and output tokens used. - // Instrument: histogram - // Unit: {token} - // Stability: development - GenAIClientTokenUsageName = "gen_ai.client.token.usage" - GenAIClientTokenUsageUnit = "{token}" - GenAIClientTokenUsageDescription = "Measures number of input and output tokens used" - // GenAIServerRequestDuration is the metric conforming to the - // "gen_ai.server.request.duration" semantic conventions. It represents the - // generative AI server request duration such as time-to-last byte or last - // output token. - // Instrument: histogram - // Unit: s - // Stability: development - GenAIServerRequestDurationName = "gen_ai.server.request.duration" - GenAIServerRequestDurationUnit = "s" - GenAIServerRequestDurationDescription = "Generative AI server request duration such as time-to-last byte or last output token" - // GenAIServerTimePerOutputToken is the metric conforming to the - // "gen_ai.server.time_per_output_token" semantic conventions. It represents - // the time per output token generated after the first token for successful - // responses. - // Instrument: histogram - // Unit: s - // Stability: development - GenAIServerTimePerOutputTokenName = "gen_ai.server.time_per_output_token" - GenAIServerTimePerOutputTokenUnit = "s" - GenAIServerTimePerOutputTokenDescription = "Time per output token generated after the first token for successful responses" - // GenAIServerTimeToFirstToken is the metric conforming to the - // "gen_ai.server.time_to_first_token" semantic conventions. It represents the - // time to generate first token for successful responses. - // Instrument: histogram - // Unit: s - // Stability: development - GenAIServerTimeToFirstTokenName = "gen_ai.server.time_to_first_token" - GenAIServerTimeToFirstTokenUnit = "s" - GenAIServerTimeToFirstTokenDescription = "Time to generate first token for successful responses" - // GoConfigGogc is the metric conforming to the "go.config.gogc" semantic - // conventions. It represents the heap size target percentage configured by the - // user, otherwise 100. - // Instrument: updowncounter - // Unit: % - // Stability: development - GoConfigGogcName = "go.config.gogc" - GoConfigGogcUnit = "%" - GoConfigGogcDescription = "Heap size target percentage configured by the user, otherwise 100." - // GoGoroutineCount is the metric conforming to the "go.goroutine.count" - // semantic conventions. It represents the count of live goroutines. - // Instrument: updowncounter - // Unit: {goroutine} - // Stability: development - GoGoroutineCountName = "go.goroutine.count" - GoGoroutineCountUnit = "{goroutine}" - GoGoroutineCountDescription = "Count of live goroutines." - // GoMemoryAllocated is the metric conforming to the "go.memory.allocated" - // semantic conventions. It represents the memory allocated to the heap by the - // application. - // Instrument: counter - // Unit: By - // Stability: development - GoMemoryAllocatedName = "go.memory.allocated" - GoMemoryAllocatedUnit = "By" - GoMemoryAllocatedDescription = "Memory allocated to the heap by the application." - // GoMemoryAllocations is the metric conforming to the "go.memory.allocations" - // semantic conventions. It represents the count of allocations to the heap by - // the application. - // Instrument: counter - // Unit: {allocation} - // Stability: development - GoMemoryAllocationsName = "go.memory.allocations" - GoMemoryAllocationsUnit = "{allocation}" - GoMemoryAllocationsDescription = "Count of allocations to the heap by the application." - // GoMemoryGCGoal is the metric conforming to the "go.memory.gc.goal" semantic - // conventions. It represents the heap size target for the end of the GC cycle. - // Instrument: updowncounter - // Unit: By - // Stability: development - GoMemoryGCGoalName = "go.memory.gc.goal" - GoMemoryGCGoalUnit = "By" - GoMemoryGCGoalDescription = "Heap size target for the end of the GC cycle." - // GoMemoryLimit is the metric conforming to the "go.memory.limit" semantic - // conventions. It represents the go runtime memory limit configured by the - // user, if a limit exists. - // Instrument: updowncounter - // Unit: By - // Stability: development - GoMemoryLimitName = "go.memory.limit" - GoMemoryLimitUnit = "By" - GoMemoryLimitDescription = "Go runtime memory limit configured by the user, if a limit exists." - // GoMemoryUsed is the metric conforming to the "go.memory.used" semantic - // conventions. It represents the memory used by the Go runtime. - // Instrument: updowncounter - // Unit: By - // Stability: development - GoMemoryUsedName = "go.memory.used" - GoMemoryUsedUnit = "By" - GoMemoryUsedDescription = "Memory used by the Go runtime." - // GoProcessorLimit is the metric conforming to the "go.processor.limit" - // semantic conventions. It represents the number of OS threads that can - // execute user-level Go code simultaneously. - // Instrument: updowncounter - // Unit: {thread} - // Stability: development - GoProcessorLimitName = "go.processor.limit" - GoProcessorLimitUnit = "{thread}" - GoProcessorLimitDescription = "The number of OS threads that can execute user-level Go code simultaneously." - // GoScheduleDuration is the metric conforming to the "go.schedule.duration" - // semantic conventions. It represents the time goroutines have spent in the - // scheduler in a runnable state before actually running. - // Instrument: histogram - // Unit: s - // Stability: development - GoScheduleDurationName = "go.schedule.duration" - GoScheduleDurationUnit = "s" - GoScheduleDurationDescription = "The time goroutines have spent in the scheduler in a runnable state before actually running." - // HTTPClientActiveRequests is the metric conforming to the - // "http.client.active_requests" semantic conventions. It represents the number - // of active HTTP requests. - // Instrument: updowncounter - // Unit: {request} - // Stability: development - HTTPClientActiveRequestsName = "http.client.active_requests" - HTTPClientActiveRequestsUnit = "{request}" - HTTPClientActiveRequestsDescription = "Number of active HTTP requests." - // HTTPClientConnectionDuration is the metric conforming to the - // "http.client.connection.duration" semantic conventions. It represents the - // duration of the successfully established outbound HTTP connections. - // Instrument: histogram - // Unit: s - // Stability: development - HTTPClientConnectionDurationName = "http.client.connection.duration" - HTTPClientConnectionDurationUnit = "s" - HTTPClientConnectionDurationDescription = "The duration of the successfully established outbound HTTP connections." - // HTTPClientOpenConnections is the metric conforming to the - // "http.client.open_connections" semantic conventions. It represents the - // number of outbound HTTP connections that are currently active or idle on the - // client. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - HTTPClientOpenConnectionsName = "http.client.open_connections" - HTTPClientOpenConnectionsUnit = "{connection}" - HTTPClientOpenConnectionsDescription = "Number of outbound HTTP connections that are currently active or idle on the client." - // HTTPClientRequestBodySize is the metric conforming to the - // "http.client.request.body.size" semantic conventions. It represents the size - // of HTTP client request bodies. - // Instrument: histogram - // Unit: By - // Stability: development - HTTPClientRequestBodySizeName = "http.client.request.body.size" - HTTPClientRequestBodySizeUnit = "By" - HTTPClientRequestBodySizeDescription = "Size of HTTP client request bodies." - // HTTPClientRequestDuration is the metric conforming to the - // "http.client.request.duration" semantic conventions. It represents the - // duration of HTTP client requests. - // Instrument: histogram - // Unit: s - // Stability: stable - HTTPClientRequestDurationName = "http.client.request.duration" - HTTPClientRequestDurationUnit = "s" - HTTPClientRequestDurationDescription = "Duration of HTTP client requests." - // HTTPClientResponseBodySize is the metric conforming to the - // "http.client.response.body.size" semantic conventions. It represents the - // size of HTTP client response bodies. - // Instrument: histogram - // Unit: By - // Stability: development - HTTPClientResponseBodySizeName = "http.client.response.body.size" - HTTPClientResponseBodySizeUnit = "By" - HTTPClientResponseBodySizeDescription = "Size of HTTP client response bodies." - // HTTPServerActiveRequests is the metric conforming to the - // "http.server.active_requests" semantic conventions. It represents the number - // of active HTTP server requests. - // Instrument: updowncounter - // Unit: {request} - // Stability: development - HTTPServerActiveRequestsName = "http.server.active_requests" - HTTPServerActiveRequestsUnit = "{request}" - HTTPServerActiveRequestsDescription = "Number of active HTTP server requests." - // HTTPServerRequestBodySize is the metric conforming to the - // "http.server.request.body.size" semantic conventions. It represents the size - // of HTTP server request bodies. - // Instrument: histogram - // Unit: By - // Stability: development - HTTPServerRequestBodySizeName = "http.server.request.body.size" - HTTPServerRequestBodySizeUnit = "By" - HTTPServerRequestBodySizeDescription = "Size of HTTP server request bodies." - // HTTPServerRequestDuration is the metric conforming to the - // "http.server.request.duration" semantic conventions. It represents the - // duration of HTTP server requests. - // Instrument: histogram - // Unit: s - // Stability: stable - HTTPServerRequestDurationName = "http.server.request.duration" - HTTPServerRequestDurationUnit = "s" - HTTPServerRequestDurationDescription = "Duration of HTTP server requests." - // HTTPServerResponseBodySize is the metric conforming to the - // "http.server.response.body.size" semantic conventions. It represents the - // size of HTTP server response bodies. - // Instrument: histogram - // Unit: By - // Stability: development - HTTPServerResponseBodySizeName = "http.server.response.body.size" - HTTPServerResponseBodySizeUnit = "By" - HTTPServerResponseBodySizeDescription = "Size of HTTP server response bodies." - // HwEnergy is the metric conforming to the "hw.energy" semantic conventions. - // It represents the energy consumed by the component. - // Instrument: counter - // Unit: J - // Stability: development - HwEnergyName = "hw.energy" - HwEnergyUnit = "J" - HwEnergyDescription = "Energy consumed by the component" - // HwErrors is the metric conforming to the "hw.errors" semantic conventions. - // It represents the number of errors encountered by the component. - // Instrument: counter - // Unit: {error} - // Stability: development - HwErrorsName = "hw.errors" - HwErrorsUnit = "{error}" - HwErrorsDescription = "Number of errors encountered by the component" - // HwPower is the metric conforming to the "hw.power" semantic conventions. It - // represents the instantaneous power consumed by the component. - // Instrument: gauge - // Unit: W - // Stability: development - HwPowerName = "hw.power" - HwPowerUnit = "W" - HwPowerDescription = "Instantaneous power consumed by the component" - // HwStatus is the metric conforming to the "hw.status" semantic conventions. - // It represents the operational status: `1` (true) or `0` (false) for each of - // the possible states. - // Instrument: updowncounter - // Unit: 1 - // Stability: development - HwStatusName = "hw.status" - HwStatusUnit = "1" - HwStatusDescription = "Operational status: `1` (true) or `0` (false) for each of the possible states" - // K8SCronJobActiveJobs is the metric conforming to the - // "k8s.cronjob.active_jobs" semantic conventions. It represents the number of - // actively running jobs for a cronjob. - // Instrument: updowncounter - // Unit: {job} - // Stability: development - K8SCronJobActiveJobsName = "k8s.cronjob.active_jobs" - K8SCronJobActiveJobsUnit = "{job}" - K8SCronJobActiveJobsDescription = "The number of actively running jobs for a cronjob" - // K8SDaemonSetCurrentScheduledNodes is the metric conforming to the - // "k8s.daemonset.current_scheduled_nodes" semantic conventions. It represents - // the number of nodes that are running at least 1 daemon pod and are supposed - // to run the daemon pod. - // Instrument: updowncounter - // Unit: {node} - // Stability: development - K8SDaemonSetCurrentScheduledNodesName = "k8s.daemonset.current_scheduled_nodes" - K8SDaemonSetCurrentScheduledNodesUnit = "{node}" - K8SDaemonSetCurrentScheduledNodesDescription = "Number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod" - // K8SDaemonSetDesiredScheduledNodes is the metric conforming to the - // "k8s.daemonset.desired_scheduled_nodes" semantic conventions. It represents - // the number of nodes that should be running the daemon pod (including nodes - // currently running the daemon pod). - // Instrument: updowncounter - // Unit: {node} - // Stability: development - K8SDaemonSetDesiredScheduledNodesName = "k8s.daemonset.desired_scheduled_nodes" - K8SDaemonSetDesiredScheduledNodesUnit = "{node}" - K8SDaemonSetDesiredScheduledNodesDescription = "Number of nodes that should be running the daemon pod (including nodes currently running the daemon pod)" - // K8SDaemonSetMisscheduledNodes is the metric conforming to the - // "k8s.daemonset.misscheduled_nodes" semantic conventions. It represents the - // number of nodes that are running the daemon pod, but are not supposed to run - // the daemon pod. - // Instrument: updowncounter - // Unit: {node} - // Stability: development - K8SDaemonSetMisscheduledNodesName = "k8s.daemonset.misscheduled_nodes" - K8SDaemonSetMisscheduledNodesUnit = "{node}" - K8SDaemonSetMisscheduledNodesDescription = "Number of nodes that are running the daemon pod, but are not supposed to run the daemon pod" - // K8SDaemonSetReadyNodes is the metric conforming to the - // "k8s.daemonset.ready_nodes" semantic conventions. It represents the number - // of nodes that should be running the daemon pod and have one or more of the - // daemon pod running and ready. - // Instrument: updowncounter - // Unit: {node} - // Stability: development - K8SDaemonSetReadyNodesName = "k8s.daemonset.ready_nodes" - K8SDaemonSetReadyNodesUnit = "{node}" - K8SDaemonSetReadyNodesDescription = "Number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready" - // K8SDeploymentAvailablePods is the metric conforming to the - // "k8s.deployment.available_pods" semantic conventions. It represents the - // total number of available replica pods (ready for at least minReadySeconds) - // targeted by this deployment. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SDeploymentAvailablePodsName = "k8s.deployment.available_pods" - K8SDeploymentAvailablePodsUnit = "{pod}" - K8SDeploymentAvailablePodsDescription = "Total number of available replica pods (ready for at least minReadySeconds) targeted by this deployment" - // K8SDeploymentDesiredPods is the metric conforming to the - // "k8s.deployment.desired_pods" semantic conventions. It represents the number - // of desired replica pods in this deployment. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SDeploymentDesiredPodsName = "k8s.deployment.desired_pods" - K8SDeploymentDesiredPodsUnit = "{pod}" - K8SDeploymentDesiredPodsDescription = "Number of desired replica pods in this deployment" - // K8SHpaCurrentPods is the metric conforming to the "k8s.hpa.current_pods" - // semantic conventions. It represents the current number of replica pods - // managed by this horizontal pod autoscaler, as last seen by the autoscaler. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SHpaCurrentPodsName = "k8s.hpa.current_pods" - K8SHpaCurrentPodsUnit = "{pod}" - K8SHpaCurrentPodsDescription = "Current number of replica pods managed by this horizontal pod autoscaler, as last seen by the autoscaler" - // K8SHpaDesiredPods is the metric conforming to the "k8s.hpa.desired_pods" - // semantic conventions. It represents the desired number of replica pods - // managed by this horizontal pod autoscaler, as last calculated by the - // autoscaler. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SHpaDesiredPodsName = "k8s.hpa.desired_pods" - K8SHpaDesiredPodsUnit = "{pod}" - K8SHpaDesiredPodsDescription = "Desired number of replica pods managed by this horizontal pod autoscaler, as last calculated by the autoscaler" - // K8SHpaMaxPods is the metric conforming to the "k8s.hpa.max_pods" semantic - // conventions. It represents the upper limit for the number of replica pods to - // which the autoscaler can scale up. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SHpaMaxPodsName = "k8s.hpa.max_pods" - K8SHpaMaxPodsUnit = "{pod}" - K8SHpaMaxPodsDescription = "The upper limit for the number of replica pods to which the autoscaler can scale up" - // K8SHpaMinPods is the metric conforming to the "k8s.hpa.min_pods" semantic - // conventions. It represents the lower limit for the number of replica pods to - // which the autoscaler can scale down. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SHpaMinPodsName = "k8s.hpa.min_pods" - K8SHpaMinPodsUnit = "{pod}" - K8SHpaMinPodsDescription = "The lower limit for the number of replica pods to which the autoscaler can scale down" - // K8SJobActivePods is the metric conforming to the "k8s.job.active_pods" - // semantic conventions. It represents the number of pending and actively - // running pods for a job. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SJobActivePodsName = "k8s.job.active_pods" - K8SJobActivePodsUnit = "{pod}" - K8SJobActivePodsDescription = "The number of pending and actively running pods for a job" - // K8SJobDesiredSuccessfulPods is the metric conforming to the - // "k8s.job.desired_successful_pods" semantic conventions. It represents the - // desired number of successfully finished pods the job should be run with. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SJobDesiredSuccessfulPodsName = "k8s.job.desired_successful_pods" - K8SJobDesiredSuccessfulPodsUnit = "{pod}" - K8SJobDesiredSuccessfulPodsDescription = "The desired number of successfully finished pods the job should be run with" - // K8SJobFailedPods is the metric conforming to the "k8s.job.failed_pods" - // semantic conventions. It represents the number of pods which reached phase - // Failed for a job. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SJobFailedPodsName = "k8s.job.failed_pods" - K8SJobFailedPodsUnit = "{pod}" - K8SJobFailedPodsDescription = "The number of pods which reached phase Failed for a job" - // K8SJobMaxParallelPods is the metric conforming to the - // "k8s.job.max_parallel_pods" semantic conventions. It represents the max - // desired number of pods the job should run at any given time. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SJobMaxParallelPodsName = "k8s.job.max_parallel_pods" - K8SJobMaxParallelPodsUnit = "{pod}" - K8SJobMaxParallelPodsDescription = "The max desired number of pods the job should run at any given time" - // K8SJobSuccessfulPods is the metric conforming to the - // "k8s.job.successful_pods" semantic conventions. It represents the number of - // pods which reached phase Succeeded for a job. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SJobSuccessfulPodsName = "k8s.job.successful_pods" - K8SJobSuccessfulPodsUnit = "{pod}" - K8SJobSuccessfulPodsDescription = "The number of pods which reached phase Succeeded for a job" - // K8SNamespacePhase is the metric conforming to the "k8s.namespace.phase" - // semantic conventions. It represents the describes number of K8s namespaces - // that are currently in a given phase. - // Instrument: updowncounter - // Unit: {namespace} - // Stability: development - K8SNamespacePhaseName = "k8s.namespace.phase" - K8SNamespacePhaseUnit = "{namespace}" - K8SNamespacePhaseDescription = "Describes number of K8s namespaces that are currently in a given phase." - // K8SNodeCPUTime is the metric conforming to the "k8s.node.cpu.time" semantic - // conventions. It represents the total CPU time consumed. - // Instrument: counter - // Unit: s - // Stability: development - K8SNodeCPUTimeName = "k8s.node.cpu.time" - K8SNodeCPUTimeUnit = "s" - K8SNodeCPUTimeDescription = "Total CPU time consumed" - // K8SNodeCPUUsage is the metric conforming to the "k8s.node.cpu.usage" - // semantic conventions. It represents the node's CPU usage, measured in cpus. - // Range from 0 to the number of allocatable CPUs. - // Instrument: gauge - // Unit: {cpu} - // Stability: development - K8SNodeCPUUsageName = "k8s.node.cpu.usage" - K8SNodeCPUUsageUnit = "{cpu}" - K8SNodeCPUUsageDescription = "Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" - // K8SNodeMemoryUsage is the metric conforming to the "k8s.node.memory.usage" - // semantic conventions. It represents the memory usage of the Node. - // Instrument: gauge - // Unit: By - // Stability: development - K8SNodeMemoryUsageName = "k8s.node.memory.usage" - K8SNodeMemoryUsageUnit = "By" - K8SNodeMemoryUsageDescription = "Memory usage of the Node" - // K8SNodeNetworkErrors is the metric conforming to the - // "k8s.node.network.errors" semantic conventions. It represents the node - // network errors. - // Instrument: counter - // Unit: {error} - // Stability: development - K8SNodeNetworkErrorsName = "k8s.node.network.errors" - K8SNodeNetworkErrorsUnit = "{error}" - K8SNodeNetworkErrorsDescription = "Node network errors" - // K8SNodeNetworkIo is the metric conforming to the "k8s.node.network.io" - // semantic conventions. It represents the network bytes for the Node. - // Instrument: counter - // Unit: By - // Stability: development - K8SNodeNetworkIoName = "k8s.node.network.io" - K8SNodeNetworkIoUnit = "By" - K8SNodeNetworkIoDescription = "Network bytes for the Node" - // K8SNodeUptime is the metric conforming to the "k8s.node.uptime" semantic - // conventions. It represents the time the Node has been running. - // Instrument: gauge - // Unit: s - // Stability: development - K8SNodeUptimeName = "k8s.node.uptime" - K8SNodeUptimeUnit = "s" - K8SNodeUptimeDescription = "The time the Node has been running" - // K8SPodCPUTime is the metric conforming to the "k8s.pod.cpu.time" semantic - // conventions. It represents the total CPU time consumed. - // Instrument: counter - // Unit: s - // Stability: development - K8SPodCPUTimeName = "k8s.pod.cpu.time" - K8SPodCPUTimeUnit = "s" - K8SPodCPUTimeDescription = "Total CPU time consumed" - // K8SPodCPUUsage is the metric conforming to the "k8s.pod.cpu.usage" semantic - // conventions. It represents the pod's CPU usage, measured in cpus. Range from - // 0 to the number of allocatable CPUs. - // Instrument: gauge - // Unit: {cpu} - // Stability: development - K8SPodCPUUsageName = "k8s.pod.cpu.usage" - K8SPodCPUUsageUnit = "{cpu}" - K8SPodCPUUsageDescription = "Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" - // K8SPodMemoryUsage is the metric conforming to the "k8s.pod.memory.usage" - // semantic conventions. It represents the memory usage of the Pod. - // Instrument: gauge - // Unit: By - // Stability: development - K8SPodMemoryUsageName = "k8s.pod.memory.usage" - K8SPodMemoryUsageUnit = "By" - K8SPodMemoryUsageDescription = "Memory usage of the Pod" - // K8SPodNetworkErrors is the metric conforming to the "k8s.pod.network.errors" - // semantic conventions. It represents the pod network errors. - // Instrument: counter - // Unit: {error} - // Stability: development - K8SPodNetworkErrorsName = "k8s.pod.network.errors" - K8SPodNetworkErrorsUnit = "{error}" - K8SPodNetworkErrorsDescription = "Pod network errors" - // K8SPodNetworkIo is the metric conforming to the "k8s.pod.network.io" - // semantic conventions. It represents the network bytes for the Pod. - // Instrument: counter - // Unit: By - // Stability: development - K8SPodNetworkIoName = "k8s.pod.network.io" - K8SPodNetworkIoUnit = "By" - K8SPodNetworkIoDescription = "Network bytes for the Pod" - // K8SPodUptime is the metric conforming to the "k8s.pod.uptime" semantic - // conventions. It represents the time the Pod has been running. - // Instrument: gauge - // Unit: s - // Stability: development - K8SPodUptimeName = "k8s.pod.uptime" - K8SPodUptimeUnit = "s" - K8SPodUptimeDescription = "The time the Pod has been running" - // K8SReplicaSetAvailablePods is the metric conforming to the - // "k8s.replicaset.available_pods" semantic conventions. It represents the - // total number of available replica pods (ready for at least minReadySeconds) - // targeted by this replicaset. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SReplicaSetAvailablePodsName = "k8s.replicaset.available_pods" - K8SReplicaSetAvailablePodsUnit = "{pod}" - K8SReplicaSetAvailablePodsDescription = "Total number of available replica pods (ready for at least minReadySeconds) targeted by this replicaset" - // K8SReplicaSetDesiredPods is the metric conforming to the - // "k8s.replicaset.desired_pods" semantic conventions. It represents the number - // of desired replica pods in this replicaset. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SReplicaSetDesiredPodsName = "k8s.replicaset.desired_pods" - K8SReplicaSetDesiredPodsUnit = "{pod}" - K8SReplicaSetDesiredPodsDescription = "Number of desired replica pods in this replicaset" - // K8SReplicationControllerAvailablePods is the metric conforming to the - // "k8s.replication_controller.available_pods" semantic conventions. It - // represents the total number of available replica pods (ready for at least - // minReadySeconds) targeted by this replication controller. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SReplicationControllerAvailablePodsName = "k8s.replication_controller.available_pods" - K8SReplicationControllerAvailablePodsUnit = "{pod}" - K8SReplicationControllerAvailablePodsDescription = "Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller" - // K8SReplicationControllerDesiredPods is the metric conforming to the - // "k8s.replication_controller.desired_pods" semantic conventions. It - // represents the number of desired replica pods in this replication - // controller. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SReplicationControllerDesiredPodsName = "k8s.replication_controller.desired_pods" - K8SReplicationControllerDesiredPodsUnit = "{pod}" - K8SReplicationControllerDesiredPodsDescription = "Number of desired replica pods in this replication controller" - // K8SStatefulSetCurrentPods is the metric conforming to the - // "k8s.statefulset.current_pods" semantic conventions. It represents the - // number of replica pods created by the statefulset controller from the - // statefulset version indicated by currentRevision. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SStatefulSetCurrentPodsName = "k8s.statefulset.current_pods" - K8SStatefulSetCurrentPodsUnit = "{pod}" - K8SStatefulSetCurrentPodsDescription = "The number of replica pods created by the statefulset controller from the statefulset version indicated by currentRevision" - // K8SStatefulSetDesiredPods is the metric conforming to the - // "k8s.statefulset.desired_pods" semantic conventions. It represents the - // number of desired replica pods in this statefulset. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SStatefulSetDesiredPodsName = "k8s.statefulset.desired_pods" - K8SStatefulSetDesiredPodsUnit = "{pod}" - K8SStatefulSetDesiredPodsDescription = "Number of desired replica pods in this statefulset" - // K8SStatefulSetReadyPods is the metric conforming to the - // "k8s.statefulset.ready_pods" semantic conventions. It represents the number - // of replica pods created for this statefulset with a Ready Condition. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SStatefulSetReadyPodsName = "k8s.statefulset.ready_pods" - K8SStatefulSetReadyPodsUnit = "{pod}" - K8SStatefulSetReadyPodsDescription = "The number of replica pods created for this statefulset with a Ready Condition" - // K8SStatefulSetUpdatedPods is the metric conforming to the - // "k8s.statefulset.updated_pods" semantic conventions. It represents the - // number of replica pods created by the statefulset controller from the - // statefulset version indicated by updateRevision. - // Instrument: updowncounter - // Unit: {pod} - // Stability: development - K8SStatefulSetUpdatedPodsName = "k8s.statefulset.updated_pods" - K8SStatefulSetUpdatedPodsUnit = "{pod}" - K8SStatefulSetUpdatedPodsDescription = "Number of replica pods created by the statefulset controller from the statefulset version indicated by updateRevision" - // KestrelActiveConnections is the metric conforming to the - // "kestrel.active_connections" semantic conventions. It represents the number - // of connections that are currently active on the server. - // Instrument: updowncounter - // Unit: {connection} - // Stability: stable - KestrelActiveConnectionsName = "kestrel.active_connections" - KestrelActiveConnectionsUnit = "{connection}" - KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server." - // KestrelActiveTLSHandshakes is the metric conforming to the - // "kestrel.active_tls_handshakes" semantic conventions. It represents the - // number of TLS handshakes that are currently in progress on the server. - // Instrument: updowncounter - // Unit: {handshake} - // Stability: stable - KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes" - KestrelActiveTLSHandshakesUnit = "{handshake}" - KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server." - // KestrelConnectionDuration is the metric conforming to the - // "kestrel.connection.duration" semantic conventions. It represents the - // duration of connections on the server. - // Instrument: histogram - // Unit: s - // Stability: stable - KestrelConnectionDurationName = "kestrel.connection.duration" - KestrelConnectionDurationUnit = "s" - KestrelConnectionDurationDescription = "The duration of connections on the server." - // KestrelQueuedConnections is the metric conforming to the - // "kestrel.queued_connections" semantic conventions. It represents the number - // of connections that are currently queued and are waiting to start. - // Instrument: updowncounter - // Unit: {connection} - // Stability: stable - KestrelQueuedConnectionsName = "kestrel.queued_connections" - KestrelQueuedConnectionsUnit = "{connection}" - KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start." - // KestrelQueuedRequests is the metric conforming to the - // "kestrel.queued_requests" semantic conventions. It represents the number of - // HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are - // currently queued and are waiting to start. - // Instrument: updowncounter - // Unit: {request} - // Stability: stable - KestrelQueuedRequestsName = "kestrel.queued_requests" - KestrelQueuedRequestsUnit = "{request}" - KestrelQueuedRequestsDescription = "Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start." - // KestrelRejectedConnections is the metric conforming to the - // "kestrel.rejected_connections" semantic conventions. It represents the - // number of connections rejected by the server. - // Instrument: counter - // Unit: {connection} - // Stability: stable - KestrelRejectedConnectionsName = "kestrel.rejected_connections" - KestrelRejectedConnectionsUnit = "{connection}" - KestrelRejectedConnectionsDescription = "Number of connections rejected by the server." - // KestrelTLSHandshakeDuration is the metric conforming to the - // "kestrel.tls_handshake.duration" semantic conventions. It represents the - // duration of TLS handshakes on the server. - // Instrument: histogram - // Unit: s - // Stability: stable - KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration" - KestrelTLSHandshakeDurationUnit = "s" - KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server." - // KestrelUpgradedConnections is the metric conforming to the - // "kestrel.upgraded_connections" semantic conventions. It represents the - // number of connections that are currently upgraded (WebSockets). . - // Instrument: updowncounter - // Unit: {connection} - // Stability: stable - KestrelUpgradedConnectionsName = "kestrel.upgraded_connections" - KestrelUpgradedConnectionsUnit = "{connection}" - KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ." - // MessagingClientConsumedMessages is the metric conforming to the - // "messaging.client.consumed.messages" semantic conventions. It represents the - // number of messages that were delivered to the application. - // Instrument: counter - // Unit: {message} - // Stability: development - MessagingClientConsumedMessagesName = "messaging.client.consumed.messages" - MessagingClientConsumedMessagesUnit = "{message}" - MessagingClientConsumedMessagesDescription = "Number of messages that were delivered to the application." - // MessagingClientOperationDuration is the metric conforming to the - // "messaging.client.operation.duration" semantic conventions. It represents - // the duration of messaging operation initiated by a producer or consumer - // client. - // Instrument: histogram - // Unit: s - // Stability: development - MessagingClientOperationDurationName = "messaging.client.operation.duration" - MessagingClientOperationDurationUnit = "s" - MessagingClientOperationDurationDescription = "Duration of messaging operation initiated by a producer or consumer client." - // MessagingClientPublishedMessages is the metric conforming to the - // "messaging.client.published.messages" semantic conventions. It represents - // the deprecated. Use `messaging.client.sent.messages` instead. - // Instrument: counter - // Unit: {message} - // Stability: development - // Deprecated: Replaced by `messaging.client.sent.messages`. - MessagingClientPublishedMessagesName = "messaging.client.published.messages" - MessagingClientPublishedMessagesUnit = "{message}" - MessagingClientPublishedMessagesDescription = "Deprecated. Use `messaging.client.sent.messages` instead." - // MessagingClientSentMessages is the metric conforming to the - // "messaging.client.sent.messages" semantic conventions. It represents the - // number of messages producer attempted to send to the broker. - // Instrument: counter - // Unit: {message} - // Stability: development - MessagingClientSentMessagesName = "messaging.client.sent.messages" - MessagingClientSentMessagesUnit = "{message}" - MessagingClientSentMessagesDescription = "Number of messages producer attempted to send to the broker." - // MessagingProcessDuration is the metric conforming to the - // "messaging.process.duration" semantic conventions. It represents the - // duration of processing operation. - // Instrument: histogram - // Unit: s - // Stability: development - MessagingProcessDurationName = "messaging.process.duration" - MessagingProcessDurationUnit = "s" - MessagingProcessDurationDescription = "Duration of processing operation." - // MessagingProcessMessages is the metric conforming to the - // "messaging.process.messages" semantic conventions. It represents the - // deprecated. Use `messaging.client.consumed.messages` instead. - // Instrument: counter - // Unit: {message} - // Stability: development - // Deprecated: Replaced by `messaging.client.consumed.messages`. - MessagingProcessMessagesName = "messaging.process.messages" - MessagingProcessMessagesUnit = "{message}" - MessagingProcessMessagesDescription = "Deprecated. Use `messaging.client.consumed.messages` instead." - // MessagingPublishDuration is the metric conforming to the - // "messaging.publish.duration" semantic conventions. It represents the - // deprecated. Use `messaging.client.operation.duration` instead. - // Instrument: histogram - // Unit: s - // Stability: development - // Deprecated: Replaced by `messaging.client.operation.duration`. - MessagingPublishDurationName = "messaging.publish.duration" - MessagingPublishDurationUnit = "s" - MessagingPublishDurationDescription = "Deprecated. Use `messaging.client.operation.duration` instead." - // MessagingPublishMessages is the metric conforming to the - // "messaging.publish.messages" semantic conventions. It represents the - // deprecated. Use `messaging.client.produced.messages` instead. - // Instrument: counter - // Unit: {message} - // Stability: development - // Deprecated: Replaced by `messaging.client.produced.messages`. - MessagingPublishMessagesName = "messaging.publish.messages" - MessagingPublishMessagesUnit = "{message}" - MessagingPublishMessagesDescription = "Deprecated. Use `messaging.client.produced.messages` instead." - // MessagingReceiveDuration is the metric conforming to the - // "messaging.receive.duration" semantic conventions. It represents the - // deprecated. Use `messaging.client.operation.duration` instead. - // Instrument: histogram - // Unit: s - // Stability: development - // Deprecated: Replaced by `messaging.client.operation.duration`. - MessagingReceiveDurationName = "messaging.receive.duration" - MessagingReceiveDurationUnit = "s" - MessagingReceiveDurationDescription = "Deprecated. Use `messaging.client.operation.duration` instead." - // MessagingReceiveMessages is the metric conforming to the - // "messaging.receive.messages" semantic conventions. It represents the - // deprecated. Use `messaging.client.consumed.messages` instead. - // Instrument: counter - // Unit: {message} - // Stability: development - // Deprecated: Replaced by `messaging.client.consumed.messages`. - MessagingReceiveMessagesName = "messaging.receive.messages" - MessagingReceiveMessagesUnit = "{message}" - MessagingReceiveMessagesDescription = "Deprecated. Use `messaging.client.consumed.messages` instead." - // ProcessContextSwitches is the metric conforming to the - // "process.context_switches" semantic conventions. It represents the number of - // times the process has been context switched. - // Instrument: counter - // Unit: {count} - // Stability: development - ProcessContextSwitchesName = "process.context_switches" - ProcessContextSwitchesUnit = "{count}" - ProcessContextSwitchesDescription = "Number of times the process has been context switched." - // ProcessCPUTime is the metric conforming to the "process.cpu.time" semantic - // conventions. It represents the total CPU seconds broken down by different - // states. - // Instrument: counter - // Unit: s - // Stability: development - ProcessCPUTimeName = "process.cpu.time" - ProcessCPUTimeUnit = "s" - ProcessCPUTimeDescription = "Total CPU seconds broken down by different states." - // ProcessCPUUtilization is the metric conforming to the - // "process.cpu.utilization" semantic conventions. It represents the difference - // in process.cpu.time since the last measurement, divided by the elapsed time - // and number of CPUs available to the process. - // Instrument: gauge - // Unit: 1 - // Stability: development - ProcessCPUUtilizationName = "process.cpu.utilization" - ProcessCPUUtilizationUnit = "1" - ProcessCPUUtilizationDescription = "Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process." - // ProcessDiskIo is the metric conforming to the "process.disk.io" semantic - // conventions. It represents the disk bytes transferred. - // Instrument: counter - // Unit: By - // Stability: development - ProcessDiskIoName = "process.disk.io" - ProcessDiskIoUnit = "By" - ProcessDiskIoDescription = "Disk bytes transferred." - // ProcessMemoryUsage is the metric conforming to the "process.memory.usage" - // semantic conventions. It represents the amount of physical memory in use. - // Instrument: updowncounter - // Unit: By - // Stability: development - ProcessMemoryUsageName = "process.memory.usage" - ProcessMemoryUsageUnit = "By" - ProcessMemoryUsageDescription = "The amount of physical memory in use." - // ProcessMemoryVirtual is the metric conforming to the - // "process.memory.virtual" semantic conventions. It represents the amount of - // committed virtual memory. - // Instrument: updowncounter - // Unit: By - // Stability: development - ProcessMemoryVirtualName = "process.memory.virtual" - ProcessMemoryVirtualUnit = "By" - ProcessMemoryVirtualDescription = "The amount of committed virtual memory." - // ProcessNetworkIo is the metric conforming to the "process.network.io" - // semantic conventions. It represents the network bytes transferred. - // Instrument: counter - // Unit: By - // Stability: development - ProcessNetworkIoName = "process.network.io" - ProcessNetworkIoUnit = "By" - ProcessNetworkIoDescription = "Network bytes transferred." - // ProcessOpenFileDescriptorCount is the metric conforming to the - // "process.open_file_descriptor.count" semantic conventions. It represents the - // number of file descriptors in use by the process. - // Instrument: updowncounter - // Unit: {count} - // Stability: development - ProcessOpenFileDescriptorCountName = "process.open_file_descriptor.count" - ProcessOpenFileDescriptorCountUnit = "{count}" - ProcessOpenFileDescriptorCountDescription = "Number of file descriptors in use by the process." - // ProcessPagingFaults is the metric conforming to the "process.paging.faults" - // semantic conventions. It represents the number of page faults the process - // has made. - // Instrument: counter - // Unit: {fault} - // Stability: development - ProcessPagingFaultsName = "process.paging.faults" - ProcessPagingFaultsUnit = "{fault}" - ProcessPagingFaultsDescription = "Number of page faults the process has made." - // ProcessThreadCount is the metric conforming to the "process.thread.count" - // semantic conventions. It represents the process threads count. - // Instrument: updowncounter - // Unit: {thread} - // Stability: development - ProcessThreadCountName = "process.thread.count" - ProcessThreadCountUnit = "{thread}" - ProcessThreadCountDescription = "Process threads count." - // ProcessUptime is the metric conforming to the "process.uptime" semantic - // conventions. It represents the time the process has been running. - // Instrument: gauge - // Unit: s - // Stability: development - ProcessUptimeName = "process.uptime" - ProcessUptimeUnit = "s" - ProcessUptimeDescription = "The time the process has been running." - // RPCClientDuration is the metric conforming to the "rpc.client.duration" - // semantic conventions. It represents the measures the duration of outbound - // RPC. - // Instrument: histogram - // Unit: ms - // Stability: development - RPCClientDurationName = "rpc.client.duration" - RPCClientDurationUnit = "ms" - RPCClientDurationDescription = "Measures the duration of outbound RPC." - // RPCClientRequestSize is the metric conforming to the - // "rpc.client.request.size" semantic conventions. It represents the measures - // the size of RPC request messages (uncompressed). - // Instrument: histogram - // Unit: By - // Stability: development - RPCClientRequestSizeName = "rpc.client.request.size" - RPCClientRequestSizeUnit = "By" - RPCClientRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)." - // RPCClientRequestsPerRPC is the metric conforming to the - // "rpc.client.requests_per_rpc" semantic conventions. It represents the - // measures the number of messages received per RPC. - // Instrument: histogram - // Unit: {count} - // Stability: development - RPCClientRequestsPerRPCName = "rpc.client.requests_per_rpc" - RPCClientRequestsPerRPCUnit = "{count}" - RPCClientRequestsPerRPCDescription = "Measures the number of messages received per RPC." - // RPCClientResponseSize is the metric conforming to the - // "rpc.client.response.size" semantic conventions. It represents the measures - // the size of RPC response messages (uncompressed). - // Instrument: histogram - // Unit: By - // Stability: development - RPCClientResponseSizeName = "rpc.client.response.size" - RPCClientResponseSizeUnit = "By" - RPCClientResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)." - // RPCClientResponsesPerRPC is the metric conforming to the - // "rpc.client.responses_per_rpc" semantic conventions. It represents the - // measures the number of messages sent per RPC. - // Instrument: histogram - // Unit: {count} - // Stability: development - RPCClientResponsesPerRPCName = "rpc.client.responses_per_rpc" - RPCClientResponsesPerRPCUnit = "{count}" - RPCClientResponsesPerRPCDescription = "Measures the number of messages sent per RPC." - // RPCServerDuration is the metric conforming to the "rpc.server.duration" - // semantic conventions. It represents the measures the duration of inbound - // RPC. - // Instrument: histogram - // Unit: ms - // Stability: development - RPCServerDurationName = "rpc.server.duration" - RPCServerDurationUnit = "ms" - RPCServerDurationDescription = "Measures the duration of inbound RPC." - // RPCServerRequestSize is the metric conforming to the - // "rpc.server.request.size" semantic conventions. It represents the measures - // the size of RPC request messages (uncompressed). - // Instrument: histogram - // Unit: By - // Stability: development - RPCServerRequestSizeName = "rpc.server.request.size" - RPCServerRequestSizeUnit = "By" - RPCServerRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)." - // RPCServerRequestsPerRPC is the metric conforming to the - // "rpc.server.requests_per_rpc" semantic conventions. It represents the - // measures the number of messages received per RPC. - // Instrument: histogram - // Unit: {count} - // Stability: development - RPCServerRequestsPerRPCName = "rpc.server.requests_per_rpc" - RPCServerRequestsPerRPCUnit = "{count}" - RPCServerRequestsPerRPCDescription = "Measures the number of messages received per RPC." - // RPCServerResponseSize is the metric conforming to the - // "rpc.server.response.size" semantic conventions. It represents the measures - // the size of RPC response messages (uncompressed). - // Instrument: histogram - // Unit: By - // Stability: development - RPCServerResponseSizeName = "rpc.server.response.size" - RPCServerResponseSizeUnit = "By" - RPCServerResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)." - // RPCServerResponsesPerRPC is the metric conforming to the - // "rpc.server.responses_per_rpc" semantic conventions. It represents the - // measures the number of messages sent per RPC. - // Instrument: histogram - // Unit: {count} - // Stability: development - RPCServerResponsesPerRPCName = "rpc.server.responses_per_rpc" - RPCServerResponsesPerRPCUnit = "{count}" - RPCServerResponsesPerRPCDescription = "Measures the number of messages sent per RPC." - // SignalrServerActiveConnections is the metric conforming to the - // "signalr.server.active_connections" semantic conventions. It represents the - // number of connections that are currently active on the server. - // Instrument: updowncounter - // Unit: {connection} - // Stability: stable - SignalrServerActiveConnectionsName = "signalr.server.active_connections" - SignalrServerActiveConnectionsUnit = "{connection}" - SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server." - // SignalrServerConnectionDuration is the metric conforming to the - // "signalr.server.connection.duration" semantic conventions. It represents the - // duration of connections on the server. - // Instrument: histogram - // Unit: s - // Stability: stable - SignalrServerConnectionDurationName = "signalr.server.connection.duration" - SignalrServerConnectionDurationUnit = "s" - SignalrServerConnectionDurationDescription = "The duration of connections on the server." - // SystemCPUFrequency is the metric conforming to the "system.cpu.frequency" - // semantic conventions. It represents the reports the current frequency of the - // CPU in Hz. - // Instrument: gauge - // Unit: {Hz} - // Stability: development - SystemCPUFrequencyName = "system.cpu.frequency" - SystemCPUFrequencyUnit = "{Hz}" - SystemCPUFrequencyDescription = "Reports the current frequency of the CPU in Hz" - // SystemCPULogicalCount is the metric conforming to the - // "system.cpu.logical.count" semantic conventions. It represents the reports - // the number of logical (virtual) processor cores created by the operating - // system to manage multitasking. - // Instrument: updowncounter - // Unit: {cpu} - // Stability: development - SystemCPULogicalCountName = "system.cpu.logical.count" - SystemCPULogicalCountUnit = "{cpu}" - SystemCPULogicalCountDescription = "Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking" - // SystemCPUPhysicalCount is the metric conforming to the - // "system.cpu.physical.count" semantic conventions. It represents the reports - // the number of actual physical processor cores on the hardware. - // Instrument: updowncounter - // Unit: {cpu} - // Stability: development - SystemCPUPhysicalCountName = "system.cpu.physical.count" - SystemCPUPhysicalCountUnit = "{cpu}" - SystemCPUPhysicalCountDescription = "Reports the number of actual physical processor cores on the hardware" - // SystemCPUTime is the metric conforming to the "system.cpu.time" semantic - // conventions. It represents the seconds each logical CPU spent on each mode. - // Instrument: counter - // Unit: s - // Stability: development - SystemCPUTimeName = "system.cpu.time" - SystemCPUTimeUnit = "s" - SystemCPUTimeDescription = "Seconds each logical CPU spent on each mode" - // SystemCPUUtilization is the metric conforming to the - // "system.cpu.utilization" semantic conventions. It represents the difference - // in system.cpu.time since the last measurement, divided by the elapsed time - // and number of logical CPUs. - // Instrument: gauge - // Unit: 1 - // Stability: development - SystemCPUUtilizationName = "system.cpu.utilization" - SystemCPUUtilizationUnit = "1" - SystemCPUUtilizationDescription = "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs" - // SystemDiskIo is the metric conforming to the "system.disk.io" semantic - // conventions. - // Instrument: counter - // Unit: By - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemDiskIoName = "system.disk.io" - SystemDiskIoUnit = "By" - // SystemDiskIoTime is the metric conforming to the "system.disk.io_time" - // semantic conventions. It represents the time disk spent activated. - // Instrument: counter - // Unit: s - // Stability: development - SystemDiskIoTimeName = "system.disk.io_time" - SystemDiskIoTimeUnit = "s" - SystemDiskIoTimeDescription = "Time disk spent activated" - // SystemDiskLimit is the metric conforming to the "system.disk.limit" semantic - // conventions. It represents the total storage capacity of the disk. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemDiskLimitName = "system.disk.limit" - SystemDiskLimitUnit = "By" - SystemDiskLimitDescription = "The total storage capacity of the disk" - // SystemDiskMerged is the metric conforming to the "system.disk.merged" - // semantic conventions. - // Instrument: counter - // Unit: {operation} - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemDiskMergedName = "system.disk.merged" - SystemDiskMergedUnit = "{operation}" - // SystemDiskOperationTime is the metric conforming to the - // "system.disk.operation_time" semantic conventions. It represents the sum of - // the time each operation took to complete. - // Instrument: counter - // Unit: s - // Stability: development - SystemDiskOperationTimeName = "system.disk.operation_time" - SystemDiskOperationTimeUnit = "s" - SystemDiskOperationTimeDescription = "Sum of the time each operation took to complete" - // SystemDiskOperations is the metric conforming to the - // "system.disk.operations" semantic conventions. - // Instrument: counter - // Unit: {operation} - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemDiskOperationsName = "system.disk.operations" - SystemDiskOperationsUnit = "{operation}" - // SystemFilesystemLimit is the metric conforming to the - // "system.filesystem.limit" semantic conventions. It represents the total - // storage capacity of the filesystem. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemFilesystemLimitName = "system.filesystem.limit" - SystemFilesystemLimitUnit = "By" - SystemFilesystemLimitDescription = "The total storage capacity of the filesystem" - // SystemFilesystemUsage is the metric conforming to the - // "system.filesystem.usage" semantic conventions. It represents the reports a - // filesystem's space usage across different states. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemFilesystemUsageName = "system.filesystem.usage" - SystemFilesystemUsageUnit = "By" - SystemFilesystemUsageDescription = "Reports a filesystem's space usage across different states." - // SystemFilesystemUtilization is the metric conforming to the - // "system.filesystem.utilization" semantic conventions. - // Instrument: gauge - // Unit: 1 - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemFilesystemUtilizationName = "system.filesystem.utilization" - SystemFilesystemUtilizationUnit = "1" - // SystemLinuxMemoryAvailable is the metric conforming to the - // "system.linux.memory.available" semantic conventions. It represents an - // estimate of how much memory is available for starting new applications, - // without causing swapping. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemLinuxMemoryAvailableName = "system.linux.memory.available" - SystemLinuxMemoryAvailableUnit = "By" - SystemLinuxMemoryAvailableDescription = "An estimate of how much memory is available for starting new applications, without causing swapping" - // SystemLinuxMemorySlabUsage is the metric conforming to the - // "system.linux.memory.slab.usage" semantic conventions. It represents the - // reports the memory used by the Linux kernel for managing caches of - // frequently used objects. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemLinuxMemorySlabUsageName = "system.linux.memory.slab.usage" - SystemLinuxMemorySlabUsageUnit = "By" - SystemLinuxMemorySlabUsageDescription = "Reports the memory used by the Linux kernel for managing caches of frequently used objects." - // SystemMemoryLimit is the metric conforming to the "system.memory.limit" - // semantic conventions. It represents the total memory available in the - // system. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemMemoryLimitName = "system.memory.limit" - SystemMemoryLimitUnit = "By" - SystemMemoryLimitDescription = "Total memory available in the system." - // SystemMemoryShared is the metric conforming to the "system.memory.shared" - // semantic conventions. It represents the shared memory used (mostly by - // tmpfs). - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemMemorySharedName = "system.memory.shared" - SystemMemorySharedUnit = "By" - SystemMemorySharedDescription = "Shared memory used (mostly by tmpfs)." - // SystemMemoryUsage is the metric conforming to the "system.memory.usage" - // semantic conventions. It represents the reports memory in use by state. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemMemoryUsageName = "system.memory.usage" - SystemMemoryUsageUnit = "By" - SystemMemoryUsageDescription = "Reports memory in use by state." - // SystemMemoryUtilization is the metric conforming to the - // "system.memory.utilization" semantic conventions. - // Instrument: gauge - // Unit: 1 - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemMemoryUtilizationName = "system.memory.utilization" - SystemMemoryUtilizationUnit = "1" - // SystemNetworkConnections is the metric conforming to the - // "system.network.connections" semantic conventions. - // Instrument: updowncounter - // Unit: {connection} - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemNetworkConnectionsName = "system.network.connections" - SystemNetworkConnectionsUnit = "{connection}" - // SystemNetworkDropped is the metric conforming to the - // "system.network.dropped" semantic conventions. It represents the count of - // packets that are dropped or discarded even though there was no error. - // Instrument: counter - // Unit: {packet} - // Stability: development - SystemNetworkDroppedName = "system.network.dropped" - SystemNetworkDroppedUnit = "{packet}" - SystemNetworkDroppedDescription = "Count of packets that are dropped or discarded even though there was no error" - // SystemNetworkErrors is the metric conforming to the "system.network.errors" - // semantic conventions. It represents the count of network errors detected. - // Instrument: counter - // Unit: {error} - // Stability: development - SystemNetworkErrorsName = "system.network.errors" - SystemNetworkErrorsUnit = "{error}" - SystemNetworkErrorsDescription = "Count of network errors detected" - // SystemNetworkIo is the metric conforming to the "system.network.io" semantic - // conventions. - // Instrument: counter - // Unit: By - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemNetworkIoName = "system.network.io" - SystemNetworkIoUnit = "By" - // SystemNetworkPackets is the metric conforming to the - // "system.network.packets" semantic conventions. - // Instrument: counter - // Unit: {packet} - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemNetworkPacketsName = "system.network.packets" - SystemNetworkPacketsUnit = "{packet}" - // SystemPagingFaults is the metric conforming to the "system.paging.faults" - // semantic conventions. - // Instrument: counter - // Unit: {fault} - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemPagingFaultsName = "system.paging.faults" - SystemPagingFaultsUnit = "{fault}" - // SystemPagingOperations is the metric conforming to the - // "system.paging.operations" semantic conventions. - // Instrument: counter - // Unit: {operation} - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemPagingOperationsName = "system.paging.operations" - SystemPagingOperationsUnit = "{operation}" - // SystemPagingUsage is the metric conforming to the "system.paging.usage" - // semantic conventions. It represents the unix swap or windows pagefile usage. - // Instrument: updowncounter - // Unit: By - // Stability: development - SystemPagingUsageName = "system.paging.usage" - SystemPagingUsageUnit = "By" - SystemPagingUsageDescription = "Unix swap or windows pagefile usage" - // SystemPagingUtilization is the metric conforming to the - // "system.paging.utilization" semantic conventions. - // Instrument: gauge - // Unit: 1 - // Stability: development - // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository. - SystemPagingUtilizationName = "system.paging.utilization" - SystemPagingUtilizationUnit = "1" - // SystemProcessCount is the metric conforming to the "system.process.count" - // semantic conventions. It represents the total number of processes in each - // state. - // Instrument: updowncounter - // Unit: {process} - // Stability: development - SystemProcessCountName = "system.process.count" - SystemProcessCountUnit = "{process}" - SystemProcessCountDescription = "Total number of processes in each state" - // SystemProcessCreated is the metric conforming to the - // "system.process.created" semantic conventions. It represents the total - // number of processes created over uptime of the host. - // Instrument: counter - // Unit: {process} - // Stability: development - SystemProcessCreatedName = "system.process.created" - SystemProcessCreatedUnit = "{process}" - SystemProcessCreatedDescription = "Total number of processes created over uptime of the host" - // SystemUptime is the metric conforming to the "system.uptime" semantic - // conventions. It represents the time the system has been running. - // Instrument: gauge - // Unit: s - // Stability: development - SystemUptimeName = "system.uptime" - SystemUptimeUnit = "s" - SystemUptimeDescription = "The time the system has been running" - // VCSChangeCount is the metric conforming to the "vcs.change.count" semantic - // conventions. It represents the number of changes (pull requests/merge - // requests/changelists) in a repository, categorized by their state (e.g. open - // or merged). - // Instrument: updowncounter - // Unit: {change} - // Stability: development - VCSChangeCountName = "vcs.change.count" - VCSChangeCountUnit = "{change}" - VCSChangeCountDescription = "The number of changes (pull requests/merge requests/changelists) in a repository, categorized by their state (e.g. open or merged)" - // VCSChangeDuration is the metric conforming to the "vcs.change.duration" - // semantic conventions. It represents the time duration a change (pull - // request/merge request/changelist) has been in a given state. - // Instrument: gauge - // Unit: s - // Stability: development - VCSChangeDurationName = "vcs.change.duration" - VCSChangeDurationUnit = "s" - VCSChangeDurationDescription = "The time duration a change (pull request/merge request/changelist) has been in a given state." - // VCSChangeTimeToApproval is the metric conforming to the - // "vcs.change.time_to_approval" semantic conventions. It represents the amount - // of time since its creation it took a change (pull request/merge - // request/changelist) to get the first approval. - // Instrument: gauge - // Unit: s - // Stability: development - VCSChangeTimeToApprovalName = "vcs.change.time_to_approval" - VCSChangeTimeToApprovalUnit = "s" - VCSChangeTimeToApprovalDescription = "The amount of time since its creation it took a change (pull request/merge request/changelist) to get the first approval." - // VCSChangeTimeToMerge is the metric conforming to the - // "vcs.change.time_to_merge" semantic conventions. It represents the amount of - // time since its creation it took a change (pull request/merge - // request/changelist) to get merged into the target(base) ref. - // Instrument: gauge - // Unit: s - // Stability: development - VCSChangeTimeToMergeName = "vcs.change.time_to_merge" - VCSChangeTimeToMergeUnit = "s" - VCSChangeTimeToMergeDescription = "The amount of time since its creation it took a change (pull request/merge request/changelist) to get merged into the target(base) ref." - // VCSContributorCount is the metric conforming to the "vcs.contributor.count" - // semantic conventions. It represents the number of unique contributors to a - // repository. - // Instrument: gauge - // Unit: {contributor} - // Stability: development - VCSContributorCountName = "vcs.contributor.count" - VCSContributorCountUnit = "{contributor}" - VCSContributorCountDescription = "The number of unique contributors to a repository" - // VCSRefCount is the metric conforming to the "vcs.ref.count" semantic - // conventions. It represents the number of refs of type branch or tag in a - // repository. - // Instrument: updowncounter - // Unit: {ref} - // Stability: development - VCSRefCountName = "vcs.ref.count" - VCSRefCountUnit = "{ref}" - VCSRefCountDescription = "The number of refs of type branch or tag in a repository." - // VCSRefLinesDelta is the metric conforming to the "vcs.ref.lines_delta" - // semantic conventions. It represents the number of lines added/removed in a - // ref (branch) relative to the ref from the `vcs.ref.base.name` attribute. - // Instrument: gauge - // Unit: {line} - // Stability: development - VCSRefLinesDeltaName = "vcs.ref.lines_delta" - VCSRefLinesDeltaUnit = "{line}" - VCSRefLinesDeltaDescription = "The number of lines added/removed in a ref (branch) relative to the ref from the `vcs.ref.base.name` attribute." - // VCSRefRevisionsDelta is the metric conforming to the - // "vcs.ref.revisions_delta" semantic conventions. It represents the number of - // revisions (commits) a ref (branch) is ahead/behind the branch from the - // `vcs.ref.base.name` attribute. - // Instrument: gauge - // Unit: {revision} - // Stability: development - VCSRefRevisionsDeltaName = "vcs.ref.revisions_delta" - VCSRefRevisionsDeltaUnit = "{revision}" - VCSRefRevisionsDeltaDescription = "The number of revisions (commits) a ref (branch) is ahead/behind the branch from the `vcs.ref.base.name` attribute" - // VCSRefTime is the metric conforming to the "vcs.ref.time" semantic - // conventions. It represents the time a ref (branch) created from the default - // branch (trunk) has existed. The `ref.type` attribute will always be `branch` - // . - // Instrument: gauge - // Unit: s - // Stability: development - VCSRefTimeName = "vcs.ref.time" - VCSRefTimeUnit = "s" - VCSRefTimeDescription = "Time a ref (branch) created from the default branch (trunk) has existed. The `ref.type` attribute will always be `branch`" - // VCSRepositoryCount is the metric conforming to the "vcs.repository.count" - // semantic conventions. It represents the number of repositories in an - // organization. - // Instrument: updowncounter - // Unit: {repository} - // Stability: development - VCSRepositoryCountName = "vcs.repository.count" - VCSRepositoryCountUnit = "{repository}" - VCSRepositoryCountDescription = "The number of repositories in an organization." -) \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/schema.go deleted file mode 100644 index b2e7a515a..000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.30.0/schema.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.30.0" - -// SchemaURL is the schema URL that matches the version of the semantic conventions -// that this package defines. Semconv packages starting from v1.4.0 must declare -// non-empty schema URL in the form https://opentelemetry.io/schemas/ -const SchemaURL = "https://opentelemetry.io/schemas/1.30.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/httpconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/httpconv/metric.go new file mode 100644 index 000000000..79843adbb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/httpconv/metric.go @@ -0,0 +1,1418 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package httpconv provides types and functionality for OpenTelemetry semantic +// conventions in the "http" namespace. +package httpconv + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" +) + +var ( + addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }} + recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }} +) + +// ErrorTypeAttr is an attribute conforming to the error.type semantic +// conventions. It represents the describes a class of error the operation ended +// with. +type ErrorTypeAttr string + +var ( + // ErrorTypeOther is a fallback error value to be used when the instrumentation + // doesn't define a custom value. + ErrorTypeOther ErrorTypeAttr = "_OTHER" +) + +// ConnectionStateAttr is an attribute conforming to the http.connection.state +// semantic conventions. It represents the state of the HTTP connection in the +// HTTP connection pool. +type ConnectionStateAttr string + +var ( + // ConnectionStateActive is the active state. + ConnectionStateActive ConnectionStateAttr = "active" + // ConnectionStateIdle is the idle state. + ConnectionStateIdle ConnectionStateAttr = "idle" +) + +// RequestMethodAttr is an attribute conforming to the http.request.method +// semantic conventions. It represents the HTTP request method. +type RequestMethodAttr string + +var ( + // RequestMethodConnect is the CONNECT method. + RequestMethodConnect RequestMethodAttr = "CONNECT" + // RequestMethodDelete is the DELETE method. + RequestMethodDelete RequestMethodAttr = "DELETE" + // RequestMethodGet is the GET method. + RequestMethodGet RequestMethodAttr = "GET" + // RequestMethodHead is the HEAD method. + RequestMethodHead RequestMethodAttr = "HEAD" + // RequestMethodOptions is the OPTIONS method. + RequestMethodOptions RequestMethodAttr = "OPTIONS" + // RequestMethodPatch is the PATCH method. + RequestMethodPatch RequestMethodAttr = "PATCH" + // RequestMethodPost is the POST method. + RequestMethodPost RequestMethodAttr = "POST" + // RequestMethodPut is the PUT method. + RequestMethodPut RequestMethodAttr = "PUT" + // RequestMethodTrace is the TRACE method. + RequestMethodTrace RequestMethodAttr = "TRACE" + // RequestMethodOther is the any HTTP method that the instrumentation has no + // prior knowledge of. + RequestMethodOther RequestMethodAttr = "_OTHER" +) + +// UserAgentSyntheticTypeAttr is an attribute conforming to the +// user_agent.synthetic.type semantic conventions. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +type UserAgentSyntheticTypeAttr string + +var ( + // UserAgentSyntheticTypeBot is the bot source. + UserAgentSyntheticTypeBot UserAgentSyntheticTypeAttr = "bot" + // UserAgentSyntheticTypeTest is the synthetic test source. + UserAgentSyntheticTypeTest UserAgentSyntheticTypeAttr = "test" +) + +// ClientActiveRequests is an instrument used to record metric values conforming +// to the "http.client.active_requests" semantic conventions. It represents the +// number of active HTTP requests. +type ClientActiveRequests struct { + metric.Int64UpDownCounter +} + +// NewClientActiveRequests returns a new ClientActiveRequests instrument. +func NewClientActiveRequests( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (ClientActiveRequests, error) { + // Check if the meter is nil. + if m == nil { + return ClientActiveRequests{noop.Int64UpDownCounter{}}, nil + } + + i, err := m.Int64UpDownCounter( + "http.client.active_requests", + append([]metric.Int64UpDownCounterOption{ + metric.WithDescription("Number of active HTTP requests."), + metric.WithUnit("{request}"), + }, opt...)..., + ) + if err != nil { + return ClientActiveRequests{noop.Int64UpDownCounter{}}, err + } + return ClientActiveRequests{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientActiveRequests) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ClientActiveRequests) Name() string { + return "http.client.active_requests" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientActiveRequests) Unit() string { + return "{request}" +} + +// Description returns the semantic convention description of the instrument +func (ClientActiveRequests) Description() string { + return "Number of active HTTP requests." +} + +// Add adds incr to the existing count. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the port identifier of the ["URI origin"] HTTP request is +// sent to. +// +// All additional attrs passed are included in the recorded value. +// +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +func (m ClientActiveRequests) Add( + ctx context.Context, + incr int64, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + o := addOptPool.Get().(*[]metric.AddOption) + defer func() { + *o = (*o)[:0] + addOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientActiveRequests) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrRequestMethod returns an optional attribute for the "http.request.method" +// semantic convention. It represents the HTTP request method. +func (ClientActiveRequests) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue { + return attribute.String("http.request.method", string(val)) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientActiveRequests) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientConnectionDuration is an instrument used to record metric values +// conforming to the "http.client.connection.duration" semantic conventions. It +// represents the duration of the successfully established outbound HTTP +// connections. +type ClientConnectionDuration struct { + metric.Float64Histogram +} + +// NewClientConnectionDuration returns a new ClientConnectionDuration instrument. +func NewClientConnectionDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientConnectionDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientConnectionDuration{noop.Float64Histogram{}}, nil + } + + i, err := m.Float64Histogram( + "http.client.connection.duration", + append([]metric.Float64HistogramOption{ + metric.WithDescription("The duration of the successfully established outbound HTTP connections."), + metric.WithUnit("s"), + }, opt...)..., + ) + if err != nil { + return ClientConnectionDuration{noop.Float64Histogram{}}, err + } + return ClientConnectionDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientConnectionDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientConnectionDuration) Name() string { + return "http.client.connection.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientConnectionDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ClientConnectionDuration) Description() string { + return "The duration of the successfully established outbound HTTP connections." +} + +// Record records val to the current distribution. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the port identifier of the ["URI origin"] HTTP request is +// sent to. +// +// All additional attrs passed are included in the recorded value. +// +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +func (m ClientConnectionDuration) Record( + ctx context.Context, + val float64, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrNetworkPeerAddress returns an optional attribute for the +// "network.peer.address" semantic convention. It represents the peer address of +// the network connection - IP address or Unix domain socket name. +func (ClientConnectionDuration) AttrNetworkPeerAddress(val string) attribute.KeyValue { + return attribute.String("network.peer.address", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientConnectionDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientConnectionDuration) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientOpenConnections is an instrument used to record metric values conforming +// to the "http.client.open_connections" semantic conventions. It represents the +// number of outbound HTTP connections that are currently active or idle on the +// client. +type ClientOpenConnections struct { + metric.Int64UpDownCounter +} + +// NewClientOpenConnections returns a new ClientOpenConnections instrument. +func NewClientOpenConnections( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (ClientOpenConnections, error) { + // Check if the meter is nil. + if m == nil { + return ClientOpenConnections{noop.Int64UpDownCounter{}}, nil + } + + i, err := m.Int64UpDownCounter( + "http.client.open_connections", + append([]metric.Int64UpDownCounterOption{ + metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."), + metric.WithUnit("{connection}"), + }, opt...)..., + ) + if err != nil { + return ClientOpenConnections{noop.Int64UpDownCounter{}}, err + } + return ClientOpenConnections{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientOpenConnections) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ClientOpenConnections) Name() string { + return "http.client.open_connections" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientOpenConnections) Unit() string { + return "{connection}" +} + +// Description returns the semantic convention description of the instrument +func (ClientOpenConnections) Description() string { + return "Number of outbound HTTP connections that are currently active or idle on the client." +} + +// Add adds incr to the existing count. +// +// The connectionState is the state of the HTTP connection in the HTTP connection +// pool. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the port identifier of the ["URI origin"] HTTP request is +// sent to. +// +// All additional attrs passed are included in the recorded value. +// +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +func (m ClientOpenConnections) Add( + ctx context.Context, + incr int64, + connectionState ConnectionStateAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + o := addOptPool.Get().(*[]metric.AddOption) + defer func() { + *o = (*o)[:0] + addOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.connection.state", string(connectionState)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrNetworkPeerAddress returns an optional attribute for the +// "network.peer.address" semantic convention. It represents the peer address of +// the network connection - IP address or Unix domain socket name. +func (ClientOpenConnections) AttrNetworkPeerAddress(val string) attribute.KeyValue { + return attribute.String("network.peer.address", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientOpenConnections) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientOpenConnections) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientRequestBodySize is an instrument used to record metric values conforming +// to the "http.client.request.body.size" semantic conventions. It represents the +// size of HTTP client request bodies. +type ClientRequestBodySize struct { + metric.Int64Histogram +} + +// NewClientRequestBodySize returns a new ClientRequestBodySize instrument. +func NewClientRequestBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientRequestBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestBodySize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "http.client.request.body.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP client request bodies."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ClientRequestBodySize{noop.Int64Histogram{}}, err + } + return ClientRequestBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestBodySize) Name() string { + return "http.client.request.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestBodySize) Description() string { + return "Size of HTTP client request bodies." +} + +// Record records val to the current distribution. +// +// The requestMethod is the HTTP request method. +// +// The serverAddress is the host identifier of the ["URI origin"] HTTP request is +// sent to. +// +// The serverPort is the port identifier of the ["URI origin"] HTTP request is +// sent to. +// +// All additional attrs passed are included in the recorded value. +// +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +// +// The size of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ClientRequestBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ClientRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ClientRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientRequestBodySize) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientRequestBodySize) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientRequestDuration is an instrument used to record metric values conforming +// to the "http.client.request.duration" semantic conventions. It represents the +// duration of HTTP client requests. +type ClientRequestDuration struct { + metric.Float64Histogram +} + +// NewClientRequestDuration returns a new ClientRequestDuration instrument. +func NewClientRequestDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientRequestDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestDuration{noop.Float64Histogram{}}, nil + } + + i, err := m.Float64Histogram( + "http.client.request.duration", + append([]metric.Float64HistogramOption{ + metric.WithDescription("Duration of HTTP client requests."), + metric.WithUnit("s"), + }, opt...)..., + ) + if err != nil { + return ClientRequestDuration{noop.Float64Histogram{}}, err + } + return ClientRequestDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestDuration) Name() string { + return "http.client.request.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestDuration) Description() string { + return "Duration of HTTP client requests." +} + +// Record records val to the current distribution. +// +// The requestMethod is the HTTP request method. +// +// The serverAddress is the host identifier of the ["URI origin"] HTTP request is +// sent to. +// +// The serverPort is the port identifier of the ["URI origin"] HTTP request is +// sent to. +// +// All additional attrs passed are included in the recorded value. +// +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +func (m ClientRequestDuration) Record( + ctx context.Context, + val float64, + requestMethod RequestMethodAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ClientRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ClientRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientRequestDuration) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientRequestDuration) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// ClientResponseBodySize is an instrument used to record metric values +// conforming to the "http.client.response.body.size" semantic conventions. It +// represents the size of HTTP client response bodies. +type ClientResponseBodySize struct { + metric.Int64Histogram +} + +// NewClientResponseBodySize returns a new ClientResponseBodySize instrument. +func NewClientResponseBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientResponseBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ClientResponseBodySize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "http.client.response.body.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP client response bodies."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ClientResponseBodySize{noop.Int64Histogram{}}, err + } + return ClientResponseBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientResponseBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientResponseBodySize) Name() string { + return "http.client.response.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientResponseBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientResponseBodySize) Description() string { + return "Size of HTTP client response bodies." +} + +// Record records val to the current distribution. +// +// The requestMethod is the HTTP request method. +// +// The serverAddress is the host identifier of the ["URI origin"] HTTP request is +// sent to. +// +// The serverPort is the port identifier of the ["URI origin"] HTTP request is +// sent to. +// +// All additional attrs passed are included in the recorded value. +// +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin +// +// The size of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ClientResponseBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ClientResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ClientResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientResponseBodySize) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientResponseBodySize) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ServerActiveRequests is an instrument used to record metric values conforming +// to the "http.server.active_requests" semantic conventions. It represents the +// number of active HTTP server requests. +type ServerActiveRequests struct { + metric.Int64UpDownCounter +} + +// NewServerActiveRequests returns a new ServerActiveRequests instrument. +func NewServerActiveRequests( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (ServerActiveRequests, error) { + // Check if the meter is nil. + if m == nil { + return ServerActiveRequests{noop.Int64UpDownCounter{}}, nil + } + + i, err := m.Int64UpDownCounter( + "http.server.active_requests", + append([]metric.Int64UpDownCounterOption{ + metric.WithDescription("Number of active HTTP server requests."), + metric.WithUnit("{request}"), + }, opt...)..., + ) + if err != nil { + return ServerActiveRequests{noop.Int64UpDownCounter{}}, err + } + return ServerActiveRequests{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerActiveRequests) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ServerActiveRequests) Name() string { + return "http.server.active_requests" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerActiveRequests) Unit() string { + return "{request}" +} + +// Description returns the semantic convention description of the instrument +func (ServerActiveRequests) Description() string { + return "Number of active HTTP server requests." +} + +// Add adds incr to the existing count. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (m ServerActiveRequests) Add( + ctx context.Context, + incr int64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + o := addOptPool.Get().(*[]metric.AddOption) + defer func() { + *o = (*o)[:0] + addOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerActiveRequests) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerActiveRequests) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// ServerRequestBodySize is an instrument used to record metric values conforming +// to the "http.server.request.body.size" semantic conventions. It represents the +// size of HTTP server request bodies. +type ServerRequestBodySize struct { + metric.Int64Histogram +} + +// NewServerRequestBodySize returns a new ServerRequestBodySize instrument. +func NewServerRequestBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerRequestBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestBodySize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "http.server.request.body.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP server request bodies."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ServerRequestBodySize{noop.Int64Histogram{}}, err + } + return ServerRequestBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestBodySize) Name() string { + return "http.server.request.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestBodySize) Description() string { + return "Size of HTTP server request bodies." +} + +// Record records val to the current distribution. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +// +// The size of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ServerRequestBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ServerRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrRoute returns an optional attribute for the "http.route" semantic +// convention. It represents the matched route, that is, the path template in the +// format used by the respective server framework. +func (ServerRequestBodySize) AttrRoute(val string) attribute.KeyValue { + return attribute.String("http.route", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ServerRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ServerRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerRequestBodySize) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerRequestBodySize) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrUserAgentSyntheticType returns an optional attribute for the +// "user_agent.synthetic.type" semantic convention. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +func (ServerRequestBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { + return attribute.String("user_agent.synthetic.type", string(val)) +} + +// ServerRequestDuration is an instrument used to record metric values conforming +// to the "http.server.request.duration" semantic conventions. It represents the +// duration of HTTP server requests. +type ServerRequestDuration struct { + metric.Float64Histogram +} + +// NewServerRequestDuration returns a new ServerRequestDuration instrument. +func NewServerRequestDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ServerRequestDuration, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestDuration{noop.Float64Histogram{}}, nil + } + + i, err := m.Float64Histogram( + "http.server.request.duration", + append([]metric.Float64HistogramOption{ + metric.WithDescription("Duration of HTTP server requests."), + metric.WithUnit("s"), + }, opt...)..., + ) + if err != nil { + return ServerRequestDuration{noop.Float64Histogram{}}, err + } + return ServerRequestDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestDuration) Name() string { + return "http.server.request.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestDuration) Description() string { + return "Duration of HTTP server requests." +} + +// Record records val to the current distribution. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (m ServerRequestDuration) Record( + ctx context.Context, + val float64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ServerRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrRoute returns an optional attribute for the "http.route" semantic +// convention. It represents the matched route, that is, the path template in the +// format used by the respective server framework. +func (ServerRequestDuration) AttrRoute(val string) attribute.KeyValue { + return attribute.String("http.route", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ServerRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ServerRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerRequestDuration) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerRequestDuration) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrUserAgentSyntheticType returns an optional attribute for the +// "user_agent.synthetic.type" semantic convention. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +func (ServerRequestDuration) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { + return attribute.String("user_agent.synthetic.type", string(val)) +} + +// ServerResponseBodySize is an instrument used to record metric values +// conforming to the "http.server.response.body.size" semantic conventions. It +// represents the size of HTTP server response bodies. +type ServerResponseBodySize struct { + metric.Int64Histogram +} + +// NewServerResponseBodySize returns a new ServerResponseBodySize instrument. +func NewServerResponseBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerResponseBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ServerResponseBodySize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "http.server.response.body.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP server response bodies."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ServerResponseBodySize{noop.Int64Histogram{}}, err + } + return ServerResponseBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerResponseBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerResponseBodySize) Name() string { + return "http.server.response.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerResponseBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerResponseBodySize) Description() string { + return "Size of HTTP server response bodies." +} + +// Record records val to the current distribution. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +// +// The size of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ServerResponseBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append( + *o, + metric.WithAttributes( + append( + attrs, + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ServerResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrRoute returns an optional attribute for the "http.route" semantic +// convention. It represents the matched route, that is, the path template in the +// format used by the respective server framework. +func (ServerResponseBodySize) AttrRoute(val string) attribute.KeyValue { + return attribute.String("http.route", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ServerResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ServerResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerResponseBodySize) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerResponseBodySize) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrUserAgentSyntheticType returns an optional attribute for the +// "user_agent.synthetic.type" semantic convention. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +func (ServerResponseBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { + return attribute.String("user_agent.synthetic.type", string(val)) +} \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv/metric.go new file mode 100644 index 000000000..f6185bb69 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv/metric.go @@ -0,0 +1,713 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package httpconv provides types and functionality for OpenTelemetry semantic +// conventions in the "rpc" namespace. +package rpcconv + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" +) + +var ( + addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }} + recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }} +) + +// ClientDuration is an instrument used to record metric values conforming to the +// "rpc.client.duration" semantic conventions. It represents the measures the +// duration of outbound RPC. +type ClientDuration struct { + metric.Float64Histogram +} + +// NewClientDuration returns a new ClientDuration instrument. +func NewClientDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientDuration{noop.Float64Histogram{}}, nil + } + + i, err := m.Float64Histogram( + "rpc.client.duration", + append([]metric.Float64HistogramOption{ + metric.WithDescription("Measures the duration of outbound RPC."), + metric.WithUnit("ms"), + }, opt...)..., + ) + if err != nil { + return ClientDuration{noop.Float64Histogram{}}, err + } + return ClientDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientDuration) Name() string { + return "rpc.client.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientDuration) Unit() string { + return "ms" +} + +// Description returns the semantic convention description of the instrument +func (ClientDuration) Description() string { + return "Measures the duration of outbound RPC." +} + +// Record records val to the current distribution. +// +// While streaming RPCs may record this metric as start-of-batch +// to end-of-batch, it's hard to interpret in practice. +// +// **Streaming**: N/A. +func (m ClientDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// ClientRequestSize is an instrument used to record metric values conforming to +// the "rpc.client.request.size" semantic conventions. It represents the measures +// the size of RPC request messages (uncompressed). +type ClientRequestSize struct { + metric.Int64Histogram +} + +// NewClientRequestSize returns a new ClientRequestSize instrument. +func NewClientRequestSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientRequestSize, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestSize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.client.request.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC request messages (uncompressed)."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ClientRequestSize{noop.Int64Histogram{}}, err + } + return ClientRequestSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestSize) Name() string { + return "rpc.client.request.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestSize) Description() string { + return "Measures the size of RPC request messages (uncompressed)." +} + +// Record records val to the current distribution. +// +// **Streaming**: Recorded per message in a streaming batch +func (m ClientRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ClientRequestsPerRPC is an instrument used to record metric values conforming +// to the "rpc.client.requests_per_rpc" semantic conventions. It represents the +// measures the number of messages received per RPC. +type ClientRequestsPerRPC struct { + metric.Int64Histogram +} + +// NewClientRequestsPerRPC returns a new ClientRequestsPerRPC instrument. +func NewClientRequestsPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientRequestsPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestsPerRPC{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.client.requests_per_rpc", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages received per RPC."), + metric.WithUnit("{count}"), + }, opt...)..., + ) + if err != nil { + return ClientRequestsPerRPC{noop.Int64Histogram{}}, err + } + return ClientRequestsPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestsPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestsPerRPC) Name() string { + return "rpc.client.requests_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestsPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestsPerRPC) Description() string { + return "Measures the number of messages received per RPC." +} + +// Record records val to the current distribution. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ClientRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ClientResponseSize is an instrument used to record metric values conforming to +// the "rpc.client.response.size" semantic conventions. It represents the +// measures the size of RPC response messages (uncompressed). +type ClientResponseSize struct { + metric.Int64Histogram +} + +// NewClientResponseSize returns a new ClientResponseSize instrument. +func NewClientResponseSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientResponseSize, error) { + // Check if the meter is nil. + if m == nil { + return ClientResponseSize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.client.response.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC response messages (uncompressed)."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ClientResponseSize{noop.Int64Histogram{}}, err + } + return ClientResponseSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientResponseSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientResponseSize) Name() string { + return "rpc.client.response.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientResponseSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientResponseSize) Description() string { + return "Measures the size of RPC response messages (uncompressed)." +} + +// Record records val to the current distribution. +// +// **Streaming**: Recorded per response in a streaming batch +func (m ClientResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ClientResponsesPerRPC is an instrument used to record metric values conforming +// to the "rpc.client.responses_per_rpc" semantic conventions. It represents the +// measures the number of messages sent per RPC. +type ClientResponsesPerRPC struct { + metric.Int64Histogram +} + +// NewClientResponsesPerRPC returns a new ClientResponsesPerRPC instrument. +func NewClientResponsesPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientResponsesPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ClientResponsesPerRPC{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.client.responses_per_rpc", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages sent per RPC."), + metric.WithUnit("{count}"), + }, opt...)..., + ) + if err != nil { + return ClientResponsesPerRPC{noop.Int64Histogram{}}, err + } + return ClientResponsesPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientResponsesPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientResponsesPerRPC) Name() string { + return "rpc.client.responses_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientResponsesPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ClientResponsesPerRPC) Description() string { + return "Measures the number of messages sent per RPC." +} + +// Record records val to the current distribution. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ClientResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerDuration is an instrument used to record metric values conforming to the +// "rpc.server.duration" semantic conventions. It represents the measures the +// duration of inbound RPC. +type ServerDuration struct { + metric.Float64Histogram +} + +// NewServerDuration returns a new ServerDuration instrument. +func NewServerDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ServerDuration, error) { + // Check if the meter is nil. + if m == nil { + return ServerDuration{noop.Float64Histogram{}}, nil + } + + i, err := m.Float64Histogram( + "rpc.server.duration", + append([]metric.Float64HistogramOption{ + metric.WithDescription("Measures the duration of inbound RPC."), + metric.WithUnit("ms"), + }, opt...)..., + ) + if err != nil { + return ServerDuration{noop.Float64Histogram{}}, err + } + return ServerDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerDuration) Name() string { + return "rpc.server.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerDuration) Unit() string { + return "ms" +} + +// Description returns the semantic convention description of the instrument +func (ServerDuration) Description() string { + return "Measures the duration of inbound RPC." +} + +// Record records val to the current distribution. +// +// While streaming RPCs may record this metric as start-of-batch +// to end-of-batch, it's hard to interpret in practice. +// +// **Streaming**: N/A. +func (m ServerDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// ServerRequestSize is an instrument used to record metric values conforming to +// the "rpc.server.request.size" semantic conventions. It represents the measures +// the size of RPC request messages (uncompressed). +type ServerRequestSize struct { + metric.Int64Histogram +} + +// NewServerRequestSize returns a new ServerRequestSize instrument. +func NewServerRequestSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerRequestSize, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestSize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.server.request.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC request messages (uncompressed)."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ServerRequestSize{noop.Int64Histogram{}}, err + } + return ServerRequestSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestSize) Name() string { + return "rpc.server.request.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestSize) Description() string { + return "Measures the size of RPC request messages (uncompressed)." +} + +// Record records val to the current distribution. +// +// **Streaming**: Recorded per message in a streaming batch +func (m ServerRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerRequestsPerRPC is an instrument used to record metric values conforming +// to the "rpc.server.requests_per_rpc" semantic conventions. It represents the +// measures the number of messages received per RPC. +type ServerRequestsPerRPC struct { + metric.Int64Histogram +} + +// NewServerRequestsPerRPC returns a new ServerRequestsPerRPC instrument. +func NewServerRequestsPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerRequestsPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestsPerRPC{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.server.requests_per_rpc", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages received per RPC."), + metric.WithUnit("{count}"), + }, opt...)..., + ) + if err != nil { + return ServerRequestsPerRPC{noop.Int64Histogram{}}, err + } + return ServerRequestsPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestsPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestsPerRPC) Name() string { + return "rpc.server.requests_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestsPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestsPerRPC) Description() string { + return "Measures the number of messages received per RPC." +} + +// Record records val to the current distribution. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming** : This metric is required for server and client streaming RPCs +func (m ServerRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerResponseSize is an instrument used to record metric values conforming to +// the "rpc.server.response.size" semantic conventions. It represents the +// measures the size of RPC response messages (uncompressed). +type ServerResponseSize struct { + metric.Int64Histogram +} + +// NewServerResponseSize returns a new ServerResponseSize instrument. +func NewServerResponseSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerResponseSize, error) { + // Check if the meter is nil. + if m == nil { + return ServerResponseSize{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.server.response.size", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC response messages (uncompressed)."), + metric.WithUnit("By"), + }, opt...)..., + ) + if err != nil { + return ServerResponseSize{noop.Int64Histogram{}}, err + } + return ServerResponseSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerResponseSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerResponseSize) Name() string { + return "rpc.server.response.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerResponseSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerResponseSize) Description() string { + return "Measures the size of RPC response messages (uncompressed)." +} + +// Record records val to the current distribution. +// +// **Streaming**: Recorded per response in a streaming batch +func (m ServerResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerResponsesPerRPC is an instrument used to record metric values conforming +// to the "rpc.server.responses_per_rpc" semantic conventions. It represents the +// measures the number of messages sent per RPC. +type ServerResponsesPerRPC struct { + metric.Int64Histogram +} + +// NewServerResponsesPerRPC returns a new ServerResponsesPerRPC instrument. +func NewServerResponsesPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerResponsesPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ServerResponsesPerRPC{noop.Int64Histogram{}}, nil + } + + i, err := m.Int64Histogram( + "rpc.server.responses_per_rpc", + append([]metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages sent per RPC."), + metric.WithUnit("{count}"), + }, opt...)..., + ) + if err != nil { + return ServerResponsesPerRPC{noop.Int64Histogram{}}, err + } + return ServerResponsesPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerResponsesPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerResponsesPerRPC) Name() string { + return "rpc.server.responses_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerResponsesPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ServerResponsesPerRPC) Description() string { + return "Measures the number of messages sent per RPC." +} + +// Record records val to the current distribution. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ServerResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index d41b0c78b..912147a21 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -204,7 +204,7 @@ github.com/go-playground/universal-translator # github.com/go-playground/validator/v10 v10.20.0 ## explicit; go 1.18 github.com/go-playground/validator/v10 -# github.com/go-viper/mapstructure/v2 v2.2.1 +# github.com/go-viper/mapstructure/v2 v2.3.0 ## explicit; go 1.18 github.com/go-viper/mapstructure/v2 github.com/go-viper/mapstructure/v2/internal/errors @@ -327,7 +327,7 @@ github.com/knadh/koanf/maps # github.com/knadh/koanf/providers/confmap v1.0.0 ## explicit; go 1.23.0 github.com/knadh/koanf/providers/confmap -# github.com/knadh/koanf/v2 v2.2.0 +# github.com/knadh/koanf/v2 v2.2.1 ## explicit; go 1.23.0 github.com/knadh/koanf/v2 # github.com/leodido/go-urn v1.4.0 @@ -515,99 +515,103 @@ go.mongodb.org/mongo-driver/v2/x/bsonx/bsoncore ## explicit; go 1.22.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry -# go.opentelemetry.io/collector v0.128.0 +# go.opentelemetry.io/collector v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/internal/statusutil -# go.opentelemetry.io/collector/client v1.34.0 +# go.opentelemetry.io/collector/client v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/client # go.opentelemetry.io/collector/component v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/component -# go.opentelemetry.io/collector/config/configauth v0.128.0 +# go.opentelemetry.io/collector/config/configauth v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configauth -# go.opentelemetry.io/collector/config/configcompression v1.34.0 +# go.opentelemetry.io/collector/config/configcompression v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configcompression -# go.opentelemetry.io/collector/config/configgrpc v0.128.0 +# go.opentelemetry.io/collector/config/configgrpc v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configgrpc -# go.opentelemetry.io/collector/config/confighttp v0.128.0 +# go.opentelemetry.io/collector/config/confighttp v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/confighttp go.opentelemetry.io/collector/config/confighttp/internal -# go.opentelemetry.io/collector/config/configmiddleware v0.128.0 +# go.opentelemetry.io/collector/config/configmiddleware v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configmiddleware -# go.opentelemetry.io/collector/config/confignet v1.34.0 +# go.opentelemetry.io/collector/config/confignet v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/confignet # go.opentelemetry.io/collector/config/configopaque v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configopaque -# go.opentelemetry.io/collector/config/configretry v1.34.0 +# go.opentelemetry.io/collector/config/configoptional v0.130.1 +## explicit; go 1.23.0 +go.opentelemetry.io/collector/config/configoptional +# go.opentelemetry.io/collector/config/configretry v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configretry -# go.opentelemetry.io/collector/config/configtls v1.34.0 +# go.opentelemetry.io/collector/config/configtls v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/config/configtls -# go.opentelemetry.io/collector/confmap v1.34.0 +# go.opentelemetry.io/collector/confmap v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/confmap go.opentelemetry.io/collector/confmap/internal/mapstructure go.opentelemetry.io/collector/confmap/internal/third_party/composehook -# go.opentelemetry.io/collector/consumer v1.34.0 +# go.opentelemetry.io/collector/consumer v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/consumer go.opentelemetry.io/collector/consumer/internal -# go.opentelemetry.io/collector/consumer/consumererror v0.128.0 +# go.opentelemetry.io/collector/consumer/consumererror v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/consumer/consumererror go.opentelemetry.io/collector/consumer/consumererror/internal -# go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.128.0 +go.opentelemetry.io/collector/consumer/consumererror/internal/statusconversion +# go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/consumer/consumererror/xconsumererror -# go.opentelemetry.io/collector/consumer/xconsumer v0.128.0 +# go.opentelemetry.io/collector/consumer/xconsumer v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/consumer/xconsumer -# go.opentelemetry.io/collector/exporter v0.128.0 +# go.opentelemetry.io/collector/exporter v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/exporter go.opentelemetry.io/collector/exporter/exporterhelper go.opentelemetry.io/collector/exporter/exporterhelper/internal go.opentelemetry.io/collector/exporter/exporterhelper/internal/experr go.opentelemetry.io/collector/exporter/exporterhelper/internal/metadata +go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch -go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue go.opentelemetry.io/collector/exporter/exporterhelper/internal/request go.opentelemetry.io/collector/exporter/exporterhelper/internal/sender go.opentelemetry.io/collector/exporter/exporterhelper/internal/sizer go.opentelemetry.io/collector/exporter/internal/experr -# go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.128.0 +# go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper -# go.opentelemetry.io/collector/exporter/otlpexporter v0.128.0 +# go.opentelemetry.io/collector/exporter/otlpexporter v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/exporter/otlpexporter go.opentelemetry.io/collector/exporter/otlpexporter/internal/metadata -# go.opentelemetry.io/collector/exporter/otlphttpexporter v0.128.0 +# go.opentelemetry.io/collector/exporter/otlphttpexporter v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/exporter/otlphttpexporter go.opentelemetry.io/collector/exporter/otlphttpexporter/internal/metadata -# go.opentelemetry.io/collector/exporter/xexporter v0.128.0 +# go.opentelemetry.io/collector/exporter/xexporter v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/exporter/xexporter -# go.opentelemetry.io/collector/extension v1.34.0 +# go.opentelemetry.io/collector/extension v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/extension -# go.opentelemetry.io/collector/extension/extensionauth v1.34.0 +# go.opentelemetry.io/collector/extension/extensionauth v1.36.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/extension/extensionauth -# go.opentelemetry.io/collector/extension/extensionmiddleware v0.128.0 +# go.opentelemetry.io/collector/extension/extensionmiddleware v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/extension/extensionmiddleware -# go.opentelemetry.io/collector/extension/xextension v0.128.0 +# go.opentelemetry.io/collector/extension/xextension v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/extension/xextension/storage # go.opentelemetry.io/collector/featuregate v1.36.1 @@ -640,15 +644,19 @@ go.opentelemetry.io/collector/pdata/pmetric go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp go.opentelemetry.io/collector/pdata/ptrace go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp -# go.opentelemetry.io/collector/pdata/pprofile v0.128.0 +# go.opentelemetry.io/collector/pdata/pprofile v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/pdata/pprofile go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp +# go.opentelemetry.io/collector/pdata/xpdata v0.130.1 +## explicit; go 1.23.0 +go.opentelemetry.io/collector/pdata/xpdata/request +go.opentelemetry.io/collector/pdata/xpdata/request/internal # go.opentelemetry.io/collector/pipeline v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/pipeline go.opentelemetry.io/collector/pipeline/internal/globalsignal -# go.opentelemetry.io/collector/pipeline/xpipeline v0.128.0 +# go.opentelemetry.io/collector/pipeline/xpipeline v0.130.1 ## explicit; go 1.23.0 go.opentelemetry.io/collector/pipeline/xpipeline # go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 @@ -666,11 +674,11 @@ go.opentelemetry.io/contrib/detectors/azure/azurevm # go.opentelemetry.io/contrib/detectors/gcp v1.35.0 ## explicit; go 1.22.0 go.opentelemetry.io/contrib/detectors/gcp -# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 +# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 ## explicit; go 1.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal -# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 +# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 ## explicit; go 1.23.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request @@ -691,8 +699,9 @@ go.opentelemetry.io/otel/semconv/v1.19.0 go.opentelemetry.io/otel/semconv/v1.20.0 go.opentelemetry.io/otel/semconv/v1.25.0 go.opentelemetry.io/otel/semconv/v1.26.0 -go.opentelemetry.io/otel/semconv/v1.30.0 go.opentelemetry.io/otel/semconv/v1.34.0 +go.opentelemetry.io/otel/semconv/v1.34.0/httpconv +go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv # go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 ## explicit; go 1.22.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc @@ -857,7 +866,7 @@ gomodules.xyz/jsonpatch/v2 # google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 ## explicit; go 1.23.0 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 ## explicit; go 1.23.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status @@ -1522,4 +1531,3 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.22 sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 -sigs.k8s.io/yaml/goyaml.v3 diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v3/README.md b/vendor/sigs.k8s.io/yaml/goyaml.v3/README.md deleted file mode 100644 index 318a00923..000000000 --- a/vendor/sigs.k8s.io/yaml/goyaml.v3/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# goyaml.v3 - -This package provides type and function aliases for the `go.yaml.in/yaml/v3` package (which is compatible with `gopkg.in/yaml.v3`). - -## Purpose - -The purpose of this package is to: - -1. Provide a transition path for users migrating from the sigs.k8s.io/yaml package to direct usage of go.yaml.in/yaml/v3 -2. Maintain compatibility with existing code while encouraging migration to the upstream package -3. Reduce maintenance overhead by delegating to the upstream implementation - -## Usage - -Instead of importing this package directly, you should migrate to using `go.yaml.in/yaml/v3` directly: - -```go -// Old way -import "sigs.k8s.io/yaml/goyaml.v3" - -// Recommended way -import "go.yaml.in/yaml/v3" -``` - -## Available Types and Functions - -All public types and functions from `go.yaml.in/yaml/v3` are available through this package: - -### Types - -- `Unmarshaler` - Interface for custom unmarshaling behavior -- `Marshaler` - Interface for custom marshaling behavior -- `IsZeroer` - Interface to check if an object is zero -- `Decoder` - Reads and decodes YAML values from an input stream -- `Encoder` - Writes YAML values to an output stream -- `TypeError` - Error returned by Unmarshal for decoding issues -- `Node` - Represents a YAML node in the document -- `Kind` - Represents the kind of a YAML node -- `Style` - Represents the style of a YAML node - -### Functions - -- `Unmarshal` - Decodes YAML data into a Go value -- `Marshal` - Serializes a Go value into YAML -- `NewDecoder` - Creates a new Decoder -- `NewEncoder` - Creates a new Encoder - -## Migration Guide - -To migrate from this package to `go.yaml.in/yaml/v3`: - -1. Update your import statements: - ```go - // From - import "sigs.k8s.io/yaml/goyaml.v3" - - // To - import "go.yaml.in/yaml/v3" - ``` - -2. No code changes should be necessary as the API is identical - -3. Update your go.mod file to include the dependency: - ``` - require go.yaml.in/yaml/v3 v3.0.3 - ``` - -## Deprecation Notice - -All types and functions in this package are marked as deprecated. You should migrate to using `go.yaml.in/yaml/v3` directly. diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v3/yaml_aliases.go b/vendor/sigs.k8s.io/yaml/goyaml.v3/yaml_aliases.go deleted file mode 100644 index 8826ffefe..000000000 --- a/vendor/sigs.k8s.io/yaml/goyaml.v3/yaml_aliases.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package yaml - -import ( - gopkg_yaml "go.yaml.in/yaml/v3" -) - -// Type aliases for public types from go.yaml.in/yaml/v3 -type ( - // Unmarshaler is implemented by types to customize their behavior when being unmarshaled from a YAML document. - // Deprecated: Use go.yaml.in/yaml/v3.Unmarshaler directly. - Unmarshaler = gopkg_yaml.Unmarshaler - - // Marshaler is implemented by types to customize their behavior when being marshaled into a YAML document. - // Deprecated: Use go.yaml.in/yaml/v3.Marshaler directly. - Marshaler = gopkg_yaml.Marshaler - - // IsZeroer is used to check whether an object is zero to determine whether it should be omitted when - // marshaling with the omitempty flag. One notable implementation is time.Time. - // Deprecated: Use go.yaml.in/yaml/v3.IsZeroer directly. - IsZeroer = gopkg_yaml.IsZeroer - - // Decoder reads and decodes YAML values from an input stream. - // Deprecated: Use go.yaml.in/yaml/v3.Decoder directly. - Decoder = gopkg_yaml.Decoder - - // Encoder writes YAML values to an output stream. - // Deprecated: Use go.yaml.in/yaml/v3.Encoder directly. - Encoder = gopkg_yaml.Encoder - - // TypeError is returned by Unmarshal when one or more fields in the YAML document cannot be properly decoded. - // Deprecated: Use go.yaml.in/yaml/v3.TypeError directly. - TypeError = gopkg_yaml.TypeError - - // Node represents a YAML node in the document. - // Deprecated: Use go.yaml.in/yaml/v3.Node directly. - Node = gopkg_yaml.Node - - // Kind represents the kind of a YAML node. - // Deprecated: Use go.yaml.in/yaml/v3.Kind directly. - Kind = gopkg_yaml.Kind - - // Style represents the style of a YAML node. - // Deprecated: Use go.yaml.in/yaml/v3.Style directly. - Style = gopkg_yaml.Style -) - -// Constants for Kind type from go.yaml.in/yaml/v3 -const ( - // DocumentNode represents a YAML document node. - // Deprecated: Use go.yaml.in/yaml/v3.DocumentNode directly. - DocumentNode = gopkg_yaml.DocumentNode - - // SequenceNode represents a YAML sequence node. - // Deprecated: Use go.yaml.in/yaml/v3.SequenceNode directly. - SequenceNode = gopkg_yaml.SequenceNode - - // MappingNode represents a YAML mapping node. - // Deprecated: Use go.yaml.in/yaml/v3.MappingNode directly. - MappingNode = gopkg_yaml.MappingNode - - // ScalarNode represents a YAML scalar node. - // Deprecated: Use go.yaml.in/yaml/v3.ScalarNode directly. - ScalarNode = gopkg_yaml.ScalarNode - - // AliasNode represents a YAML alias node. - // Deprecated: Use go.yaml.in/yaml/v3.AliasNode directly. - AliasNode = gopkg_yaml.AliasNode -) - -// Constants for Style type from go.yaml.in/yaml/v3 -const ( - // TaggedStyle represents a tagged YAML style. - // Deprecated: Use go.yaml.in/yaml/v3.TaggedStyle directly. - TaggedStyle = gopkg_yaml.TaggedStyle - - // DoubleQuotedStyle represents a double-quoted YAML style. - // Deprecated: Use go.yaml.in/yaml/v3.DoubleQuotedStyle directly. - DoubleQuotedStyle = gopkg_yaml.DoubleQuotedStyle - - // SingleQuotedStyle represents a single-quoted YAML style. - // Deprecated: Use go.yaml.in/yaml/v3.SingleQuotedStyle directly. - SingleQuotedStyle = gopkg_yaml.SingleQuotedStyle - - // LiteralStyle represents a literal YAML style. - // Deprecated: Use go.yaml.in/yaml/v3.LiteralStyle directly. - LiteralStyle = gopkg_yaml.LiteralStyle - - // FoldedStyle represents a folded YAML style. - // Deprecated: Use go.yaml.in/yaml/v3.FoldedStyle directly. - FoldedStyle = gopkg_yaml.FoldedStyle - - // FlowStyle represents a flow YAML style. - // Deprecated: Use go.yaml.in/yaml/v3.FlowStyle directly. - FlowStyle = gopkg_yaml.FlowStyle -) - -// Function aliases for public functions from go.yaml.in/yaml/v3 -var ( - // Unmarshal decodes the first document found within the in byte slice and assigns decoded values into the out value. - // Deprecated: Use go.yaml.in/yaml/v3.Unmarshal directly. - Unmarshal = gopkg_yaml.Unmarshal - - // Marshal serializes the value provided into a YAML document. - // Deprecated: Use go.yaml.in/yaml/v3.Marshal directly. - Marshal = gopkg_yaml.Marshal - - // NewDecoder returns a new decoder that reads from r. - // Deprecated: Use go.yaml.in/yaml/v3.NewDecoder directly. - NewDecoder = gopkg_yaml.NewDecoder - - // NewEncoder returns a new encoder that writes to w. - // Deprecated: Use go.yaml.in/yaml/v3.NewEncoder directly. - NewEncoder = gopkg_yaml.NewEncoder -)