generated_config.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. // Code generated by mdatagen. DO NOT EDIT.
  2. package metadata
  3. import "go.opentelemetry.io/collector/confmap"
  4. // MetricConfig provides common config for a particular metric.
  5. type MetricConfig struct {
  6. Enabled bool `mapstructure:"enabled"`
  7. enabledSetByUser bool
  8. }
  9. func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error {
  10. if parser == nil {
  11. return nil
  12. }
  13. err := parser.Unmarshal(ms, confmap.WithErrorUnused())
  14. if err != nil {
  15. return err
  16. }
  17. ms.enabledSetByUser = parser.IsSet("enabled")
  18. return nil
  19. }
  20. // MetricsConfig provides config for bigip metrics.
  21. type MetricsConfig struct {
  22. BigipNodeAvailability MetricConfig `mapstructure:"bigip.node.availability"`
  23. BigipNodeConnectionCount MetricConfig `mapstructure:"bigip.node.connection.count"`
  24. BigipNodeDataTransmitted MetricConfig `mapstructure:"bigip.node.data.transmitted"`
  25. BigipNodeEnabled MetricConfig `mapstructure:"bigip.node.enabled"`
  26. BigipNodePacketCount MetricConfig `mapstructure:"bigip.node.packet.count"`
  27. BigipNodeRequestCount MetricConfig `mapstructure:"bigip.node.request.count"`
  28. BigipNodeSessionCount MetricConfig `mapstructure:"bigip.node.session.count"`
  29. BigipPoolAvailability MetricConfig `mapstructure:"bigip.pool.availability"`
  30. BigipPoolConnectionCount MetricConfig `mapstructure:"bigip.pool.connection.count"`
  31. BigipPoolDataTransmitted MetricConfig `mapstructure:"bigip.pool.data.transmitted"`
  32. BigipPoolEnabled MetricConfig `mapstructure:"bigip.pool.enabled"`
  33. BigipPoolMemberCount MetricConfig `mapstructure:"bigip.pool.member.count"`
  34. BigipPoolPacketCount MetricConfig `mapstructure:"bigip.pool.packet.count"`
  35. BigipPoolRequestCount MetricConfig `mapstructure:"bigip.pool.request.count"`
  36. BigipPoolMemberAvailability MetricConfig `mapstructure:"bigip.pool_member.availability"`
  37. BigipPoolMemberConnectionCount MetricConfig `mapstructure:"bigip.pool_member.connection.count"`
  38. BigipPoolMemberDataTransmitted MetricConfig `mapstructure:"bigip.pool_member.data.transmitted"`
  39. BigipPoolMemberEnabled MetricConfig `mapstructure:"bigip.pool_member.enabled"`
  40. BigipPoolMemberPacketCount MetricConfig `mapstructure:"bigip.pool_member.packet.count"`
  41. BigipPoolMemberRequestCount MetricConfig `mapstructure:"bigip.pool_member.request.count"`
  42. BigipPoolMemberSessionCount MetricConfig `mapstructure:"bigip.pool_member.session.count"`
  43. BigipVirtualServerAvailability MetricConfig `mapstructure:"bigip.virtual_server.availability"`
  44. BigipVirtualServerConnectionCount MetricConfig `mapstructure:"bigip.virtual_server.connection.count"`
  45. BigipVirtualServerDataTransmitted MetricConfig `mapstructure:"bigip.virtual_server.data.transmitted"`
  46. BigipVirtualServerEnabled MetricConfig `mapstructure:"bigip.virtual_server.enabled"`
  47. BigipVirtualServerPacketCount MetricConfig `mapstructure:"bigip.virtual_server.packet.count"`
  48. BigipVirtualServerRequestCount MetricConfig `mapstructure:"bigip.virtual_server.request.count"`
  49. }
  50. func DefaultMetricsConfig() MetricsConfig {
  51. return MetricsConfig{
  52. BigipNodeAvailability: MetricConfig{
  53. Enabled: true,
  54. },
  55. BigipNodeConnectionCount: MetricConfig{
  56. Enabled: true,
  57. },
  58. BigipNodeDataTransmitted: MetricConfig{
  59. Enabled: true,
  60. },
  61. BigipNodeEnabled: MetricConfig{
  62. Enabled: true,
  63. },
  64. BigipNodePacketCount: MetricConfig{
  65. Enabled: true,
  66. },
  67. BigipNodeRequestCount: MetricConfig{
  68. Enabled: true,
  69. },
  70. BigipNodeSessionCount: MetricConfig{
  71. Enabled: true,
  72. },
  73. BigipPoolAvailability: MetricConfig{
  74. Enabled: true,
  75. },
  76. BigipPoolConnectionCount: MetricConfig{
  77. Enabled: true,
  78. },
  79. BigipPoolDataTransmitted: MetricConfig{
  80. Enabled: true,
  81. },
  82. BigipPoolEnabled: MetricConfig{
  83. Enabled: true,
  84. },
  85. BigipPoolMemberCount: MetricConfig{
  86. Enabled: true,
  87. },
  88. BigipPoolPacketCount: MetricConfig{
  89. Enabled: true,
  90. },
  91. BigipPoolRequestCount: MetricConfig{
  92. Enabled: true,
  93. },
  94. BigipPoolMemberAvailability: MetricConfig{
  95. Enabled: true,
  96. },
  97. BigipPoolMemberConnectionCount: MetricConfig{
  98. Enabled: true,
  99. },
  100. BigipPoolMemberDataTransmitted: MetricConfig{
  101. Enabled: true,
  102. },
  103. BigipPoolMemberEnabled: MetricConfig{
  104. Enabled: true,
  105. },
  106. BigipPoolMemberPacketCount: MetricConfig{
  107. Enabled: true,
  108. },
  109. BigipPoolMemberRequestCount: MetricConfig{
  110. Enabled: true,
  111. },
  112. BigipPoolMemberSessionCount: MetricConfig{
  113. Enabled: true,
  114. },
  115. BigipVirtualServerAvailability: MetricConfig{
  116. Enabled: true,
  117. },
  118. BigipVirtualServerConnectionCount: MetricConfig{
  119. Enabled: true,
  120. },
  121. BigipVirtualServerDataTransmitted: MetricConfig{
  122. Enabled: true,
  123. },
  124. BigipVirtualServerEnabled: MetricConfig{
  125. Enabled: true,
  126. },
  127. BigipVirtualServerPacketCount: MetricConfig{
  128. Enabled: true,
  129. },
  130. BigipVirtualServerRequestCount: MetricConfig{
  131. Enabled: true,
  132. },
  133. }
  134. }
  135. // ResourceAttributeConfig provides common config for a particular resource attribute.
  136. type ResourceAttributeConfig struct {
  137. Enabled bool `mapstructure:"enabled"`
  138. enabledSetByUser bool
  139. }
  140. func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error {
  141. if parser == nil {
  142. return nil
  143. }
  144. err := parser.Unmarshal(rac, confmap.WithErrorUnused())
  145. if err != nil {
  146. return err
  147. }
  148. rac.enabledSetByUser = parser.IsSet("enabled")
  149. return nil
  150. }
  151. // ResourceAttributesConfig provides config for bigip resource attributes.
  152. type ResourceAttributesConfig struct {
  153. BigipNodeIPAddress ResourceAttributeConfig `mapstructure:"bigip.node.ip_address"`
  154. BigipNodeName ResourceAttributeConfig `mapstructure:"bigip.node.name"`
  155. BigipPoolName ResourceAttributeConfig `mapstructure:"bigip.pool.name"`
  156. BigipPoolMemberIPAddress ResourceAttributeConfig `mapstructure:"bigip.pool_member.ip_address"`
  157. BigipPoolMemberName ResourceAttributeConfig `mapstructure:"bigip.pool_member.name"`
  158. BigipVirtualServerDestination ResourceAttributeConfig `mapstructure:"bigip.virtual_server.destination"`
  159. BigipVirtualServerName ResourceAttributeConfig `mapstructure:"bigip.virtual_server.name"`
  160. }
  161. func DefaultResourceAttributesConfig() ResourceAttributesConfig {
  162. return ResourceAttributesConfig{
  163. BigipNodeIPAddress: ResourceAttributeConfig{
  164. Enabled: true,
  165. },
  166. BigipNodeName: ResourceAttributeConfig{
  167. Enabled: true,
  168. },
  169. BigipPoolName: ResourceAttributeConfig{
  170. Enabled: true,
  171. },
  172. BigipPoolMemberIPAddress: ResourceAttributeConfig{
  173. Enabled: true,
  174. },
  175. BigipPoolMemberName: ResourceAttributeConfig{
  176. Enabled: true,
  177. },
  178. BigipVirtualServerDestination: ResourceAttributeConfig{
  179. Enabled: true,
  180. },
  181. BigipVirtualServerName: ResourceAttributeConfig{
  182. Enabled: true,
  183. },
  184. }
  185. }
  186. // MetricsBuilderConfig is a configuration for bigip metrics builder.
  187. type MetricsBuilderConfig struct {
  188. Metrics MetricsConfig `mapstructure:"metrics"`
  189. ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
  190. }
  191. func DefaultMetricsBuilderConfig() MetricsBuilderConfig {
  192. return MetricsBuilderConfig{
  193. Metrics: DefaultMetricsConfig(),
  194. ResourceAttributes: DefaultResourceAttributesConfig(),
  195. }
  196. }