profiles.proto 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // Copyright 2023, OpenTelemetry Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package opentelemetry.proto.profiles.v1experimental;
  16. import "opentelemetry/proto/common/v1/common.proto";
  17. import "opentelemetry/proto/resource/v1/resource.proto";
  18. import "opentelemetry/proto/profiles/v1experimental/pprofextended.proto";
  19. option csharp_namespace = "OpenTelemetry.Proto.Profiles.V1Experimental";
  20. option java_multiple_files = true;
  21. option java_package = "io.opentelemetry.proto.profiles.v1experimental";
  22. option java_outer_classname = "ProfilesProto";
  23. option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1experimental";
  24. // Relationships Diagram
  25. //
  26. // ┌──────────────────┐ LEGEND
  27. // │ ProfilesData │
  28. // └──────────────────┘ ─────▶ embedded
  29. // │
  30. // │ 1-n ─────▷ referenced by index
  31. // ▼
  32. // ┌──────────────────┐
  33. // │ ResourceProfiles │
  34. // └──────────────────┘
  35. // │
  36. // │ 1-n
  37. // ▼
  38. // ┌──────────────────┐
  39. // │ ScopeProfiles │
  40. // └──────────────────┘
  41. // │
  42. // │ 1-n
  43. // ▼
  44. // ┌──────────────────┐
  45. // │ ProfileContainer │
  46. // └──────────────────┘
  47. // │
  48. // │ 1-1
  49. // ▼
  50. // ┌──────────────────┐
  51. // │ Profile │
  52. // └──────────────────┘
  53. // │ n-1
  54. // │ 1-n ┌───────────────────────────────────────┐
  55. // ▼ │ ▽
  56. // ┌──────────────────┐ 1-n ┌──────────────┐ ┌──────────┐
  57. // │ Sample │ ──────▷ │ KeyValue │ │ Link │
  58. // └──────────────────┘ └──────────────┘ └──────────┘
  59. // │ 1-n △ △
  60. // │ 1-n ┌─────────────────┘ │ 1-n
  61. // ▽ │ │
  62. // ┌──────────────────┐ n-1 ┌──────────────┐
  63. // │ Location │ ──────▷ │ Mapping │
  64. // └──────────────────┘ └──────────────┘
  65. // │
  66. // │ 1-n
  67. // ▼
  68. // ┌──────────────────┐
  69. // │ Line │
  70. // └──────────────────┘
  71. // │
  72. // │ 1-1
  73. // ▽
  74. // ┌──────────────────┐
  75. // │ Function │
  76. // └──────────────────┘
  77. //
  78. // ProfilesData represents the profiles data that can be stored in persistent storage,
  79. // OR can be embedded by other protocols that transfer OTLP profiles data but do not
  80. // implement the OTLP protocol.
  81. //
  82. // The main difference between this message and collector protocol is that
  83. // in this message there will not be any "control" or "metadata" specific to
  84. // OTLP protocol.
  85. //
  86. // When new fields are added into this message, the OTLP request MUST be updated
  87. // as well.
  88. message ProfilesData {
  89. // An array of ResourceProfiles.
  90. // For data coming from a single resource this array will typically contain
  91. // one element. Intermediary nodes that receive data from multiple origins
  92. // typically batch the data before forwarding further and in that case this
  93. // array will contain multiple elements.
  94. repeated ResourceProfiles resource_profiles = 1;
  95. }
  96. // A collection of ScopeProfiles from a Resource.
  97. message ResourceProfiles {
  98. reserved 1000;
  99. // The resource for the profiles in this message.
  100. // If this field is not set then no resource info is known.
  101. opentelemetry.proto.resource.v1.Resource resource = 1;
  102. // A list of ScopeProfiles that originate from a resource.
  103. repeated ScopeProfiles scope_profiles = 2;
  104. // The Schema URL, if known. This is the identifier of the Schema that the resource data
  105. // is recorded in. To learn more about Schema URL see
  106. // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
  107. // This schema_url applies to the data in the "resource" field. It does not apply
  108. // to the data in the "scope_profiles" field which have their own schema_url field.
  109. string schema_url = 3;
  110. }
  111. // A collection of ProfileContainers produced by an InstrumentationScope.
  112. message ScopeProfiles {
  113. // The instrumentation scope information for the profiles in this message.
  114. // Semantically when InstrumentationScope isn't set, it is equivalent with
  115. // an empty instrumentation scope name (unknown).
  116. opentelemetry.proto.common.v1.InstrumentationScope scope = 1;
  117. // A list of ProfileContainers that originate from an instrumentation scope.
  118. repeated ProfileContainer profiles = 2;
  119. // The Schema URL, if known. This is the identifier of the Schema that the metric data
  120. // is recorded in. To learn more about Schema URL see
  121. // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
  122. // This schema_url applies to all profiles in the "profiles" field.
  123. string schema_url = 3;
  124. }
  125. // A ProfileContainer represents a single profile. It wraps pprof profile with OpenTelemetry specific metadata.
  126. message ProfileContainer {
  127. // A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
  128. // all zeroes is considered invalid.
  129. //
  130. // This field is required.
  131. bytes profile_id = 1;
  132. // start_time_unix_nano is the start time of the profile.
  133. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
  134. //
  135. // This field is semantically required and it is expected that end_time >= start_time.
  136. fixed64 start_time_unix_nano = 2;
  137. // end_time_unix_nano is the end time of the profile.
  138. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
  139. //
  140. // This field is semantically required and it is expected that end_time >= start_time.
  141. fixed64 end_time_unix_nano = 3;
  142. // attributes is a collection of key/value pairs. Note, global attributes
  143. // like server name can be set using the resource API. Examples of attributes:
  144. //
  145. // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
  146. // "/http/server_latency": 300
  147. // "abc.com/myattribute": true
  148. // "abc.com/score": 10.239
  149. //
  150. // The OpenTelemetry API specification further restricts the allowed value types:
  151. // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
  152. // Attribute keys MUST be unique (it is not allowed to have more than one
  153. // attribute with the same key).
  154. repeated opentelemetry.proto.common.v1.KeyValue attributes = 4;
  155. // dropped_attributes_count is the number of attributes that were discarded. Attributes
  156. // can be discarded because their keys are too long or because there are too many
  157. // attributes. If this value is 0, then no attributes were dropped.
  158. uint32 dropped_attributes_count = 5;
  159. // Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
  160. string original_payload_format = 6;
  161. // Original payload can be stored in this field. This can be useful for users who want to get the original payload.
  162. // Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
  163. // Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
  164. // If the original payload is in pprof format, it SHOULD not be included in this field.
  165. // The field is optional, however if it is present `profile` MUST be present and contain the same profiling information.
  166. bytes original_payload = 7;
  167. // This is a reference to a pprof profile. Required, even when original_payload is present.
  168. opentelemetry.proto.profiles.v1experimental.Profile profile = 8;
  169. }