embedded.go 11 KB

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