embedded.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. // Copyright The 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. // Package embedded provides interfaces embedded within the [OpenTelemetry
  15. // metric API].
  16. //
  17. // Implementers of the [OpenTelemetry metric API] can embed the relevant type
  18. // from this package into their implementation directly. Doing so will result
  19. // in a compilation error for users when the [OpenTelemetry metric API] is
  20. // extended (which is something that can happen without a major version bump of
  21. // the API package).
  22. //
  23. // [OpenTelemetry metric API]: https://pkg.go.dev/go.opentelemetry.io/otel/metric
  24. package embedded // import "go.opentelemetry.io/otel/metric/embedded"
  25. // MeterProvider is embedded in
  26. // [go.opentelemetry.io/otel/metric.MeterProvider].
  27. //
  28. // Embed this interface in your implementation of the
  29. // [go.opentelemetry.io/otel/metric.MeterProvider] if you want users to
  30. // experience a compilation error, signaling they need to update to your latest
  31. // implementation, when the [go.opentelemetry.io/otel/metric.MeterProvider]
  32. // interface is extended (which is something that can happen without a major
  33. // version bump of the API package).
  34. type MeterProvider interface{ meterProvider() }
  35. // Meter is embedded in [go.opentelemetry.io/otel/metric.Meter].
  36. //
  37. // Embed this interface in your implementation of the
  38. // [go.opentelemetry.io/otel/metric.Meter] if you want users to experience a
  39. // compilation error, signaling they need to update to your latest
  40. // implementation, when the [go.opentelemetry.io/otel/metric.Meter] interface
  41. // is extended (which is something that can happen without a major version bump
  42. // of the API package).
  43. type Meter interface{ meter() }
  44. // Float64Observer is embedded in
  45. // [go.opentelemetry.io/otel/metric.Float64Observer].
  46. //
  47. // Embed this interface in your implementation of the
  48. // [go.opentelemetry.io/otel/metric.Float64Observer] if you want
  49. // users to experience a compilation error, signaling they need to update to
  50. // your latest implementation, when the
  51. // [go.opentelemetry.io/otel/metric.Float64Observer] interface is
  52. // extended (which is something that can happen without a major version bump of
  53. // the API package).
  54. type Float64Observer interface{ float64Observer() }
  55. // Int64Observer is embedded in
  56. // [go.opentelemetry.io/otel/metric.Int64Observer].
  57. //
  58. // Embed this interface in your implementation of the
  59. // [go.opentelemetry.io/otel/metric.Int64Observer] if you want users
  60. // to experience a compilation error, signaling they need to update to your
  61. // latest implementation, when the
  62. // [go.opentelemetry.io/otel/metric.Int64Observer] interface is
  63. // extended (which is something that can happen without a major version bump of
  64. // the API package).
  65. type Int64Observer interface{ int64Observer() }
  66. // Observer is embedded in [go.opentelemetry.io/otel/metric.Observer].
  67. //
  68. // Embed this interface in your implementation of the
  69. // [go.opentelemetry.io/otel/metric.Observer] if you want users to experience a
  70. // compilation error, signaling they need to update to your latest
  71. // implementation, when the [go.opentelemetry.io/otel/metric.Observer]
  72. // interface is extended (which is something that can happen without a major
  73. // version bump of the API package).
  74. type Observer interface{ observer() }
  75. // Registration is embedded in [go.opentelemetry.io/otel/metric.Registration].
  76. //
  77. // Embed this interface in your implementation of the
  78. // [go.opentelemetry.io/otel/metric.Registration] if you want users to
  79. // experience a compilation error, signaling they need to update to your latest
  80. // implementation, when the [go.opentelemetry.io/otel/metric.Registration]
  81. // interface is extended (which is something that can happen without a major
  82. // version bump of the API package).
  83. type Registration interface{ registration() }
  84. // Float64Counter is embedded in
  85. // [go.opentelemetry.io/otel/metric.Float64Counter].
  86. //
  87. // Embed this interface in your implementation of the
  88. // [go.opentelemetry.io/otel/metric.Float64Counter] if you want
  89. // users to experience a compilation error, signaling they need to update to
  90. // your latest implementation, when the
  91. // [go.opentelemetry.io/otel/metric.Float64Counter] interface is
  92. // extended (which is something that can happen without a major version bump of
  93. // the API package).
  94. type Float64Counter interface{ float64Counter() }
  95. // Float64Histogram is embedded in
  96. // [go.opentelemetry.io/otel/metric.Float64Histogram].
  97. //
  98. // Embed this interface in your implementation of the
  99. // [go.opentelemetry.io/otel/metric.Float64Histogram] if you want
  100. // users to experience a compilation error, signaling they need to update to
  101. // your latest implementation, when the
  102. // [go.opentelemetry.io/otel/metric.Float64Histogram] interface is
  103. // extended (which is something that can happen without a major version bump of
  104. // the API package).
  105. type Float64Histogram interface{ float64Histogram() }
  106. // Float64ObservableCounter is embedded in
  107. // [go.opentelemetry.io/otel/metric.Float64ObservableCounter].
  108. //
  109. // Embed this interface in your implementation of the
  110. // [go.opentelemetry.io/otel/metric.Float64ObservableCounter] if you
  111. // want users to experience a compilation error, signaling they need to update
  112. // to your latest implementation, when the
  113. // [go.opentelemetry.io/otel/metric.Float64ObservableCounter]
  114. // interface is extended (which is something that can happen without a major
  115. // version bump of the API package).
  116. type Float64ObservableCounter interface{ float64ObservableCounter() }
  117. // Float64ObservableGauge is embedded in
  118. // [go.opentelemetry.io/otel/metric.Float64ObservableGauge].
  119. //
  120. // Embed this interface in your implementation of the
  121. // [go.opentelemetry.io/otel/metric.Float64ObservableGauge] if you
  122. // want users to experience a compilation error, signaling they need to update
  123. // to your latest implementation, when the
  124. // [go.opentelemetry.io/otel/metric.Float64ObservableGauge]
  125. // interface is extended (which is something that can happen without a major
  126. // version bump of the API package).
  127. type Float64ObservableGauge interface{ float64ObservableGauge() }
  128. // Float64ObservableUpDownCounter is embedded in
  129. // [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter].
  130. //
  131. // Embed this interface in your implementation of the
  132. // [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]
  133. // if you want users to experience a compilation error, signaling they need to
  134. // update to your latest implementation, when the
  135. // [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]
  136. // interface is extended (which is something that can happen without a major
  137. // version bump of the API package).
  138. type Float64ObservableUpDownCounter interface{ float64ObservableUpDownCounter() }
  139. // Float64UpDownCounter is embedded in
  140. // [go.opentelemetry.io/otel/metric.Float64UpDownCounter].
  141. //
  142. // Embed this interface in your implementation of the
  143. // [go.opentelemetry.io/otel/metric.Float64UpDownCounter] if you
  144. // want users to experience a compilation error, signaling they need to update
  145. // to your latest implementation, when the
  146. // [go.opentelemetry.io/otel/metric.Float64UpDownCounter] interface
  147. // is extended (which is something that can happen without a major version bump
  148. // of the API package).
  149. type Float64UpDownCounter interface{ float64UpDownCounter() }
  150. // Int64Counter is embedded in
  151. // [go.opentelemetry.io/otel/metric.Int64Counter].
  152. //
  153. // Embed this interface in your implementation of the
  154. // [go.opentelemetry.io/otel/metric.Int64Counter] if you want users
  155. // to experience a compilation error, signaling they need to update to your
  156. // latest implementation, when the
  157. // [go.opentelemetry.io/otel/metric.Int64Counter] interface is
  158. // extended (which is something that can happen without a major version bump of
  159. // the API package).
  160. type Int64Counter interface{ int64Counter() }
  161. // Int64Histogram is embedded in
  162. // [go.opentelemetry.io/otel/metric.Int64Histogram].
  163. //
  164. // Embed this interface in your implementation of the
  165. // [go.opentelemetry.io/otel/metric.Int64Histogram] if you want
  166. // users to experience a compilation error, signaling they need to update to
  167. // your latest implementation, when the
  168. // [go.opentelemetry.io/otel/metric.Int64Histogram] interface is
  169. // extended (which is something that can happen without a major version bump of
  170. // the API package).
  171. type Int64Histogram interface{ int64Histogram() }
  172. // Int64ObservableCounter is embedded in
  173. // [go.opentelemetry.io/otel/metric.Int64ObservableCounter].
  174. //
  175. // Embed this interface in your implementation of the
  176. // [go.opentelemetry.io/otel/metric.Int64ObservableCounter] if you
  177. // want users to experience a compilation error, signaling they need to update
  178. // to your latest implementation, when the
  179. // [go.opentelemetry.io/otel/metric.Int64ObservableCounter]
  180. // interface is extended (which is something that can happen without a major
  181. // version bump of the API package).
  182. type Int64ObservableCounter interface{ int64ObservableCounter() }
  183. // Int64ObservableGauge is embedded in
  184. // [go.opentelemetry.io/otel/metric.Int64ObservableGauge].
  185. //
  186. // Embed this interface in your implementation of the
  187. // [go.opentelemetry.io/otel/metric.Int64ObservableGauge] if you
  188. // want users to experience a compilation error, signaling they need to update
  189. // to your latest implementation, when the
  190. // [go.opentelemetry.io/otel/metric.Int64ObservableGauge] interface
  191. // is extended (which is something that can happen without a major version bump
  192. // of the API package).
  193. type Int64ObservableGauge interface{ int64ObservableGauge() }
  194. // Int64ObservableUpDownCounter is embedded in
  195. // [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter].
  196. //
  197. // Embed this interface in your implementation of the
  198. // [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] if
  199. // you want users to experience a compilation error, signaling they need to
  200. // update to your latest implementation, when the
  201. // [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter]
  202. // interface is extended (which is something that can happen without a major
  203. // version bump of the API package).
  204. type Int64ObservableUpDownCounter interface{ int64ObservableUpDownCounter() }
  205. // Int64UpDownCounter is embedded in
  206. // [go.opentelemetry.io/otel/metric.Int64UpDownCounter].
  207. //
  208. // Embed this interface in your implementation of the
  209. // [go.opentelemetry.io/otel/metric.Int64UpDownCounter] if you want
  210. // users to experience a compilation error, signaling they need to update to
  211. // your latest implementation, when the
  212. // [go.opentelemetry.io/otel/metric.Int64UpDownCounter] interface is
  213. // extended (which is something that can happen without a major version bump of
  214. // the API package).
  215. type Int64UpDownCounter interface{ int64UpDownCounter() }